Pass FrameToken from MainThreadDebugger::consoleAPIMessage down to WebContentsDelegate::DidAddMessageToConsole and WebContentsObserver::OnDidAddMessageToConsole. [chromium/src : main]

0 views
Skip to first unread message

Tomasz Malinowski (Gerrit)

unread,
Oct 8, 2025, 6:40:17 AMOct 8
to Alex Rudenko, Alex Moshchuk, chromium...@chromium.org, Kentaro Hara, Nate Chapin, Raphael Kubo da Costa, Kevin McNee, Peter Beverloo, James Maclean, Zijie He, alexmo...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, chromeos-kio...@google.com, chromium-a...@chromium.org, creis...@chromium.org, devtools-re...@chromium.org, devtools...@chromium.org, dibyapal+wa...@chromium.org, dmurph+watc...@chromium.org, extension...@chromium.org, fuchsia...@chromium.org, gavinp...@chromium.org, headless...@chromium.org, ipc-securi...@chromium.org, jimmyxgong+w...@chromium.org, kinuko...@chromium.org, kuragin+web-ap...@chromium.org, loading...@chromium.org, loyso...@chromium.org, mgiuca...@chromium.org, michaelcheco+...@google.com, navigation...@chromium.org, oshima...@chromium.org, philli...@chromium.org, webap...@microsoft.com, zelin+watch-we...@chromium.org
Attention needed from Alex Moshchuk and Alex Rudenko

Tomasz Malinowski added 1 comment

Patchset-level comments
File-level comment, Patchset 1 (Latest):
Tomasz Malinowski . resolved

This is proposal to pass information about frame which send log (FrameToken) from MainThreadDebugger::consoleAPIMessage down to WebContentsDelegate::DidAddMessageToConsole and WebContentsObserver::OnDidAddMessageToConsole.

It is result of change in V8:
V8 changes - https://chromium-review.googlesource.com/c/v8/v8/+/6811579
V8 ticket - https://issues.chromium.org/u/1/issues/437026560

Open in Gerrit

Related details

Attention is currently required from:
  • Alex Moshchuk
  • Alex Rudenko
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I3b570a6c7c38f7ea4520e09ecb5cfc7c2d992698
Gerrit-Change-Number: 7019174
Gerrit-PatchSet: 1
Gerrit-Owner: Tomasz Malinowski <tomasz.cr...@gmail.com>
Gerrit-Reviewer: Alex Moshchuk <ale...@chromium.org>
Gerrit-Reviewer: Alex Rudenko <alexr...@chromium.org>
Gerrit-CC: James Maclean <wjma...@chromium.org>
Gerrit-CC: Kentaro Hara <har...@chromium.org>
Gerrit-CC: Kevin McNee <mc...@chromium.org>
Gerrit-CC: Nate Chapin <jap...@chromium.org>
Gerrit-CC: Peter Beverloo <pe...@chromium.org>
Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
Gerrit-CC: Zijie He <zij...@google.com>
Gerrit-Attention: Alex Moshchuk <ale...@chromium.org>
Gerrit-Attention: Alex Rudenko <alexr...@chromium.org>
Gerrit-Comment-Date: Wed, 08 Oct 2025 10:39:28 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Alex Moshchuk (Gerrit)

unread,
Oct 9, 2025, 8:05:28 PMOct 9
to Tomasz Malinowski, Alex Rudenko, chromium...@chromium.org, Kentaro Hara, Nate Chapin, Raphael Kubo da Costa, Kevin McNee, Peter Beverloo, James Maclean, Zijie He, alexmo...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, chromeos-kio...@google.com, chromium-a...@chromium.org, creis...@chromium.org, devtools-re...@chromium.org, devtools...@chromium.org, dibyapal+wa...@chromium.org, dmurph+watc...@chromium.org, extension...@chromium.org, fuchsia...@chromium.org, gavinp...@chromium.org, headless...@chromium.org, ipc-securi...@chromium.org, jimmyxgong+w...@chromium.org, kinuko...@chromium.org, kuragin+web-ap...@chromium.org, loading...@chromium.org, loyso...@chromium.org, mgiuca...@chromium.org, michaelcheco+...@google.com, navigation...@chromium.org, oshima...@chromium.org, philli...@chromium.org, webap...@microsoft.com, zelin+watch-we...@chromium.org
Attention needed from Alex Rudenko and Tomasz Malinowski

