3P Script Detector Share Between Iframes [chromium/src : main]

0 views
Skip to first unread message

Ian Clelland (Gerrit)

unread,
Apr 23, 2024, 5:33:20 PMApr 23
to Aoyuan Zuo, David Bokan, Noam Rosenthal, Michal Mocny, Chromium LUCI CQ, Alexis Menard, chromium...@chromium.org, Daniel Cheng, Olga Gerchikov, blink-revie...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org
Attention needed from Aoyuan Zuo, David Bokan and Noam Rosenthal

Ian Clelland added 1 comment

File third_party/blink/renderer/core/frame/animation_frame_timing_monitor.cc
Line 118, Patchset 1 (Latest): frame->DomWindow());
Ian Clelland . unresolved

If `frame` is null here, this will also crash; also, it's only used to get the DOMWindow. Would it make sense to pass in a `LocalDOMWindow*` instead?

Open in Gerrit

Related details

Attention is currently required from:
  • Aoyuan Zuo
  • David Bokan
  • Noam Rosenthal
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • 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: I4e21e0b133fae2e52f50b42c7f42d21848e17eb3
Gerrit-Change-Number: 5479330
Gerrit-PatchSet: 1
Gerrit-Owner: Aoyuan Zuo <zuoa...@chromium.org>
Gerrit-Reviewer: Aoyuan Zuo <zuoa...@chromium.org>
Gerrit-Reviewer: David Bokan <bo...@chromium.org>
Gerrit-Reviewer: Ian Clelland <icle...@chromium.org>
Gerrit-Reviewer: Noam Rosenthal <nrose...@chromium.org>
Gerrit-CC: Alexis Menard <alexis...@intel.com>
Gerrit-CC: Daniel Cheng <dch...@chromium.org>
Gerrit-CC: Michal Mocny <mmo...@chromium.org>
Gerrit-CC: Olga Gerchikov <gerc...@microsoft.com>
Gerrit-Attention: Noam Rosenthal <nrose...@chromium.org>
Gerrit-Attention: Aoyuan Zuo <zuoa...@chromium.org>
Gerrit-Attention: David Bokan <bo...@chromium.org>
Gerrit-Comment-Date: Tue, 23 Apr 2024 21:33:10 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Aoyuan Zuo (Gerrit)

unread,
Apr 23, 2024, 10:52:48 PMApr 23
to David Bokan, Ian Clelland, Noam Rosenthal, Michal Mocny, Chromium LUCI CQ, Alexis Menard, chromium...@chromium.org, Daniel Cheng, Olga Gerchikov, blink-revie...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org
Attention needed from David Bokan, Ian Clelland and Noam Rosenthal

Aoyuan Zuo added 1 comment

File third_party/blink/renderer/core/frame/animation_frame_timing_monitor.cc
Line 118, Patchset 1: frame->DomWindow());
Ian Clelland . resolved

If `frame` is null here, this will also crash; also, it's only used to get the DOMWindow. Would it make sense to pass in a `LocalDOMWindow*` instead?

Aoyuan Zuo

Done

Open in Gerrit

Related details

Attention is currently required from:
  • David Bokan
  • Ian Clelland
  • Noam Rosenthal
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not 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: I4e21e0b133fae2e52f50b42c7f42d21848e17eb3
Gerrit-Change-Number: 5479330
Gerrit-PatchSet: 2
Gerrit-Owner: Aoyuan Zuo <zuoa...@chromium.org>
Gerrit-Reviewer: Aoyuan Zuo <zuoa...@chromium.org>
Gerrit-Reviewer: David Bokan <bo...@chromium.org>
Gerrit-Reviewer: Ian Clelland <icle...@chromium.org>
Gerrit-Reviewer: Noam Rosenthal <nrose...@chromium.org>
Gerrit-CC: Alexis Menard <alexis...@intel.com>
Gerrit-CC: Daniel Cheng <dch...@chromium.org>
Gerrit-CC: Michal Mocny <mmo...@chromium.org>
Gerrit-CC: Olga Gerchikov <gerc...@microsoft.com>
Gerrit-Attention: Noam Rosenthal <nrose...@chromium.org>
Gerrit-Attention: Ian Clelland <icle...@chromium.org>
Gerrit-Attention: David Bokan <bo...@chromium.org>
Gerrit-Comment-Date: Wed, 24 Apr 2024 02:52:38 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Ian Clelland <icle...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Noam Rosenthal (Gerrit)

