[Heavy Ad] Add Capability to Send Report to the Embedding Frame [chromium/src : main]

0 views
Skip to first unread message

Alex Moshchuk (Gerrit)

unread,
Sep 15, 2025, 12:04:16 PM (3 days ago) Sep 15
to Yao Xiao, Daniel Cheng, Josh Karlin, AI Code Reviewer, Chromium LUCI CQ, chromium...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, bmcquad...@chromium.org, creis...@chromium.org, csharris...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, loading-rev...@chromium.org, navigation...@chromium.org, speed-metrics...@chromium.org, speed-metr...@chromium.org
Attention needed from Daniel Cheng and Yao Xiao

Alex Moshchuk added 4 comments

File components/page_load_metrics/browser/observers/ad_metrics/ads_page_load_metrics_observer.cc
Line 1461, Patchset 12 (Latest): if (parent && (&render_frame_host->GetPage() == &parent->GetPage()) &&
Alex Moshchuk . unresolved

Can these actually ever be different, given that parent is obtained via `GetParent()`? Fenced frames wouldn't do it, since GetParent() doesn't cross the fenced boundary, unless you meant to use GetParentOrOuterDocument - is this expected to work for a fenced frame? (I'd expect no, since that'd leak information.)

Line 1462, Patchset 12 (Latest): parent->IsRenderFrameLive()) {
Alex Moshchuk . unresolved
File content/browser/renderer_host/render_frame_host_impl.cc
Line 7726, Patchset 12 (Latest): DCHECK_EQ(child_frame->GetParent(), this);
Alex Moshchuk . unresolved

Nit: latest guidance is to prefer CHECK_EQ

File third_party/blink/public/mojom/frame/frame.mojom
Line 901, Patchset 12 (Latest): // additional info for the child frame before the report is sent.
Alex Moshchuk . unresolved

Can you mention the token could refer to either a frame or a proxy, in case the child frame is remote?

Open in Gerrit

Related details

Attention is currently required from:
  • Daniel Cheng
  • Yao Xiao
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
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: I5d988494dbbcd0aa6a9090745913369e7791e4a7
Gerrit-Change-Number: 6937085
Gerrit-PatchSet: 12
Gerrit-Owner: Yao Xiao <yao...@chromium.org>
Gerrit-Reviewer: Alex Moshchuk <ale...@chromium.org>
Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
Gerrit-Reviewer: Josh Karlin <jka...@chromium.org>
Gerrit-Reviewer: Yao Xiao <yao...@chromium.org>
Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
Gerrit-Attention: Yao Xiao <yao...@chromium.org>
Gerrit-Comment-Date: Mon, 15 Sep 2025 16:04:03 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Daniel Cheng (Gerrit)

unread,
Sep 15, 2025, 6:12:51 PM (2 days ago) Sep 15
to Yao Xiao, Alex Moshchuk, Daniel Cheng, Josh Karlin, AI Code Reviewer, Chromium LUCI CQ, chromium...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, bmcquad...@chromium.org, creis...@chromium.org, csharris...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, loading-rev...@chromium.org, navigation...@chromium.org, speed-metrics...@chromium.org, speed-metr...@chromium.org
Attention needed from Yao Xiao

Daniel Cheng added 5 comments

File third_party/blink/renderer/core/frame/local_frame_mojo_handler.cc
Line 540, Patchset 12 (Latest): if (child_frame_token->Is<RemoteFrameToken>()) {
child_frame = blink::RemoteFrame::FromFrameToken(
child_frame_token->GetAs<RemoteFrameToken>());
} else {
child_frame = blink::LocalFrame::FromFrameToken(
child_frame_token->GetAs<LocalFrameToken>());
}
Daniel Cheng . unresolved

I'm not sure why it's named differently, but you can use `Frame::ResolveFrame()` to replace these lines.

Line 549, Patchset 12 (Latest): if (auto* frame_owner = child_frame->DeprecatedLocalOwner()) {
Daniel Cheng . unresolved

I would have expected the intervention to be routed to the frame that owns the frame element for `child_frame` if `child_frame_token` is set. Is that not the case?

(Maybe the Mojo comments should be a bit clearer about which process gets the report)

Line 553, Patchset 12 (Latest): builder.Append(frame_owner->ElementInfoForInterventionReport());
Daniel Cheng . unresolved

This is still kind of inefficient. Do we really need the `url` or can we just use the `src` attribute from the frame element instead?

File third_party/blink/renderer/core/html/html_frame_element_base.cc
Line 301, Patchset 12 (Latest): KURL url = GetDocument().CompleteURL(url_);

// Any URLs in the report should strip the username, password, and fragment.
// https://w3c.github.io/reporting/#capability-urls
String sanitized_url = url.StrippedForUseAsReferrer();

StringBuilder builder;
builder.Append("id=");
builder.Append(GetIdAttribute());
builder.Append(";url=");
builder.Append(sanitized_url);
return builder.ReleaseString();
Daniel Cheng . unresolved

Probably just put this all in the intervention handler? No one else calls this anyway, and it's a bit less efficient this way.

File third_party/blink/renderer/core/html/html_frame_owner_element.cc
Line 195, Patchset 12 (Latest): return String();
Daniel Cheng . unresolved

And we won't need this empty implementation either then (we would use `DynamicTo<HTMLFrameElementBase>` to get to the bits we needed)

Open in Gerrit

Related details

Attention is currently required from:
  • Yao Xiao
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
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: I5d988494dbbcd0aa6a9090745913369e7791e4a7
Gerrit-Change-Number: 6937085
Gerrit-PatchSet: 12
Gerrit-Owner: Yao Xiao <yao...@chromium.org>
Gerrit-Reviewer: Alex Moshchuk <ale...@chromium.org>
Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
Gerrit-Reviewer: Josh Karlin <jka...@chromium.org>
Gerrit-Reviewer: Yao Xiao <yao...@chromium.org>
Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
Gerrit-Attention: Yao Xiao <yao...@chromium.org>
Gerrit-Comment-Date: Mon, 15 Sep 2025 22:12:41 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Yao Xiao (Gerrit)

unread,
Sep 15, 2025, 7:57:28 PM (2 days ago) Sep 15
to Alex Moshchuk, Daniel Cheng, Josh Karlin, AI Code Reviewer, Chromium LUCI CQ, chromium...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, bmcquad...@chromium.org, creis...@chromium.org, csharris...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, loading-rev...@chromium.org, navigation...@chromium.org, speed-metrics...@chromium.org, speed-metr...@chromium.org
Attention needed from Alex Moshchuk and Daniel Cheng

Yao Xiao added 8 comments

File components/page_load_metrics/browser/observers/ad_metrics/ads_page_load_metrics_observer.cc
Line 1461, Patchset 12: if (parent && (&render_frame_host->GetPage() == &parent->GetPage()) &&
Alex Moshchuk . resolved

Can these actually ever be different, given that parent is obtained via `GetParent()`? Fenced frames wouldn't do it, since GetParent() doesn't cross the fenced boundary, unless you meant to use GetParentOrOuterDocument - is this expected to work for a fenced frame? (I'd expect no, since that'd leak information.)

Yao Xiao

Ack. I had the same suspicion but wasn't sure about edge cases (FFs, Portals, etc.), so I played it safe. Given your second opinion, I've removed the condition.

Line 1462, Patchset 12: parent->IsRenderFrameLive()) {
Alex Moshchuk . resolved
Yao Xiao

Ack. Removed.

File content/browser/renderer_host/render_frame_host_impl.cc
Line 7726, Patchset 12: DCHECK_EQ(child_frame->GetParent(), this);
Alex Moshchuk . resolved

Nit: latest guidance is to prefer CHECK_EQ

Yao Xiao

Done

File third_party/blink/public/mojom/frame/frame.mojom
Line 901, Patchset 12: // additional info for the child frame before the report is sent.
Alex Moshchuk . resolved

Can you mention the token could refer to either a frame or a proxy, in case the child frame is remote?

Yao Xiao

Done

File third_party/blink/renderer/core/frame/local_frame_mojo_handler.cc
Line 540, Patchset 12: if (child_frame_token->Is<RemoteFrameToken>()) {

child_frame = blink::RemoteFrame::FromFrameToken(
child_frame_token->GetAs<RemoteFrameToken>());
} else {
child_frame = blink::LocalFrame::FromFrameToken(
child_frame_token->GetAs<LocalFrameToken>());
}
Daniel Cheng . resolved

I'm not sure why it's named differently, but you can use `Frame::ResolveFrame()` to replace these lines.

Yao Xiao

Done

Line 549, Patchset 12: if (auto* frame_owner = child_frame->DeprecatedLocalOwner()) {
Daniel Cheng . unresolved

I would have expected the intervention to be routed to the frame that owns the frame element for `child_frame` if `child_frame_token` is set. Is that not the case?

(Maybe the Mojo comments should be a bit clearer about which process gets the report)

Yao Xiao

It is indeed the case. (Not sure which part of the code seemed to contradict this though).

Anyway, I've updated the Mojo comments to make this more clear.

Line 553, Patchset 12: builder.Append(frame_owner->ElementInfoForInterventionReport());
Daniel Cheng . unresolved

This is still kind of inefficient. Do we really need the `url` or can we just use the `src` attribute from the frame element instead?

Yao Xiao

In general, we have the flexibility in crafting the message. However, the [specification](https://w3c.github.io/reporting/#capability-urls) dictates that we must strip the URLs thoroughout the report. This sounds like we need to convert 'src' to URL first, so as to use the `StrippedForUseAsReferrer()` method (mirroring the [existing practice](https://source.chromium.org/chromium/chromium/src/+/main:net/reporting/reporting_service.cc?q=%22sanitized_url%20%3D%20url.GetAsReferrer%22) in the network stack for stripping the report's main URL).

File third_party/blink/renderer/core/html/html_frame_element_base.cc
Line 301, Patchset 12: KURL url = GetDocument().CompleteURL(url_);


// Any URLs in the report should strip the username, password, and fragment.
// https://w3c.github.io/reporting/#capability-urls
String sanitized_url = url.StrippedForUseAsReferrer();

StringBuilder builder;
builder.Append("id=");
builder.Append(GetIdAttribute());
builder.Append(";url=");
builder.Append(sanitized_url);
return builder.ReleaseString();
Daniel Cheng . unresolved

Probably just put this all in the intervention handler? No one else calls this anyway, and it's a bit less efficient this way.

Yao Xiao

This now relies on private member `HTMLFrameElementBase::url_`, unless you think it's okay to expose `url_` publicly? (see also my other comment for why I think `url_` is needed).

Open in Gerrit

Related details

Attention is currently required from:
  • Alex Moshchuk
  • Daniel Cheng
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
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: I5d988494dbbcd0aa6a9090745913369e7791e4a7
Gerrit-Change-Number: 6937085
Gerrit-PatchSet: 13
Gerrit-Owner: Yao Xiao <yao...@chromium.org>
Gerrit-Reviewer: Alex Moshchuk <ale...@chromium.org>
Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
Gerrit-Reviewer: Josh Karlin <jka...@chromium.org>
Gerrit-Reviewer: Yao Xiao <yao...@chromium.org>
Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
Gerrit-Attention: Alex Moshchuk <ale...@chromium.org>
Gerrit-Comment-Date: Mon, 15 Sep 2025 23:57:22 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Daniel Cheng <dch...@chromium.org>
Comment-In-Reply-To: Alex Moshchuk <ale...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Daniel Cheng (Gerrit)

unread,
Sep 15, 2025, 10:13:04 PM (2 days ago) Sep 15
to Yao Xiao, Alex Moshchuk, Daniel Cheng, Josh Karlin, AI Code Reviewer, Chromium LUCI CQ, chromium...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, bmcquad...@chromium.org, creis...@chromium.org, csharris...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, loading-rev...@chromium.org, navigation...@chromium.org, speed-metrics...@chromium.org, speed-metr...@chromium.org
Attention needed from Alex Moshchuk and Yao Xiao

Daniel Cheng added 3 comments

File third_party/blink/renderer/core/frame/local_frame_mojo_handler.cc
Line 540, Patchset 13 (Latest): if (auto* child_frame_owner = child_frame->DeprecatedLocalOwner()) {
Daniel Cheng . unresolved

If this is always going to be sent to the parent process, the right thing is to call:

```
auto* child_frame_owner = CheckedTo<HTMLFrameOwnerElement>(child_frame->Owner());
```

Because the deprecated function is... well, deprecated

Line 549, Patchset 12: if (auto* frame_owner = child_frame->DeprecatedLocalOwner()) {
Daniel Cheng . unresolved

I would have expected the intervention to be routed to the frame that owns the frame element for `child_frame` if `child_frame_token` is set. Is that not the case?

(Maybe the Mojo comments should be a bit clearer about which process gets the report)

Yao Xiao

It is indeed the case. (Not sure which part of the code seemed to contradict this though).

Anyway, I've updated the Mojo comments to make this more clear.

Daniel Cheng

The null check for the frame owner contradicts this.

Line 553, Patchset 12: builder.Append(frame_owner->ElementInfoForInterventionReport());
Daniel Cheng . unresolved

This is still kind of inefficient. Do we really need the `url` or can we just use the `src` attribute from the frame element instead?

Yao Xiao

In general, we have the flexibility in crafting the message. However, the [specification](https://w3c.github.io/reporting/#capability-urls) dictates that we must strip the URLs thoroughout the report. This sounds like we need to convert 'src' to URL first, so as to use the `StrippedForUseAsReferrer()` method (mirroring the [existing practice](https://source.chromium.org/chromium/chromium/src/+/main:net/reporting/reporting_service.cc?q=%22sanitized_url%20%3D%20url.GetAsReferrer%22) in the network stack for stripping the report's main URL).

Daniel Cheng

Sure, but we're not able to use `url_` literally anyway: we need to pass it to `CompleteURL()`. So we could just do that with the source attribute instead.

Open in Gerrit

Related details

Attention is currently required from:
  • Alex Moshchuk
  • Yao Xiao
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
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: I5d988494dbbcd0aa6a9090745913369e7791e4a7
Gerrit-Change-Number: 6937085
Gerrit-PatchSet: 13
Gerrit-Owner: Yao Xiao <yao...@chromium.org>
Gerrit-Reviewer: Alex Moshchuk <ale...@chromium.org>
Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
Gerrit-Reviewer: Josh Karlin <jka...@chromium.org>
Gerrit-Reviewer: Yao Xiao <yao...@chromium.org>
Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
Gerrit-Attention: Yao Xiao <yao...@chromium.org>
Gerrit-Attention: Alex Moshchuk <ale...@chromium.org>
Gerrit-Comment-Date: Tue, 16 Sep 2025 02:12:52 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Daniel Cheng <dch...@chromium.org>
Comment-In-Reply-To: Yao Xiao <yao...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Yao Xiao (Gerrit)

unread,
Sep 16, 2025, 12:44:25 AM (2 days ago) Sep 16
to Alex Moshchuk, Daniel Cheng, Josh Karlin, AI Code Reviewer, Chromium LUCI CQ, chromium...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, bmcquad...@chromium.org, creis...@chromium.org, csharris...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, loading-rev...@chromium.org, navigation...@chromium.org, speed-metrics...@chromium.org, speed-metr...@chromium.org
Attention needed from Alex Moshchuk and Daniel Cheng

Yao Xiao added 4 comments

File third_party/blink/renderer/core/frame/local_frame_mojo_handler.cc
Line 540, Patchset 13: if (auto* child_frame_owner = child_frame->DeprecatedLocalOwner()) {
Daniel Cheng . resolved

If this is always going to be sent to the parent process, the right thing is to call:

```
auto* child_frame_owner = CheckedTo<HTMLFrameOwnerElement>(child_frame->Owner());
```

Because the deprecated function is... well, deprecated

Yao Xiao

Done

Line 549, Patchset 12: if (auto* frame_owner = child_frame->DeprecatedLocalOwner()) {
Daniel Cheng . unresolved

I would have expected the intervention to be routed to the frame that owns the frame element for `child_frame` if `child_frame_token` is set. Is that not the case?

(Maybe the Mojo comments should be a bit clearer about which process gets the report)

Yao Xiao

It is indeed the case. (Not sure which part of the code seemed to contradict this though).

Anyway, I've updated the Mojo comments to make this more clear.

Daniel Cheng

The null check for the frame owner contradicts this.

Yao Xiao

I see. Agree it can only be a `HTMLFrameOwnerElement`. Fixed.

I've kept the null check as a safety precaution against a potential race condition where the FrameOwner could detach before receiving the Mojo message from the browser process. If you're confident that the FrameOwner must be non-null here, I can switch to a `DCHECK(child_frame_owner)`.

Line 553, Patchset 12: builder.Append(frame_owner->ElementInfoForInterventionReport());
Daniel Cheng . resolved

This is still kind of inefficient. Do we really need the `url` or can we just use the `src` attribute from the frame element instead?

Yao Xiao

In general, we have the flexibility in crafting the message. However, the [specification](https://w3c.github.io/reporting/#capability-urls) dictates that we must strip the URLs thoroughout the report. This sounds like we need to convert 'src' to URL first, so as to use the `StrippedForUseAsReferrer()` method (mirroring the [existing practice](https://source.chromium.org/chromium/chromium/src/+/main:net/reporting/reporting_service.cc?q=%22sanitized_url%20%3D%20url.GetAsReferrer%22) in the network stack for stripping the report's main URL).

Daniel Cheng

Sure, but we're not able to use `url_` literally anyway: we need to pass it to `CompleteURL()`. So we could just do that with the source attribute instead.

Yao Xiao

Done

File third_party/blink/renderer/core/html/html_frame_owner_element.cc
Line 195, Patchset 12: return String();
Daniel Cheng . resolved

And we won't need this empty implementation either then (we would use `DynamicTo<HTMLFrameElementBase>` to get to the bits we needed)

Yao Xiao

Done

Open in Gerrit

Related details

Attention is currently required from:
  • Alex Moshchuk
  • Daniel Cheng
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    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: I5d988494dbbcd0aa6a9090745913369e7791e4a7
    Gerrit-Change-Number: 6937085
    Gerrit-PatchSet: 14
    Gerrit-Owner: Yao Xiao <yao...@chromium.org>
    Gerrit-Reviewer: Alex Moshchuk <ale...@chromium.org>
    Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
    Gerrit-Reviewer: Josh Karlin <jka...@chromium.org>
    Gerrit-Reviewer: Yao Xiao <yao...@chromium.org>
    Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
    Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
    Gerrit-Attention: Alex Moshchuk <ale...@chromium.org>
    Gerrit-Comment-Date: Tue, 16 Sep 2025 04:44:20 +0000
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Daniel Cheng (Gerrit)

    unread,
    Sep 16, 2025, 2:10:54 PM (2 days ago) Sep 16
    to Yao Xiao, Daniel Cheng, Alex Moshchuk, Josh Karlin, AI Code Reviewer, Chromium LUCI CQ, chromium...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, bmcquad...@chromium.org, creis...@chromium.org, csharris...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, loading-rev...@chromium.org, navigation...@chromium.org, speed-metrics...@chromium.org, speed-metr...@chromium.org
    Attention needed from Alex Moshchuk and Yao Xiao

    Daniel Cheng voted and added 2 comments

    Votes added by Daniel Cheng

    Code-Review+1

    2 comments

    Patchset-level comments
    File-level comment, Patchset 14 (Latest):
    Daniel Cheng . resolved

    LGTM for Blink and mojo with nit addressed

    File third_party/blink/renderer/core/frame/local_frame_mojo_handler.cc
    Line 549, Patchset 12: if (auto* frame_owner = child_frame->DeprecatedLocalOwner()) {
    Daniel Cheng . unresolved

    I would have expected the intervention to be routed to the frame that owns the frame element for `child_frame` if `child_frame_token` is set. Is that not the case?

    (Maybe the Mojo comments should be a bit clearer about which process gets the report)

    Yao Xiao

    It is indeed the case. (Not sure which part of the code seemed to contradict this though).

    Anyway, I've updated the Mojo comments to make this more clear.

    Daniel Cheng

    The null check for the frame owner contradicts this.

    Yao Xiao

    I see. Agree it can only be a `HTMLFrameOwnerElement`. Fixed.

    I've kept the null check as a safety precaution against a potential race condition where the FrameOwner could detach before receiving the Mojo message from the browser process. If you're confident that the FrameOwner must be non-null here, I can switch to a `DCHECK(child_frame_owner)`.

    Daniel Cheng

    Yes it must be non-null here; if it is detached, it will not get Mojo messages.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Alex Moshchuk
    • Yao Xiao
    Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      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: I5d988494dbbcd0aa6a9090745913369e7791e4a7
      Gerrit-Change-Number: 6937085
      Gerrit-PatchSet: 14
      Gerrit-Owner: Yao Xiao <yao...@chromium.org>
      Gerrit-Reviewer: Alex Moshchuk <ale...@chromium.org>
      Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
      Gerrit-Reviewer: Josh Karlin <jka...@chromium.org>
      Gerrit-Reviewer: Yao Xiao <yao...@chromium.org>
      Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
      Gerrit-Attention: Yao Xiao <yao...@chromium.org>
      Gerrit-Attention: Alex Moshchuk <ale...@chromium.org>
      Gerrit-Comment-Date: Tue, 16 Sep 2025 18:10:45 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Yao Xiao (Gerrit)

      unread,
      Sep 16, 2025, 2:42:39 PM (2 days ago) Sep 16
      to Charlie Harrison, Daniel Cheng, Alex Moshchuk, Josh Karlin, AI Code Reviewer, Chromium LUCI CQ, chromium...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, bmcquad...@chromium.org, creis...@chromium.org, csharris...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, loading-rev...@chromium.org, navigation...@chromium.org, speed-metrics...@chromium.org, speed-metr...@chromium.org
      Attention needed from Alex Moshchuk and Charlie Harrison

      Yao Xiao added 2 comments

      Patchset-level comments
      File-level comment, Patchset 15 (Latest):
      Yao Xiao . resolved

      csharrison@: PTAL at heavy_ad_features.h/.cc. Thanks!

      File third_party/blink/renderer/core/frame/local_frame_mojo_handler.cc
      Line 549, Patchset 12: if (auto* frame_owner = child_frame->DeprecatedLocalOwner()) {
      Daniel Cheng . resolved

      I would have expected the intervention to be routed to the frame that owns the frame element for `child_frame` if `child_frame_token` is set. Is that not the case?

      (Maybe the Mojo comments should be a bit clearer about which process gets the report)

      Yao Xiao

      It is indeed the case. (Not sure which part of the code seemed to contradict this though).

      Anyway, I've updated the Mojo comments to make this more clear.

      Daniel Cheng

      The null check for the frame owner contradicts this.

      Yao Xiao

      I see. Agree it can only be a `HTMLFrameOwnerElement`. Fixed.

      I've kept the null check as a safety precaution against a potential race condition where the FrameOwner could detach before receiving the Mojo message from the browser process. If you're confident that the FrameOwner must be non-null here, I can switch to a `DCHECK(child_frame_owner)`.

      Daniel Cheng

      Yes it must be non-null here; if it is detached, it will not get Mojo messages.

      Yao Xiao

      Done

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Alex Moshchuk
      • Charlie Harrison
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      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: I5d988494dbbcd0aa6a9090745913369e7791e4a7
      Gerrit-Change-Number: 6937085
      Gerrit-PatchSet: 15
      Gerrit-Owner: Yao Xiao <yao...@chromium.org>
      Gerrit-Reviewer: Alex Moshchuk <ale...@chromium.org>
      Gerrit-Reviewer: Charlie Harrison <cshar...@chromium.org>
      Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
      Gerrit-Reviewer: Josh Karlin <jka...@chromium.org>
      Gerrit-Reviewer: Yao Xiao <yao...@chromium.org>
      Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
      Gerrit-Attention: Charlie Harrison <cshar...@chromium.org>
      Gerrit-Attention: Alex Moshchuk <ale...@chromium.org>
      Gerrit-Comment-Date: Tue, 16 Sep 2025 18:42:34 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Alex Moshchuk (Gerrit)

      unread,
      Sep 16, 2025, 5:26:16 PM (2 days ago) Sep 16
      to Yao Xiao, Charlie Harrison, Daniel Cheng, Josh Karlin, AI Code Reviewer, Chromium LUCI CQ, chromium...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, bmcquad...@chromium.org, creis...@chromium.org, csharris...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, loading-rev...@chromium.org, navigation...@chromium.org, speed-metrics...@chromium.org, speed-metr...@chromium.org
      Attention needed from Charlie Harrison and Yao Xiao

      Alex Moshchuk voted and added 1 comment

      Votes added by Alex Moshchuk

      Code-Review+1

      1 comment

      Patchset-level comments
      Alex Moshchuk . resolved

      Thanks, content/ LGTM

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Charlie Harrison
      • Yao Xiao
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      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: I5d988494dbbcd0aa6a9090745913369e7791e4a7
      Gerrit-Change-Number: 6937085
      Gerrit-PatchSet: 15
      Gerrit-Owner: Yao Xiao <yao...@chromium.org>
      Gerrit-Reviewer: Alex Moshchuk <ale...@chromium.org>
      Gerrit-Reviewer: Charlie Harrison <cshar...@chromium.org>
      Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
      Gerrit-Reviewer: Josh Karlin <jka...@chromium.org>
      Gerrit-Reviewer: Yao Xiao <yao...@chromium.org>
      Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
      Gerrit-Attention: Charlie Harrison <cshar...@chromium.org>
      Gerrit-Attention: Yao Xiao <yao...@chromium.org>
      Gerrit-Comment-Date: Tue, 16 Sep 2025 21:26:05 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Yao Xiao (Gerrit)

      unread,
      Sep 17, 2025, 11:01:54 AM (18 hours ago) Sep 17
      to Alex Moshchuk, Charlie Harrison, Daniel Cheng, Josh Karlin, AI Code Reviewer, Chromium LUCI CQ, chromium...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, bmcquad...@chromium.org, creis...@chromium.org, csharris...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, loading-rev...@chromium.org, navigation...@chromium.org, speed-metrics...@chromium.org, speed-metr...@chromium.org
      Attention needed from Charlie Harrison

      Yao Xiao added 1 comment

      File third_party/blink/renderer/core/html/html_frame_element_base.cc
      Line 301, Patchset 12: KURL url = GetDocument().CompleteURL(url_);

      // Any URLs in the report should strip the username, password, and fragment.
      // https://w3c.github.io/reporting/#capability-urls
      String sanitized_url = url.StrippedForUseAsReferrer();

      StringBuilder builder;
      builder.Append("id=");
      builder.Append(GetIdAttribute());
      builder.Append(";url=");
      builder.Append(sanitized_url);
      return builder.ReleaseString();
      Daniel Cheng . resolved

      Probably just put this all in the intervention handler? No one else calls this anyway, and it's a bit less efficient this way.

      Yao Xiao

      This now relies on private member `HTMLFrameElementBase::url_`, unless you think it's okay to expose `url_` publicly? (see also my other comment for why I think `url_` is needed).

      Yao Xiao

      Resolved.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Charlie Harrison
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement satisfiedCode-Review
      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: I5d988494dbbcd0aa6a9090745913369e7791e4a7
      Gerrit-Change-Number: 6937085
      Gerrit-PatchSet: 15
      Gerrit-Owner: Yao Xiao <yao...@chromium.org>
      Gerrit-Reviewer: Alex Moshchuk <ale...@chromium.org>
      Gerrit-Reviewer: Charlie Harrison <cshar...@chromium.org>
      Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
      Gerrit-Reviewer: Josh Karlin <jka...@chromium.org>
      Gerrit-Reviewer: Yao Xiao <yao...@chromium.org>
      Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
      Gerrit-Attention: Charlie Harrison <cshar...@chromium.org>
      Gerrit-Comment-Date: Wed, 17 Sep 2025 15:01:46 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Yao Xiao <yao...@chromium.org>
      Comment-In-Reply-To: Daniel Cheng <dch...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy
      Reply all
      Reply to author
      Forward
      0 new messages