Alex Moshchuk added 2 comments

Patchset-level comments
Alex Moshchuk . resolved

Thanks for the CL. I'm curious to hear alexrudenko@'s thoughts on whether this is needed from a devtools perspective, and in the meantime a couple of comments from a content owner perspective.

File content/public/browser/web_contents_observer.h
Line 851, Patchset 1 (Latest): const std::optional<std::u16string>& source_frame_token) {}
Alex Moshchuk . unresolved

How is this going to be used outside of //content? I don't see any uses of this, only the plumbing to make it available, but this goes against the guidelines for introducing content/public APIs, where each addition must be accompanied by code that uses it outside of //content (https://chromium.googlesource.com/chromium/src/+/HEAD/content/public/README.md).

The other concern I have with this is that the `source_frame_token` seems to come from the (possibly compromised) renderer, so we need to be careful with how it's going to be used, and possibly validate that it corresponds to a valid frame prior to plumbing it for use outside //content. What kind of token is this? For example, LocalFrameTokens can't be resolved to frames without a valid process ID (https://source.chromium.org/chromium/chromium/src/+/main:content/browser/renderer_host/render_frame_host_impl.h;l=358-365;drc=62a9a00176f862e688fa47919ed6f19b59f77b5f).

Open in Gerrit

Related details

Attention is currently required from:
  • Alex Rudenko
  • Tomasz Malinowski
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I3b570a6c7c38f7ea4520e09ecb5cfc7c2d992698
    Gerrit-Change-Number: 7019174
    Gerrit-PatchSet: 1
    Gerrit-Owner: Tomasz Malinowski <tomasz.cr...@gmail.com>
    Gerrit-Reviewer: Alex Moshchuk <ale...@chromium.org>
    Gerrit-Reviewer: Alex Rudenko <alexr...@chromium.org>
    Gerrit-CC: James Maclean <wjma...@chromium.org>
    Gerrit-CC: Kentaro Hara <har...@chromium.org>
    Gerrit-CC: Kevin McNee <mc...@chromium.org>
    Gerrit-CC: Nate Chapin <jap...@chromium.org>
    Gerrit-CC: Peter Beverloo <pe...@chromium.org>
    Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
    Gerrit-CC: Zijie He <zij...@google.com>
    Gerrit-Attention: Tomasz Malinowski <tomasz.cr...@gmail.com>
    Gerrit-Attention: Alex Rudenko <alexr...@chromium.org>
    Gerrit-Comment-Date: Fri, 10 Oct 2025 00:05:04 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Alex Rudenko (Gerrit)

    unread,
    Oct 10, 2025, 2:55:16 AMOct 10
    to Tomasz Malinowski, Simon Zünd, Alex Moshchuk, chromium...@chromium.org, Kentaro Hara, Nate Chapin, Raphael Kubo da Costa, Kevin McNee, Peter Beverloo, James Maclean, Zijie He, alexmo...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, chromeos-kio...@google.com, chromium-a...@chromium.org, creis...@chromium.org, devtools-re...@chromium.org, devtools...@chromium.org, dibyapal+wa...@chromium.org, dmurph+watc...@chromium.org, extension...@chromium.org, fuchsia...@chromium.org, gavinp...@chromium.org, headless...@chromium.org, ipc-securi...@chromium.org, jimmyxgong+w...@chromium.org, kinuko...@chromium.org, kuragin+web-ap...@chromium.org, loading...@chromium.org, loyso...@chromium.org, mgiuca...@chromium.org, michaelcheco+...@google.com, navigation...@chromium.org, oshima...@chromium.org, philli...@chromium.org, webap...@microsoft.com, zelin+watch-we...@chromium.org
    Attention needed from Simon Zünd and Tomasz Malinowski

    Alex Rudenko added 2 comments

    Patchset-level comments
    Alex Rudenko . unresolved

    @szu...@chromium.org could you please review? I saw you reviewed corresponding v8 changes.

    File third_party/blink/renderer/core/inspector/main_thread_debugger.cc
    Line 403, Patchset 1 (Latest): frame->Console().ReportMessageToClient(
    Alex Rudenko . unresolved

    is not `frame` already referring to the source frame?

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Simon Zünd
    • Tomasz Malinowski
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I3b570a6c7c38f7ea4520e09ecb5cfc7c2d992698
    Gerrit-Change-Number: 7019174
    Gerrit-PatchSet: 1
    Gerrit-Owner: Tomasz Malinowski <tomasz.cr...@gmail.com>
    Gerrit-Reviewer: Alex Moshchuk <ale...@chromium.org>
    Gerrit-Reviewer: Alex Rudenko <alexr...@chromium.org>
    Gerrit-Reviewer: Simon Zünd <szu...@chromium.org>
    Gerrit-CC: James Maclean <wjma...@chromium.org>
    Gerrit-CC: Kentaro Hara <har...@chromium.org>
    Gerrit-CC: Kevin McNee <mc...@chromium.org>
    Gerrit-CC: Nate Chapin <jap...@chromium.org>
    Gerrit-CC: Peter Beverloo <pe...@chromium.org>
    Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
    Gerrit-CC: Zijie He <zij...@google.com>
    Gerrit-Attention: Tomasz Malinowski <tomasz.cr...@gmail.com>
    Gerrit-Attention: Simon Zünd <szu...@chromium.org>
    Gerrit-Comment-Date: Fri, 10 Oct 2025 06:54:27 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Simon Zünd (Gerrit)

    unread,
    Oct 10, 2025, 3:22:53 AMOct 10
    to Tomasz Malinowski, Chromium LUCI CQ, Alex Rudenko, Alex Moshchuk, chromium...@chromium.org, Kentaro Hara, Nate Chapin, Raphael Kubo da Costa, Kevin McNee, Peter Beverloo, James Maclean, Zijie He, alexmo...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, chromeos-kio...@google.com, chromium-a...@chromium.org, creis...@chromium.org, devtools-re...@chromium.org, devtools...@chromium.org, dibyapal+wa...@chromium.org, dmurph+watc...@chromium.org, extension...@chromium.org, fuchsia...@chromium.org, gavinp...@chromium.org, headless...@chromium.org, ipc-securi...@chromium.org, jimmyxgong+w...@chromium.org, kinuko...@chromium.org, kuragin+web-ap...@chromium.org, loading...@chromium.org, loyso...@chromium.org, mgiuca...@chromium.org, michaelcheco+...@google.com, navigation...@chromium.org, oshima...@chromium.org, philli...@chromium.org, webap...@microsoft.com, zelin+watch-we...@chromium.org
    Attention needed from Alex Rudenko and Tomasz Malinowski

    Simon Zünd added 2 comments

    Patchset-level comments
    Simon Zünd . unresolved

    The V8 change in and of itself was fine. Whether or not it's ok to pass up the frame token through all layers of abstraction (also w.r.t. to security) I'm not able to judge so I'll defer to Chromium owners here.

    One thing to note thats not clear from the CL description: IIUC the frame token will not actually be used anywhere in Chrome/Chromium, but it's a third party browser that implements a custom `WebContentsDelegate`.

    File third_party/blink/renderer/core/inspector/main_thread_debugger.cc
    Line 403, Patchset 1 (Latest): frame->Console().ReportMessageToClient(
    Alex Rudenko . unresolved

    is not `frame` already referring to the source frame?

    Simon Zünd

    For same origin iframes, `frame` and `local_frame` will differ.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Alex Rudenko
    • Tomasz Malinowski
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I3b570a6c7c38f7ea4520e09ecb5cfc7c2d992698
    Gerrit-Change-Number: 7019174
    Gerrit-PatchSet: 1
    Gerrit-Owner: Tomasz Malinowski <tomasz.cr...@gmail.com>
    Gerrit-Reviewer: Alex Moshchuk <ale...@chromium.org>
    Gerrit-Reviewer: Alex Rudenko <alexr...@chromium.org>
    Gerrit-Reviewer: Simon Zünd <szu...@chromium.org>
    Gerrit-CC: James Maclean <wjma...@chromium.org>
    Gerrit-CC: Kentaro Hara <har...@chromium.org>
    Gerrit-CC: Kevin McNee <mc...@chromium.org>
    Gerrit-CC: Nate Chapin <jap...@chromium.org>
    Gerrit-CC: Peter Beverloo <pe...@chromium.org>
    Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
    Gerrit-CC: Zijie He <zij...@google.com>
    Gerrit-Attention: Alex Rudenko <alexr...@chromium.org>
    Gerrit-Attention: Tomasz Malinowski <tomasz.cr...@gmail.com>
    Gerrit-Comment-Date: Fri, 10 Oct 2025 07:22:04 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Alex Rudenko <alexr...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Alex Moshchuk (Gerrit)

    unread,
    Oct 10, 2025, 2:42:06 PMOct 10
    to Tomasz Malinowski, Chromium LUCI CQ, Alex Rudenko, Simon Zünd, chromium...@chromium.org, Kentaro Hara, Nate Chapin, Raphael Kubo da Costa, Kevin McNee, Peter Beverloo, James Maclean, Zijie He, alexmo...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, chromeos-kio...@google.com, chromium-a...@chromium.org, creis...@chromium.org, devtools-re...@chromium.org, devtools...@chromium.org, dibyapal+wa...@chromium.org, dmurph+watc...@chromium.org, extension...@chromium.org, fuchsia...@chromium.org, gavinp...@chromium.org, headless...@chromium.org, ipc-securi...@chromium.org, jimmyxgong+w...@chromium.org, kinuko...@chromium.org, kuragin+web-ap...@chromium.org, loading...@chromium.org, loyso...@chromium.org, mgiuca...@chromium.org, michaelcheco+...@google.com, navigation...@chromium.org, oshima...@chromium.org, philli...@chromium.org, webap...@microsoft.com, zelin+watch-we...@chromium.org
    Attention needed from Alex Rudenko and Tomasz Malinowski

    Alex Moshchuk added 1 comment

    Patchset-level comments
    Simon Zünd . unresolved

    The V8 change in and of itself was fine. Whether or not it's ok to pass up the frame token through all layers of abstraction (also w.r.t. to security) I'm not able to judge so I'll defer to Chromium owners here.

    One thing to note thats not clear from the CL description: IIUC the frame token will not actually be used anywhere in Chrome/Chromium, but it's a third party browser that implements a custom `WebContentsDelegate`.

    Alex Moshchuk

    If this is the case, this unfortunately goes against our guidelines for accepting this code change: see https://chromium.googlesource.com/chromium/src/+/main/docs/contributing.md#code-guidelines under "Code in the Chromium project should be in service of other code in the Chromium project."

    In similar cases in the past, we only proceeded with a change like this if we also found a valid use case in the codebase which meaningfully benefits Chromium.

    Gerrit-Comment-Date: Fri, 10 Oct 2025 18:41:41 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Simon Zünd <szu...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Tomasz Malinowski (Gerrit)

    unread,
    Nov 19, 2025, 6:27:42 AMNov 19
    to Chromium LUCI CQ, Alex Rudenko, Simon Zünd, Alex Moshchuk, chromium...@chromium.org, Kentaro Hara, Nate Chapin, Raphael Kubo da Costa, Kevin McNee, Peter Beverloo, James Maclean, Zijie He, alexmo...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, chromeos-kio...@google.com, chromium-a...@chromium.org, creis...@chromium.org, devtools-re...@chromium.org, devtools...@chromium.org, dibyapal+wa...@chromium.org, dmurph+watc...@chromium.org, extension...@chromium.org, fuchsia...@chromium.org, gavinp...@chromium.org, headless...@chromium.org, ipc-securi...@chromium.org, jimmyxgong+w...@chromium.org, kinuko...@chromium.org, kuragin+web-ap...@chromium.org, loading...@chromium.org, loyso...@chromium.org, mgiuca...@chromium.org, michaelcheco+...@google.com, navigation...@chromium.org, oshima...@chromium.org, philli...@chromium.org, webap...@microsoft.com, zelin+watch-we...@chromium.org
    Attention needed from Alex Moshchuk

    Tomasz Malinowski added 1 comment

    File content/public/browser/web_contents_observer.h
    Line 851, Patchset 1 (Latest): const std::optional<std::u16string>& source_frame_token) {}
    Alex Moshchuk . unresolved

    How is this going to be used outside of //content? I don't see any uses of this, only the plumbing to make it available, but this goes against the guidelines for introducing content/public APIs, where each addition must be accompanied by code that uses it outside of //content (https://chromium.googlesource.com/chromium/src/+/HEAD/content/public/README.md).

    The other concern I have with this is that the `source_frame_token` seems to come from the (possibly compromised) renderer, so we need to be careful with how it's going to be used, and possibly validate that it corresponds to a valid frame prior to plumbing it for use outside //content. What kind of token is this? For example, LocalFrameTokens can't be resolved to frames without a valid process ID (https://source.chromium.org/chromium/chromium/src/+/main:content/browser/renderer_host/render_frame_host_impl.h;l=358-365;drc=62a9a00176f862e688fa47919ed6f19b59f77b5f).

    Tomasz Malinowski

    Q: How is this going to be used outside of //content?
    A: It will be used to get proper RenderFrameHost and get more info about frame which send this log, e.g.: Frame name.

    Q: What kind of token is this? For example, LocalFrameTokens can't be resolved to frames without a valid process ID.
    A: Yes, you have right, That is why I plan to replace const std::optional<std::u16string>& source_frame_token to const std::optional<content::GlobalRenderFrameHostToken>& source_frame_global_token. This will resolve problem of finding correct frame on browser process side.

    My questions:
    About this policy: https://chromium.googlesource.com/chromium/src/+/HEAD/content/public/README.md
    If I will not go outside //content , then it will be accepted to have it integrated in to chromium ? I was thinking to pass source_frame_global_token only down to RenderFrameHostDelegate.
    Also I was inspired by const std::optional<std::u16string>& untrusted_stack_trace which is passed everywhere but used only it two places and mostly only in dev logs.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Alex Moshchuk
    Gerrit-Attention: Alex Moshchuk <ale...@chromium.org>
    Gerrit-Comment-Date: Wed, 19 Nov 2025 11:27:27 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Alex Moshchuk <ale...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Tomasz Malinowski (Gerrit)

    unread,
    Dec 3, 2025, 8:42:17 AM (3 days ago) Dec 3
    to Chromium LUCI CQ, Alex Rudenko, Simon Zünd, Alex Moshchuk, chromium...@chromium.org, Kentaro Hara, Nate Chapin, Raphael Kubo da Costa, Kevin McNee, Peter Beverloo, James Maclean, Zijie He, alexmo...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, chromeos-kio...@google.com, chromium-a...@chromium.org, creis...@chromium.org, devtools-re...@chromium.org, devtools...@chromium.org, dibyapal+wa...@chromium.org, dmurph+watc...@chromium.org, extension...@chromium.org, fuchsia...@chromium.org, gavinp...@chromium.org, headless...@chromium.org, ipc-securi...@chromium.org, jimmyxgong+w...@chromium.org, kinuko...@chromium.org, kuragin+web-ap...@chromium.org, loading...@chromium.org, loyso...@chromium.org, mgiuca...@chromium.org, michaelcheco+...@google.com, navigation...@chromium.org, oshima...@chromium.org, philli...@chromium.org, webap...@microsoft.com, zelin+watch-we...@chromium.org
    Attention needed from Alex Moshchuk

    Tomasz Malinowski added 1 comment

    File content/public/browser/web_contents_observer.h
    Line 851, Patchset 1 (Latest): const std::optional<std::u16string>& source_frame_token) {}
    Alex Moshchuk . unresolved

    How is this going to be used outside of //content? I don't see any uses of this, only the plumbing to make it available, but this goes against the guidelines for introducing content/public APIs, where each addition must be accompanied by code that uses it outside of //content (https://chromium.googlesource.com/chromium/src/+/HEAD/content/public/README.md).

    The other concern I have with this is that the `source_frame_token` seems to come from the (possibly compromised) renderer, so we need to be careful with how it's going to be used, and possibly validate that it corresponds to a valid frame prior to plumbing it for use outside //content. What kind of token is this? For example, LocalFrameTokens can't be resolved to frames without a valid process ID (https://source.chromium.org/chromium/chromium/src/+/main:content/browser/renderer_host/render_frame_host_impl.h;l=358-365;drc=62a9a00176f862e688fa47919ed6f19b59f77b5f).

    Tomasz Malinowski

    Q: How is this going to be used outside of //content?
    A: It will be used to get proper RenderFrameHost and get more info about frame which send this log, e.g.: Frame name.

    Q: What kind of token is this? For example, LocalFrameTokens can't be resolved to frames without a valid process ID.
    A: Yes, you have right, That is why I plan to replace const std::optional<std::u16string>& source_frame_token to const std::optional<content::GlobalRenderFrameHostToken>& source_frame_global_token. This will resolve problem of finding correct frame on browser process side.

    My questions:
    About this policy: https://chromium.googlesource.com/chromium/src/+/HEAD/content/public/README.md
    If I will not go outside //content , then it will be accepted to have it integrated in to chromium ? I was thinking to pass source_frame_global_token only down to RenderFrameHostDelegate.
    Also I was inspired by const std::optional<std::u16string>& untrusted_stack_trace which is passed everywhere but used only it two places and mostly only in dev logs.

    Tomasz Malinowski

    @ale...@chromium.org any thoughts about above comment ?

    Gerrit-Comment-Date: Wed, 03 Dec 2025 13:41:59 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Alex Moshchuk <ale...@chromium.org>
    Comment-In-Reply-To: Tomasz Malinowski <tomasz.cr...@gmail.com>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Alex Moshchuk (Gerrit)

    unread,
    Dec 5, 2025, 9:09:09 PM (6 hours ago) Dec 5
    to Tomasz Malinowski, Chromium LUCI CQ, Alex Rudenko, Simon Zünd, chromium...@chromium.org, Kentaro Hara, Nate Chapin, Raphael Kubo da Costa, Kevin McNee, Peter Beverloo, James Maclean, Zijie He, alexmo...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, chromeos-kio...@google.com, chromium-a...@chromium.org, creis...@chromium.org, devtools-re...@chromium.org, devtools...@chromium.org, dibyapal+wa...@chromium.org, dmurph+watc...@chromium.org, extension...@chromium.org, fuchsia...@chromium.org, gavinp...@chromium.org, headless...@chromium.org, ipc-securi...@chromium.org, jimmyxgong+w...@chromium.org, kinuko...@chromium.org, kuragin+web-ap...@chromium.org, loading...@chromium.org, loyso...@chromium.org, mgiuca...@chromium.org, michaelcheco+...@google.com, navigation...@chromium.org, oshima...@chromium.org, philli...@chromium.org, webap...@microsoft.com, zelin+watch-we...@chromium.org
    Attention needed from Tomasz Malinowski

    Alex Moshchuk added 1 comment

    File content/public/browser/web_contents_observer.h
    Line 851, Patchset 1 (Latest): const std::optional<std::u16string>& source_frame_token) {}
    Alex Moshchuk . unresolved

    How is this going to be used outside of //content? I don't see any uses of this, only the plumbing to make it available, but this goes against the guidelines for introducing content/public APIs, where each addition must be accompanied by code that uses it outside of //content (https://chromium.googlesource.com/chromium/src/+/HEAD/content/public/README.md).

    The other concern I have with this is that the `source_frame_token` seems to come from the (possibly compromised) renderer, so we need to be careful with how it's going to be used, and possibly validate that it corresponds to a valid frame prior to plumbing it for use outside //content. What kind of token is this? For example, LocalFrameTokens can't be resolved to frames without a valid process ID (https://source.chromium.org/chromium/chromium/src/+/main:content/browser/renderer_host/render_frame_host_impl.h;l=358-365;drc=62a9a00176f862e688fa47919ed6f19b59f77b5f).

    Tomasz Malinowski

    Q: How is this going to be used outside of //content?
    A: It will be used to get proper RenderFrameHost and get more info about frame which send this log, e.g.: Frame name.

    Q: What kind of token is this? For example, LocalFrameTokens can't be resolved to frames without a valid process ID.
    A: Yes, you have right, That is why I plan to replace const std::optional<std::u16string>& source_frame_token to const std::optional<content::GlobalRenderFrameHostToken>& source_frame_global_token. This will resolve problem of finding correct frame on browser process side.

    My questions:
    About this policy: https://chromium.googlesource.com/chromium/src/+/HEAD/content/public/README.md
    If I will not go outside //content , then it will be accepted to have it integrated in to chromium ? I was thinking to pass source_frame_global_token only down to RenderFrameHostDelegate.
    Also I was inspired by const std::optional<std::u16string>& untrusted_stack_trace which is passed everywhere but used only it two places and mostly only in dev logs.

    Tomasz Malinowski

    @ale...@chromium.org any thoughts about above comment ?

    Alex Moshchuk

    If I will not go outside //content , then it will be accepted to have it integrated in to chromium ? I was thinking to pass source_frame_global_token only down to RenderFrameHostDelegate.

    In order for it to be accepted, I think it would still need to be used for an improvement in Chromium itself, according to the guidance I mentioned in https://chromium-review.googlesource.com/c/chromium/src/+/7019174/comments/cd8d3807_c36ca160. For example, the `untrusted_stack_trace` seems to [improve](https://source.chromium.org/chromium/chromium/src/+/main:content/browser/devtools/devtools_frontend_host_impl.cc;l=186;drc=c1b102f35ec290df46da5093c2ab90d6616134c6) JS error reporting in DevTools (though I'm not familiar with its exact usage and defer to DevTools owners there). I don't think we can accept a plumbing-only patch without a concrete followup CL lined up that uses the new token. If those uses are going to be within content, then the plumbing would also need to stay within content.

    Q: How is this going to be used outside of //content?
    A: It will be used to get proper RenderFrameHost and get more info about frame which send this log, e.g.: Frame name.

    I think this is still too vague - I think we'd want an implementation of a feature/improvement where this new info would be used in Chromium.

    Also, as a separate issue, I wonder if the source frame might be gone by the time the token gets used, and if it would be more robust to capture things like the frame name at the time the message is generated.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Tomasz Malinowski
    Gerrit-Attention: Tomasz Malinowski <tomasz.cr...@gmail.com>
    Gerrit-Comment-Date: Sat, 06 Dec 2025 02:08:59 +0000
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy
    Reply all
    Reply to author
    Forward
    0 new messages