unread,
Apr 24, 2024, 4:31:12 AMApr 24
to Aoyuan Zuo, David Bokan, Ian Clelland, Michal Mocny, Chromium LUCI CQ, Alexis Menard, chromium...@chromium.org, Daniel Cheng, Olga Gerchikov, blink-revie...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org
Attention needed from Aoyuan Zuo, David Bokan and Ian Clelland

Noam Rosenthal voted Code-Review+1

Code-Review+1
Open in Gerrit

Related details

Attention is currently required from:
  • Aoyuan Zuo
  • David Bokan
  • Ian Clelland
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • 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: I4e21e0b133fae2e52f50b42c7f42d21848e17eb3
Gerrit-Change-Number: 5479330
Gerrit-PatchSet: 2
Gerrit-Owner: Aoyuan Zuo <zuoa...@chromium.org>
Gerrit-Reviewer: Aoyuan Zuo <zuoa...@chromium.org>
Gerrit-Reviewer: David Bokan <bo...@chromium.org>
Gerrit-Reviewer: Ian Clelland <icle...@chromium.org>
Gerrit-Reviewer: Noam Rosenthal <nrose...@chromium.org>
Gerrit-CC: Alexis Menard <alexis...@intel.com>
Gerrit-CC: Daniel Cheng <dch...@chromium.org>
Gerrit-CC: Michal Mocny <mmo...@chromium.org>
Gerrit-CC: Olga Gerchikov <gerc...@microsoft.com>
Gerrit-Attention: Ian Clelland <icle...@chromium.org>
Gerrit-Attention: Aoyuan Zuo <zuoa...@chromium.org>
Gerrit-Attention: David Bokan <bo...@chromium.org>
Gerrit-Comment-Date: Wed, 24 Apr 2024 08:30:58 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
satisfied_requirement
open
diffy

David Bokan (Gerrit)

unread,
Apr 24, 2024, 11:04:43 AMApr 24
to Aoyuan Zuo, Noam Rosenthal, Ian Clelland, Michal Mocny, Chromium LUCI CQ, Alexis Menard, chromium...@chromium.org, Daniel Cheng, Olga Gerchikov, blink-revie...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org
Attention needed from Aoyuan Zuo and Ian Clelland

David Bokan added 4 comments

File third_party/blink/renderer/core/frame/animation_frame_timing_monitor.h
Line 61, Patchset 3 (Latest): void DidBeginMainFrame(LocalDOMWindow* window);
David Bokan . unresolved

nit: `local_root_window`

File third_party/blink/renderer/core/frame/animation_frame_timing_monitor.cc
Line 240, Patchset 3 (Latest): if (frame->IsMainFrame()) {
David Bokan . unresolved

Is `RecordLongAnimationFrameUKMAndTrace` meant only to be called for the main frame? If so, we're not excluding it properly in `WebFrameWidgetImpl::DidBeginMainFrame` - will comment there...

File third_party/blink/renderer/core/frame/web_frame_widget_impl.cc
Line 1554, Patchset 3 (Latest): LocalFrame* root_frame = LocalRootImpl()->GetFrame();
David Bokan . unresolved

This isn't actually the root frame, it's the local root. I.e. if you're in an OOPIF process, this will be the first ancestor frame who's parent is in a remote process.

I wonder if we really do mean "root frame" here since we check `frame->IsMainFrame` when calling from AnimationFrameTimingMonitor. (If so you should check `root_frame->IsOuterMostMainFrame()`)

Line 1561, Patchset 3 (Latest): animation_frame_timing_monitor_->DidBeginMainFrame(root_frame->DomWindow());
David Bokan . unresolved

Can we CHECK and make this a ref argument? I'd expect a frame producing animation frames to be attached.

Open in Gerrit

Related details

Attention is currently required from:
  • Aoyuan Zuo
  • Ian Clelland
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • 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: I4e21e0b133fae2e52f50b42c7f42d21848e17eb3
    Gerrit-Change-Number: 5479330
    Gerrit-PatchSet: 3
    Gerrit-Owner: Aoyuan Zuo <zuoa...@chromium.org>
    Gerrit-Reviewer: Aoyuan Zuo <zuoa...@chromium.org>
    Gerrit-Reviewer: David Bokan <bo...@chromium.org>
    Gerrit-Reviewer: Ian Clelland <icle...@chromium.org>
    Gerrit-Reviewer: Noam Rosenthal <nrose...@chromium.org>
    Gerrit-CC: Alexis Menard <alexis...@intel.com>
    Gerrit-CC: Daniel Cheng <dch...@chromium.org>
    Gerrit-CC: Michal Mocny <mmo...@chromium.org>
    Gerrit-CC: Olga Gerchikov <gerc...@microsoft.com>
    Gerrit-Attention: Ian Clelland <icle...@chromium.org>
    Gerrit-Attention: Aoyuan Zuo <zuoa...@chromium.org>
    Gerrit-Comment-Date: Wed, 24 Apr 2024 15:04:28 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    David Bokan (Gerrit)

    unread,
    Apr 24, 2024, 12:16:50 PMApr 24
    to Aoyuan Zuo, Noam Rosenthal, Ian Clelland, Michal Mocny, Chromium LUCI CQ, Alexis Menard, chromium...@chromium.org, Daniel Cheng, Olga Gerchikov, blink-revie...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org
    Attention needed from Aoyuan Zuo and Ian Clelland

    David Bokan voted and added 3 comments

    Votes added by David Bokan

    Code-Review+1

    3 comments

    Patchset-level comments
    File-level comment, Patchset 3 (Latest):
    David Bokan . resolved

    LGTM % nit and question

    File third_party/blink/renderer/core/frame/animation_frame_timing_monitor.cc
    Line 240, Patchset 3 (Latest): if (frame->IsMainFrame()) {
    David Bokan . resolved

    Is `RecordLongAnimationFrameUKMAndTrace` meant only to be called for the main frame? If so, we're not excluding it properly in `WebFrameWidgetImpl::DidBeginMainFrame` - will comment there...

    David Bokan

    Done

    File third_party/blink/renderer/core/frame/web_frame_widget_impl.cc
    Line 1554, Patchset 3 (Latest): LocalFrame* root_frame = LocalRootImpl()->GetFrame();
    David Bokan . resolved

    This isn't actually the root frame, it's the local root. I.e. if you're in an OOPIF process, this will be the first ancestor frame who's parent is in a remote process.

    I wonder if we really do mean "root frame" here since we check `frame->IsMainFrame` when calling from AnimationFrameTimingMonitor. (If so you should check `root_frame->IsOuterMostMainFrame()`)

    David Bokan

    Summarizing offline chat (correct me if I missed something): currently we'll have different behavior or recording animation frame timings depending on if an iframe is in an OOPIF vs. in-process. (though...an argument could be made that that causes them to have separate compositors and separate timings...this is a decision I can't evaluate). But that's not really relevant to the crash so can be looked at in a follow up.

    Gerrit-Comment-Date: Wed, 24 Apr 2024 16:16:35 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    Comment-In-Reply-To: David Bokan <bo...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Noam Rosenthal (Gerrit)

    unread,
    Apr 24, 2024, 12:28:00 PMApr 24
    to Aoyuan Zuo, David Bokan, Ian Clelland, Michal Mocny, Chromium LUCI CQ, Alexis Menard, chromium...@chromium.org, Daniel Cheng, Olga Gerchikov, blink-revie...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org
    Attention needed from Aoyuan Zuo, David Bokan and Ian Clelland

    Noam Rosenthal voted and added 1 comment

    Votes added by Noam Rosenthal

    Code-Review+1

    1 comment

    File third_party/blink/renderer/core/frame/animation_frame_timing_monitor.cc
    Line 240, Patchset 3 (Latest): if (frame->IsMainFrame()) {
    David Bokan . unresolved

    Is `RecordLongAnimationFrameUKMAndTrace` meant only to be called for the main frame? If so, we're not excluding it properly in `WebFrameWidgetImpl::DidBeginMainFrame` - will comment there...

    Noam Rosenthal

    Sorry, but please revert this :)
    We already check for MainFrame in WebFrameWidgetImpl::MainFrameUkmRecorder().
    So we enable tracing for subframes, but we would only have a UKM recorder for the main frame.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Aoyuan Zuo
    • David Bokan
    • Ian Clelland
    Gerrit-Attention: David Bokan <bo...@chromium.org>
    Gerrit-Comment-Date: Wed, 24 Apr 2024 16:27:44 +0000
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    David Bokan (Gerrit)

    unread,
    Apr 24, 2024, 12:41:32 PMApr 24
    to Aoyuan Zuo, Noam Rosenthal, Ian Clelland, Michal Mocny, Chromium LUCI CQ, Alexis Menard, chromium...@chromium.org, Daniel Cheng, Olga Gerchikov, blink-revie...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org
    Attention needed from Aoyuan Zuo, Ian Clelland and Noam Rosenthal

    David Bokan added 1 comment

    File third_party/blink/renderer/core/frame/animation_frame_timing_monitor.cc
    Line 240, Patchset 3 (Latest): if (frame->IsMainFrame()) {
    David Bokan . unresolved

    Is `RecordLongAnimationFrameUKMAndTrace` meant only to be called for the main frame? If so, we're not excluding it properly in `WebFrameWidgetImpl::DidBeginMainFrame` - will comment there...

    Noam Rosenthal

    Sorry, but please revert this :)
    We already check for MainFrame in WebFrameWidgetImpl::MainFrameUkmRecorder().
    So we enable tracing for subframes, but we would only have a UKM recorder for the main frame.

    David Bokan

    Ah, I see now - we'll early out from RecordLongAnimationFrameUKMAndTrace if we're in a remote frame because we can't access the MainFrameUkmRecorder (but after enabling tracing) - for my own curiosity - we intentionally record long frame metrics within local roots?

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Aoyuan Zuo
    • Ian Clelland
    • Noam Rosenthal
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • 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: I4e21e0b133fae2e52f50b42c7f42d21848e17eb3
    Gerrit-Change-Number: 5479330
    Gerrit-PatchSet: 3
    Gerrit-Owner: Aoyuan Zuo <zuoa...@chromium.org>
    Gerrit-Reviewer: Aoyuan Zuo <zuoa...@chromium.org>
    Gerrit-Reviewer: David Bokan <bo...@chromium.org>
    Gerrit-Reviewer: Ian Clelland <icle...@chromium.org>
    Gerrit-Reviewer: Noam Rosenthal <nrose...@chromium.org>
    Gerrit-CC: Alexis Menard <alexis...@intel.com>
    Gerrit-CC: Daniel Cheng <dch...@chromium.org>
    Gerrit-CC: Michal Mocny <mmo...@chromium.org>
    Gerrit-CC: Olga Gerchikov <gerc...@microsoft.com>
    Gerrit-Attention: Noam Rosenthal <nrose...@chromium.org>
    Gerrit-Attention: Ian Clelland <icle...@chromium.org>
    Gerrit-Attention: Aoyuan Zuo <zuoa...@chromium.org>
    Gerrit-Comment-Date: Wed, 24 Apr 2024 16:41:20 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Noam Rosenthal <nrose...@chromium.org>
    Comment-In-Reply-To: David Bokan <bo...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Ian Clelland (Gerrit)

    unread,
    Apr 24, 2024, 12:50:21 PMApr 24
    to Aoyuan Zuo, David Bokan, Noam Rosenthal, Michal Mocny, Chromium LUCI CQ, Alexis Menard, chromium...@chromium.org, Daniel Cheng, Olga Gerchikov, blink-revie...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org
    Attention needed from Aoyuan Zuo and Noam Rosenthal

    Ian Clelland voted Code-Review+1

    Code-Review+1
    Open in Gerrit

    Related details

    Attention is currently required from:
    • Aoyuan Zuo
    • Noam Rosenthal
    Gerrit-Attention: Aoyuan Zuo <zuoa...@chromium.org>
    Gerrit-Comment-Date: Wed, 24 Apr 2024 16:50:06 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Aoyuan Zuo (Gerrit)

    unread,
    Apr 24, 2024, 1:08:32 PMApr 24
    to Ian Clelland, David Bokan, Noam Rosenthal, Michal Mocny, Chromium LUCI CQ, Alexis Menard, chromium...@chromium.org, Daniel Cheng, Olga Gerchikov, blink-revie...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org
    Attention needed from Noam Rosenthal

    Aoyuan Zuo added 4 comments

    Patchset-level comments
    David Bokan . resolved

    LGTM % nit and question

    Aoyuan Zuo

    Ty!

    File third_party/blink/renderer/core/frame/animation_frame_timing_monitor.h
    Line 61, Patchset 3: void DidBeginMainFrame(LocalDOMWindow* window);
    David Bokan . resolved

    nit: `local_root_window`

    Aoyuan Zuo

    Done

    File third_party/blink/renderer/core/frame/animation_frame_timing_monitor.cc
    Line 240, Patchset 3: if (frame->IsMainFrame()) {
    David Bokan . resolved

    Is `RecordLongAnimationFrameUKMAndTrace` meant only to be called for the main frame? If so, we're not excluding it properly in `WebFrameWidgetImpl::DidBeginMainFrame` - will comment there...

    Noam Rosenthal

    Sorry, but please revert this :)
    We already check for MainFrame in WebFrameWidgetImpl::MainFrameUkmRecorder().
    So we enable tracing for subframes, but we would only have a UKM recorder for the main frame.

    Aoyuan Zuo

    Done

    File third_party/blink/renderer/core/frame/web_frame_widget_impl.cc
    Line 1561, Patchset 3: animation_frame_timing_monitor_->DidBeginMainFrame(root_frame->DomWindow());
    David Bokan . resolved

    Can we CHECK and make this a ref argument? I'd expect a frame producing animation frames to be attached.

    Aoyuan Zuo

    Done

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Noam Rosenthal
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • 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: I4e21e0b133fae2e52f50b42c7f42d21848e17eb3
    Gerrit-Change-Number: 5479330
    Gerrit-PatchSet: 3
    Gerrit-Owner: Aoyuan Zuo <zuoa...@chromium.org>
    Gerrit-Reviewer: Aoyuan Zuo <zuoa...@chromium.org>
    Gerrit-Reviewer: David Bokan <bo...@chromium.org>
    Gerrit-Reviewer: Ian Clelland <icle...@chromium.org>
    Gerrit-Reviewer: Noam Rosenthal <nrose...@chromium.org>
    Gerrit-CC: Alexis Menard <alexis...@intel.com>
    Gerrit-CC: Daniel Cheng <dch...@chromium.org>
    Gerrit-CC: Michal Mocny <mmo...@chromium.org>
    Gerrit-CC: Olga Gerchikov <gerc...@microsoft.com>
    Gerrit-Attention: Noam Rosenthal <nrose...@chromium.org>
    Gerrit-Comment-Date: Wed, 24 Apr 2024 17:08:09 +0000
    satisfied_requirement
    open
    diffy

    Noam Rosenthal (Gerrit)

    unread,
    Apr 24, 2024, 1:10:07 PMApr 24
    to Aoyuan Zuo, Ian Clelland, David Bokan, Michal Mocny, Chromium LUCI CQ, Alexis Menard, chromium...@chromium.org, Daniel Cheng, Olga Gerchikov, blink-revie...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org
    Attention needed from Aoyuan Zuo

    Noam Rosenthal voted and added 1 comment

    Votes added by Noam Rosenthal

    Code-Review+1

    1 comment

    Patchset-level comments
    File-level comment, Patchset 4 (Latest):
    Noam Rosenthal . resolved

    LGTM again!

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Aoyuan Zuo
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • 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: I4e21e0b133fae2e52f50b42c7f42d21848e17eb3
    Gerrit-Change-Number: 5479330
    Gerrit-PatchSet: 4
    Gerrit-Owner: Aoyuan Zuo <zuoa...@chromium.org>
    Gerrit-Reviewer: Aoyuan Zuo <zuoa...@chromium.org>
    Gerrit-Reviewer: David Bokan <bo...@chromium.org>
    Gerrit-Reviewer: Ian Clelland <icle...@chromium.org>
    Gerrit-Reviewer: Noam Rosenthal <nrose...@chromium.org>
    Gerrit-CC: Alexis Menard <alexis...@intel.com>
    Gerrit-CC: Daniel Cheng <dch...@chromium.org>
    Gerrit-CC: Michal Mocny <mmo...@chromium.org>
    Gerrit-CC: Olga Gerchikov <gerc...@microsoft.com>
    Gerrit-Attention: Aoyuan Zuo <zuoa...@chromium.org>
    Gerrit-Comment-Date: Wed, 24 Apr 2024 17:09:50 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    open
    diffy

    David Bokan (Gerrit)

    unread,
    Apr 24, 2024, 1:24:04 PMApr 24
    to Aoyuan Zuo, Ian Clelland, Noam Rosenthal, Michal Mocny, Chromium LUCI CQ, Alexis Menard, chromium...@chromium.org, Daniel Cheng, Olga Gerchikov, blink-revie...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org
    Attention needed from Aoyuan Zuo

    David Bokan voted and added 2 comments

    Votes added by David Bokan

    Code-Review+1

    2 comments

    Patchset-level comments
    David Bokan . resolved

    just one nit but otherwise still lgtm

    File third_party/blink/renderer/core/frame/animation_frame_timing_monitor.cc
    Line 241, Patchset 4 (Latest): RecordLongAnimationFrameUKMAndTrace(*timing_info, *frame->DomWindow());
    David Bokan . unresolved

    Will frame always be a local root? I can't tell from the call sites. If not, rename the param in `RecordLongANimationFrameUKMAndTrace`. If yes, add a CHECK in that method that the passed in window's frame is the local root.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Aoyuan Zuo
    Submit Requirements:
      • requirement satisfiedCode-Coverage
      • 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: I4e21e0b133fae2e52f50b42c7f42d21848e17eb3
      Gerrit-Change-Number: 5479330
      Gerrit-PatchSet: 4
      Gerrit-Owner: Aoyuan Zuo <zuoa...@chromium.org>
      Gerrit-Reviewer: Aoyuan Zuo <zuoa...@chromium.org>
      Gerrit-Reviewer: David Bokan <bo...@chromium.org>
      Gerrit-Reviewer: Ian Clelland <icle...@chromium.org>
      Gerrit-Reviewer: Noam Rosenthal <nrose...@chromium.org>
      Gerrit-CC: Alexis Menard <alexis...@intel.com>
      Gerrit-CC: Daniel Cheng <dch...@chromium.org>
      Gerrit-CC: Michal Mocny <mmo...@chromium.org>
      Gerrit-CC: Olga Gerchikov <gerc...@microsoft.com>
      Gerrit-Attention: Aoyuan Zuo <zuoa...@chromium.org>
      Gerrit-Comment-Date: Wed, 24 Apr 2024 17:23:54 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Aoyuan Zuo (Gerrit)

      unread,
      Apr 24, 2024, 1:42:21 PMApr 24
      to Ian Clelland, David Bokan, Noam Rosenthal, Michal Mocny, Chromium LUCI CQ, Alexis Menard, chromium...@chromium.org, Daniel Cheng, Olga Gerchikov, blink-revie...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org

      Aoyuan Zuo voted and added 1 comment

      Votes added by Aoyuan Zuo

      Commit-Queue+1

      1 comment

      File third_party/blink/renderer/core/frame/animation_frame_timing_monitor.cc
      Line 241, Patchset 4: RecordLongAnimationFrameUKMAndTrace(*timing_info, *frame->DomWindow());
      David Bokan . resolved

      Will frame always be a local root? I can't tell from the call sites. If not, rename the param in `RecordLongANimationFrameUKMAndTrace`. If yes, add a CHECK in that method that the passed in window's frame is the local root.

      Aoyuan Zuo

      I think you're right, can't be sure to be local root, revert back to just name it window. Ty!

      Open in Gerrit

      Related details

      Attention set is empty
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • 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: I4e21e0b133fae2e52f50b42c7f42d21848e17eb3
      Gerrit-Change-Number: 5479330
      Gerrit-PatchSet: 4
      Gerrit-Owner: Aoyuan Zuo <zuoa...@chromium.org>
      Gerrit-Reviewer: Aoyuan Zuo <zuoa...@chromium.org>
      Gerrit-Reviewer: David Bokan <bo...@chromium.org>
      Gerrit-Reviewer: Ian Clelland <icle...@chromium.org>
      Gerrit-Reviewer: Noam Rosenthal <nrose...@chromium.org>
      Gerrit-CC: Alexis Menard <alexis...@intel.com>
      Gerrit-CC: Daniel Cheng <dch...@chromium.org>
      Gerrit-CC: Michal Mocny <mmo...@chromium.org>
      Gerrit-CC: Olga Gerchikov <gerc...@microsoft.com>
      Gerrit-Comment-Date: Wed, 24 Apr 2024 17:42:04 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      Comment-In-Reply-To: David Bokan <bo...@chromium.org>
      satisfied_requirement
      open
      diffy

      Aoyuan Zuo (Gerrit)

      unread,
      Apr 24, 2024, 1:54:27 PMApr 24
      to Ian Clelland, David Bokan, Noam Rosenthal, Michal Mocny, Chromium LUCI CQ, Alexis Menard, chromium...@chromium.org, Daniel Cheng, Olga Gerchikov, blink-revie...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org

      Aoyuan Zuo voted Commit-Queue+2

      Commit-Queue+2
      Open in Gerrit

      Related details

      Attention set is empty
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • 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: I4e21e0b133fae2e52f50b42c7f42d21848e17eb3
      Gerrit-Change-Number: 5479330
      Gerrit-PatchSet: 5
      Gerrit-Owner: Aoyuan Zuo <zuoa...@chromium.org>
      Gerrit-Reviewer: Aoyuan Zuo <zuoa...@chromium.org>
      Gerrit-Reviewer: David Bokan <bo...@chromium.org>
      Gerrit-Reviewer: Ian Clelland <icle...@chromium.org>
      Gerrit-Reviewer: Noam Rosenthal <nrose...@chromium.org>
      Gerrit-CC: Alexis Menard <alexis...@intel.com>
      Gerrit-CC: Daniel Cheng <dch...@chromium.org>
      Gerrit-CC: Michal Mocny <mmo...@chromium.org>
      Gerrit-CC: Olga Gerchikov <gerc...@microsoft.com>
      Gerrit-Comment-Date: Wed, 24 Apr 2024 17:54:15 +0000
      Gerrit-HasComments: No
      Gerrit-Has-Labels: Yes
      satisfied_requirement
      open
      diffy

      Chromium LUCI CQ (Gerrit)

      unread,
      Apr 24, 2024, 2:49:27 PMApr 24
      to Aoyuan Zuo, Ian Clelland, David Bokan, Noam Rosenthal, Michal Mocny, Alexis Menard, chromium...@chromium.org, Daniel Cheng, Olga Gerchikov, blink-revie...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org

      Chromium LUCI CQ submitted the change with unreviewed changes

      Unreviewed changes

      4 is the latest approved patch-set.
      The change was submitted with unreviewed changes in the following files:

      ```
      The name of the file: third_party/blink/renderer/core/frame/animation_frame_timing_monitor.h
      Insertions: 1, Deletions: 1.

      @@ -125,7 +125,7 @@
      bool PushScriptEntryPoint(ScriptState*);

      void RecordLongAnimationFrameUKMAndTrace(const AnimationFrameTimingInfo&,
      - LocalDOMWindow& local_root_window);
      + LocalDOMWindow& window);
      void ApplyTaskDuration(base::TimeDelta task_duration);

      std::optional<PendingScriptInfo> pending_script_info_;
      ```
      ```
      The name of the file: third_party/blink/renderer/core/frame/animation_frame_timing_monitor.cc
      Insertions: 3, Deletions: 3.

      @@ -12,7 +12,6 @@
      #include "services/metrics/public/cpp/ukm_source_id.h"
      #include "third_party/blink/public/mojom/script/script_type.mojom-blink-forward.h"
      #include "third_party/blink/renderer/bindings/core/v8/js_based_event_listener.h"
      -#include "third_party/blink/renderer/bindings/core/v8/js_event_handler_for_content_attribute.h"
      #include "third_party/blink/renderer/bindings/core/v8/v8_binding_for_core.h"
      #include "third_party/blink/renderer/core/core_probe_sink.h"
      #include "third_party/blink/renderer/core/execution_context/agent.h"
      @@ -280,7 +279,7 @@

      void AnimationFrameTimingMonitor::RecordLongAnimationFrameUKMAndTrace(
      const AnimationFrameTimingInfo& info,
      - LocalDOMWindow& local_root_window) {
      + LocalDOMWindow& window) {
      // Record all animation frames to traces, but only long ones to UKM.
      RecordLongAnimationFrameTrace(info, this);
      if (info.Duration() < kLongAnimationFrameDuration) {
      @@ -317,8 +316,8 @@
      total_forced_style_and_layout_duration += script->StyleDuration();
      total_forced_style_and_layout_duration += script->LayoutDuration();
      ThirdPartyScriptDetector::Technology third_party_technology =
      - ThirdPartyScriptDetector::From(local_root_window)
      - .Detect(script->GetSourceLocation().url);
      + ThirdPartyScriptDetector::From(window).Detect(
      + script->GetSourceLocation().url);
      switch (script->GetInvokerType()) {
      case ScriptTimingInfo::InvokerType::kClassicScript:
      case ScriptTimingInfo::InvokerType::kModuleScript:
      @@ -500,9 +499,7 @@
      ? ScriptTimingInfo::InvokerType::kModuleScript
      : ScriptTimingInfo::InvokerType::kClassicScript,
      .start_time = probe_data.CaptureStartTime(),
      - .source_location = {
      - .url = url,
      - .char_position = static_cast<int>(probe_data.char_index)}};
      + .source_location = {.url = url, .char_position = 0}};
      if (probe_data.sanitize) {
      pending_script_info_->execution_start_time =
      pending_script_info_->start_time;
      @@ -635,21 +632,9 @@
      }

      v8::HandleScope scope(probe_data.script_state->GetIsolate());
      - if (probe_data.listener->IsEventHandlerForContentAttribute()) {
      - auto* handler =
      - static_cast<JSEventHandlerForContentAttribute*>(probe_data.listener);
      - StringBuilder builder;
      - builder.Append("on");
      - builder.Append(probe_data.event->type());
      - info->SetSourceLocation(ScriptTimingInfo::ScriptSourceLocation{
      - .url = ExecutionContext::From(probe_data.script_state)->Url(),
      - .function_name = builder.ReleaseString(),
      - .char_position = static_cast<int>(handler->GetTextPosition().offset_)});
      - } else {
      - info->SetSourceLocation(CaptureScriptSourceLocation(
      - probe_data.script_state->GetIsolate(),
      - probe_data.listener->GetListenerObject(*target)));
      - }
      + info->SetSourceLocation(CaptureScriptSourceLocation(
      + probe_data.script_state->GetIsolate(),
      + probe_data.listener->GetListenerObject(*target)));
      }

      void AnimationFrameTimingMonitor::Will(
      ```

      Change information

      Commit message:
      3P Script Detector Share Between Iframes

      * Previous undesired outcome: Script window can be null and dereference
      nullptr results in crash.
      * Root cause: We suspect script from iframe could have their dom window
      detached by the time animation_frame_timing_monitor doing 3p script
      detection after BeginMainFrame.
      * This CL address it by: use local root frame's window instead to
      retrieve 3p script detector; also added a check to early exit just in
      case.
      Bug: 336375355, 336503423, 336517147
      Change-Id: I4e21e0b133fae2e52f50b42c7f42d21848e17eb3
      Reviewed-by: Ian Clelland <icle...@chromium.org>
      Reviewed-by: Noam Rosenthal <nrose...@chromium.org>
      Reviewed-by: David Bokan <bo...@chromium.org>
      Commit-Queue: Aoyuan Zuo <zuoa...@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#1292012}
      Files:
      • M third_party/blink/renderer/core/frame/animation_frame_timing_monitor.cc
      • M third_party/blink/renderer/core/frame/animation_frame_timing_monitor.h
      • M third_party/blink/renderer/core/frame/web_frame_widget_impl.cc
      Change size: S
      Delta: 3 files changed, 23 insertions(+), 18 deletions(-)
      Branch: refs/heads/main
      Submit Requirements:
      • requirement satisfiedCode-Review: +1 by David Bokan, +1 by Ian Clelland, +1 by Noam Rosenthal
      Open in Gerrit
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: merged
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I4e21e0b133fae2e52f50b42c7f42d21848e17eb3
      Gerrit-Change-Number: 5479330
      Gerrit-PatchSet: 6
      Gerrit-Owner: Aoyuan Zuo <zuoa...@chromium.org>
      Gerrit-Reviewer: Aoyuan Zuo <zuoa...@chromium.org>
      Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
      Gerrit-Reviewer: David Bokan <bo...@chromium.org>
      Gerrit-Reviewer: Ian Clelland <icle...@chromium.org>
      Gerrit-Reviewer: Noam Rosenthal <nrose...@chromium.org>
      Gerrit-CC: Alexis Menard <alexis...@intel.com>
      open
      diffy
      satisfied_requirement

      Aoyuan Zuo (Gerrit)

      unread,
      Apr 24, 2024, 6:47:56 PMApr 24
      to Alexis Menard, chromium...@chromium.org, Daniel Cheng, Olga Gerchikov, blink-revie...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, blundell+...@chromium.org

      Aoyuan Zuo abandoned this change

      Related details

      Attention set is empty
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Review
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: abandon
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I4f0ef7e51c9b961c530898d61cad6d2afcc4f390
      Gerrit-Change-Number: 5485866
      Gerrit-PatchSet: 1
      Gerrit-Owner: Aoyuan Zuo <zuoa...@chromium.org>
      Gerrit-CC: Alexis Menard <alexis...@intel.com>
      Gerrit-CC: Daniel Cheng <dch...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy
      Reply all
      Reply to author
      Forward
      0 new messages