Expose initiator-url in resourceTiming for more resources [chromium/src : main]

0 views
Skip to first unread message

Scott Haseley (Gerrit)

unread,
Sep 26, 2025, 3:06:50 PMSep 26
to Guohui Deng, Chromium LUCI CQ, Alexis Menard, chromium...@chromium.org, Olga Gerchikov, Nate Chapin, blink-revie...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, chikamu...@chromium.org, core-timi...@chromium.org, ddrone...@google.com, gavinp...@chromium.org, kinuko...@chromium.org, loading...@chromium.org, scheduler-...@chromium.org, speed-metrics...@chromium.org, web-schedulin...@chromium.org
Attention needed from Guohui Deng

Scott Haseley added 14 comments

Patchset-level comments
File-level comment, Patchset 1 (Latest):
Scott Haseley . resolved

Nice! I didn't get through the tests yet, but implementation is looking pretty reasonable.

File base/tracing/protos/chrome_track_event.proto
Line 43, Patchset 1 (Latest): TASK_SCOPE_RESOURCE_TIMING = 10;
Scott Haseley . unresolved

These shouldn't be renumbered, please move the new one to the end.

File third_party/blink/renderer/core/html/html_frame_owner_element.cc
Line 697, Patchset 1 (Latest): v8::Isolate* isolate = v8::Isolate::TryGetCurrent();
Scott Haseley . unresolved

I think this block needs to be flag-guarded behind the experimental feature flag.

Line 697, Patchset 1 (Latest): v8::Isolate* isolate = v8::Isolate::TryGetCurrent();
Scott Haseley . unresolved

Is this duplicated in the other file? It might be nice to have a helper method somewhere, maybe a static method in the new class?

Line 706, Patchset 1 (Latest): if (resource_timing_context) {
Scott Haseley . unresolved

Wha happens if this is null and `initiator_url` ends up empty, will it use a fallback somewhere else, or is intended to be empty for now?

File third_party/blink/renderer/core/loader/frame_fetch_context.cc
Line 472, Patchset 1 (Latest):void FrameFetchContext::FillInitiatorInfo(FetchInitiatorInfo& initiator_info) {
Scott Haseley . unresolved

nit: It might be worth adding `CHECK(RuntimeEnabledFeatures::ResourceTimingInitiatorEnabled())` to document that this is only called with an experimental feature enabled.

Line 475, Patchset 1 (Latest): // Initiator is a imported js file.
Scott Haseley . unresolved
```suggestion
// Initiator is an imported js file.
```
Line 489, Patchset 1 (Latest): // The initiator is a JS.
Scott Haseley . unresolved

Can you expand on this comment? I think this means that we're assuming JS is running because a v8::Context was entered?

Also, is this always guaranteed to be called on the main/worker thread? Just wondering if you'd ever expect `isolate` to be null, and in what situations, since IIUC we Enter() the isolate during init (but only on relevant threads).

File third_party/blink/renderer/core/scheduler/task_attribution_tracker_impl.cc
Line 127, Patchset 1 (Latest): TaskAttributionInfo* current_task_state = CurrentTaskState();
Scott Haseley . unresolved

What about web scheduling task state? For soft navs, we can get away with overwriting this because we know this is only called just prior to dispatching input.

File third_party/blink/renderer/core/scheduler/task_attribution_util.h
Line 60, Patchset 1 (Latest): // `tracker` is null if `context` is not a Window or if
Scott Haseley . unresolved

Is this a problem for resource timing? PerformanceResourceTiming is available on workers.

File third_party/blink/renderer/core/script/pending_script.cc
Line 179, Patchset 1 (Latest): // 1. No plan to support `InitiatorUrl` tracking for scripts generated by
// document.write();
// 2. Tracking `InitiatorUrl` for scripts generated by document.write() is
// Not compatible with test
// `wpt_internal/task-tracking/track-doc-write.html`.
Scott Haseley . unresolved

Seems like (1) is a design decision, and (2) is a bug. If (2) is something that needs to be addressed, I'd link to a crbug, otherwise I don't think this needs to be commented here. I'd suggest rewriting the comment to focus on why document.write() is not supported, or just put simply that the API does not support document.write() (ideally with a link to an explainer section or something).

Line 190, Patchset 1 (Latest): task_attribution_resource_timing_scope =
Scott Haseley . unresolved

This should be flag-guarded as well.

File third_party/blink/renderer/core/timing/resource_timing_context.h
Line 1, Patchset 1 (Latest):#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_TIMING_RESOURCE_TIMING_CONTEXT_H_
Scott Haseley . unresolved

This needs the copyright boilerplate.

File third_party/blink/renderer/platform/scheduler/public/task_attribution_info.h
Line 31, Patchset 1 (Latest): // Returns the `ResourceTimingContext` associated with the task state, which
Scott Haseley . unresolved

Please add a line break between methods.

Open in Gerrit

Related details

Attention is currently required from:
  • Guohui Deng
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: I125e62d488eec5a85f8afa6cd61c399183c56d86
Gerrit-Change-Number: 6960132
Gerrit-PatchSet: 1
Gerrit-Owner: Guohui Deng <guohu...@microsoft.com>
Gerrit-Reviewer: Guohui Deng <guohu...@microsoft.com>
Gerrit-Reviewer: Scott Haseley <shas...@chromium.org>
Gerrit-CC: Alexis Menard <alexis...@intel.com>
Gerrit-CC: Nate Chapin <jap...@chromium.org>
Gerrit-CC: Olga Gerchikov <gerc...@microsoft.com>
Gerrit-Attention: Guohui Deng <guohu...@microsoft.com>
Gerrit-Comment-Date: Fri, 26 Sep 2025 19:06:40 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Guohui Deng (Gerrit)

unread,
Oct 16, 2025, 6:51:19 PMOct 16
to Scott Haseley, Chromium LUCI CQ, Alexis Menard, chromium...@chromium.org, Olga Gerchikov, Nate Chapin, blink-revie...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, chikamu...@chromium.org, core-timi...@chromium.org, ddrone...@google.com, gavinp...@chromium.org, kinuko...@chromium.org, loading...@chromium.org, scheduler-...@chromium.org, speed-metrics...@chromium.org, web-schedulin...@chromium.org
Attention needed from Scott Haseley

Guohui Deng added 14 comments

Patchset-level comments
File-level comment, Patchset 4 (Latest):
Guohui Deng . resolved

I think I fixed the problems Scot pointed out but I also added new code, `initiator_helper` and adding `ResourceTimingContext` to `WebSchedulingTaskState`

Thanks.

File base/tracing/protos/chrome_track_event.proto
Line 43, Patchset 1: TASK_SCOPE_RESOURCE_TIMING = 10;
Scott Haseley . resolved

These shouldn't be renumbered, please move the new one to the end.

Guohui Deng

Done

File third_party/blink/renderer/core/html/html_frame_owner_element.cc
Line 697, Patchset 1: v8::Isolate* isolate = v8::Isolate::TryGetCurrent();
Scott Haseley . resolved

I think this block needs to be flag-guarded behind the experimental feature flag.

Guohui Deng

Done

Line 697, Patchset 1: v8::Isolate* isolate = v8::Isolate::TryGetCurrent();
Scott Haseley . resolved

Is this duplicated in the other file? It might be nice to have a helper method somewhere, maybe a static method in the new class?

Guohui Deng

Done. I put it to InitiatorHelper:GetIsolateIfRunningScript().

Line 706, Patchset 1: if (resource_timing_context) {
Scott Haseley . unresolved

Wha happens if this is null and `initiator_url` ends up empty, will it use a fallback somewhere else, or is intended to be empty for now?

Guohui Deng

For now, `InitiatorUrl` field in resource timing is an empty string if there is no valid value. An invalid |initiator_url| is converted to an empty string in `PerformanceResourceTiming::initiatorUrl()`

So it doesn't distinguish between 1) lack of implementation in UA 2) the "initiator" really doesn't exist (like the main page loaded by user action)

I expect it to remain that way until we find user case for it.

File third_party/blink/renderer/core/loader/frame_fetch_context.cc
Line 472, Patchset 1:void FrameFetchContext::FillInitiatorInfo(FetchInitiatorInfo& initiator_info) {
Scott Haseley . resolved

nit: It might be worth adding `CHECK(RuntimeEnabledFeatures::ResourceTimingInitiatorEnabled())` to document that this is only called with an experimental feature enabled.

Guohui Deng

Done

Line 475, Patchset 1: // Initiator is a imported js file.
Scott Haseley . resolved
```suggestion
// Initiator is an imported js file.
```
Guohui Deng

Done

Line 489, Patchset 1: // The initiator is a JS.
Scott Haseley . unresolved

Can you expand on this comment? I think this means that we're assuming JS is running because a v8::Context was entered?

Also, is this always guaranteed to be called on the main/worker thread? Just wondering if you'd ever expect `isolate` to be null, and in what situations, since IIUC we Enter() the isolate during init (but only on relevant threads).

Guohui Deng

I made a helper function `third_party/blink/renderer/core/loader/initiator_helper.h` and I put the comments there. And I added an extra condition to align with how the Devtools determines if the initiator is JS.

File third_party/blink/renderer/core/scheduler/task_attribution_tracker_impl.cc
Line 127, Patchset 1: TaskAttributionInfo* current_task_state = CurrentTaskState();
Scott Haseley . unresolved

What about web scheduling task state? For soft navs, we can get away with overwriting this because we know this is only called just prior to dispatching input.

Guohui Deng

oops, I missed it big time. Now I test if the Current task state is an instance of TaskAttributionInfoImpl or WebSchedulingTaskState, and then overwrite |resource_timing_context| accordingly.

File third_party/blink/renderer/core/scheduler/task_attribution_util.h
Line 60, Patchset 1: // `tracker` is null if `context` is not a Window or if
Scott Haseley . unresolved

Is this a problem for resource timing? PerformanceResourceTiming is available on workers.

Guohui Deng

I removed the comments. FYI at this CL we still not tracking the resource `initiator_url` in worker. But I plan to support that.

File third_party/blink/renderer/core/script/pending_script.cc
Line 179, Patchset 1: // 1. No plan to support `InitiatorUrl` tracking for scripts generated by

// document.write();
// 2. Tracking `InitiatorUrl` for scripts generated by document.write() is
// Not compatible with test
// `wpt_internal/task-tracking/track-doc-write.html`.
Scott Haseley . resolved

Seems like (1) is a design decision, and (2) is a bug. If (2) is something that needs to be addressed, I'd link to a crbug, otherwise I don't think this needs to be commented here. I'd suggest rewriting the comment to focus on why document.write() is not supported, or just put simply that the API does not support document.write() (ideally with a link to an explainer section or something).

Guohui Deng

Done

Line 190, Patchset 1: task_attribution_resource_timing_scope =
Scott Haseley . resolved

This should be flag-guarded as well.

Guohui Deng

Done

File third_party/blink/renderer/core/timing/resource_timing_context.h
Line 1, Patchset 1:#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_TIMING_RESOURCE_TIMING_CONTEXT_H_
Scott Haseley . resolved

This needs the copyright boilerplate.

Guohui Deng

Done

File third_party/blink/renderer/platform/scheduler/public/task_attribution_info.h
Line 31, Patchset 1: // Returns the `ResourceTimingContext` associated with the task state, which
Scott Haseley . resolved

Please add a line break between methods.

Guohui Deng

Done

Open in Gerrit

Related details

Attention is currently required from:
  • Scott Haseley
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: I125e62d488eec5a85f8afa6cd61c399183c56d86
    Gerrit-Change-Number: 6960132
    Gerrit-PatchSet: 4
    Gerrit-Owner: Guohui Deng <guohu...@microsoft.com>
    Gerrit-Reviewer: Guohui Deng <guohu...@microsoft.com>
    Gerrit-Reviewer: Scott Haseley <shas...@chromium.org>
    Gerrit-CC: Alexis Menard <alexis...@intel.com>
    Gerrit-CC: Nate Chapin <jap...@chromium.org>
    Gerrit-CC: Olga Gerchikov <gerc...@microsoft.com>
    Gerrit-Attention: Scott Haseley <shas...@chromium.org>
    Gerrit-Comment-Date: Thu, 16 Oct 2025 22:51:10 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Scott Haseley <shas...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Scott Haseley (Gerrit)

    unread,
    Oct 24, 2025, 12:44:20 PMOct 24
    to Guohui Deng, Chromium LUCI CQ, Alexis Menard, chromium...@chromium.org, Olga Gerchikov, Nate Chapin, blink-revie...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, chikamu...@chromium.org, core-timi...@chromium.org, ddrone...@google.com, gavinp...@chromium.org, kinuko...@chromium.org, loading...@chromium.org, scheduler-...@chromium.org, speed-metrics...@chromium.org, web-schedulin...@chromium.org
    Attention needed from Guohui Deng

    Scott Haseley added 10 comments

    Patchset-level comments
    Scott Haseley . resolved

    The review is still a WIP. I've just gone through the task attribution bits, and they mostly LG. I'll look at the loader stuff and tests next, but wanted to send this out.

    File third_party/blink/renderer/core/scheduler/task_attribution_tracker_impl.cc
    Line 114, Patchset 4 (Latest): TaskAttributionInfo* current_task_state = CurrentTaskState();
    Scott Haseley . unresolved

    I think we should add a comment here as to why this is different than the other version.

    Can you add something like:

    ```
    // Unlike the other version of `SetTaskStateVariable()`, we don't check for
    // `WebSchedulingTaskState` because `SoftNavigationContext` is known not be
    // created in web scheduling tasks and continuations.
    ```
    Line 127, Patchset 1: TaskAttributionInfo* current_task_state = CurrentTaskState();
    Scott Haseley . unresolved

    What about web scheduling task state? For soft navs, we can get away with overwriting this because we know this is only called just prior to dispatching input.

    Guohui Deng

    oops, I missed it big time. Now I test if the Current task state is an instance of TaskAttributionInfoImpl or WebSchedulingTaskState, and then overwrite |resource_timing_context| accordingly.

    Scott Haseley

    Nice. Left some comments about the approach (I'm interested if we can move some of the logic into the TaskAttributionTaskState classes), but this is what we need to do.

    Is there test coverage for this (you'd need to do something in a scheduler.postTask() callback or requestIdleTask() callback)? The orange lines on the CL make me think it's not covered yet, although those have been wrong (I haven't reviewed tests yet).

    Line 127, Patchset 4 (Latest): TaskAttributionTaskState* task_state =
    Scott Haseley . unresolved

    nit: maybe `current_task_state` and `new_task_state` below, or `previous_task_state` for the existing one, and `current_task_state` for the new one (SetCurrentTaskStateImpl uses `previous_task_state`, so maybe match that).

    Same for the other version.

    Line 131, Patchset 4 (Latest): if (auto* task_attribution_info =
    Scott Haseley . unresolved

    I wonder if it would be cleaner to add a `ForkAndSetVariable()` (or something) method to `TaskAttributionTaskState`, rather than all the casting?

    Line 136, Patchset 4 (Latest): next_task_id_, soft_navigation_context, resource_timing_context);
    Scott Haseley . unresolved

    nit: can you just inline this (remove the temp variable)?

    Line 139, Patchset 4 (Latest): TaskAttributionInfo* inner_task_attribution_info =
    Scott Haseley . unresolved

    I think you can just get the soft nav context from `task_state` here, instead of reaching for the inner state (to avoid some temp variables)

    Line 164, Patchset 4 (Latest):TaskAttributionTrackerImpl::SetCurrentTaskStateImpl(
    Scott Haseley . unresolved

    `TaskAttributionTaskState::GetCurrent()` is fairly optimized now, but still isn't quite as cheap as I wish it was. Can we change this to take the `previous_task_state`, since you have that in `SetTaskStateVariable`, and add an overload that passes TaskAttributionTaskState::GetCurrent() for when we don't have it?

    File third_party/blink/renderer/core/scheduler/task_attribution_util.h
    Line 60, Patchset 1: // `tracker` is null if `context` is not a Window or if
    Scott Haseley . unresolved

    Is this a problem for resource timing? PerformanceResourceTiming is available on workers.

    Guohui Deng

    I removed the comments. FYI at this CL we still not tracking the resource `initiator_url` in worker. But I plan to support that.

    Scott Haseley

    Task Attribution isn't available on Workers either, so we'll have to think that through. For the web scheduling APIs, I just use TaskAttributionTaskState::Get/SetCurrent() directly, but we can't do that elsewhere.

    File third_party/blink/renderer/core/timing/resource_timing_context.h
    Line 13, Patchset 4 (Latest):class CORE_EXPORT ResourceTimingContext final
    Scott Haseley . unresolved

    nit: Please add a class comment about what this.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Guohui Deng
    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: I125e62d488eec5a85f8afa6cd61c399183c56d86
    Gerrit-Change-Number: 6960132
    Gerrit-PatchSet: 4
    Gerrit-Owner: Guohui Deng <guohu...@microsoft.com>
    Gerrit-Reviewer: Guohui Deng <guohu...@microsoft.com>
    Gerrit-Reviewer: Scott Haseley <shas...@chromium.org>
    Gerrit-CC: Alexis Menard <alexis...@intel.com>
    Gerrit-CC: Nate Chapin <jap...@chromium.org>
    Gerrit-CC: Olga Gerchikov <gerc...@microsoft.com>
    Gerrit-Attention: Guohui Deng <guohu...@microsoft.com>
    Gerrit-Comment-Date: Fri, 24 Oct 2025 16:44:10 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Guohui Deng <guohu...@microsoft.com>
    Comment-In-Reply-To: Scott Haseley <shas...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Guohui Deng (Gerrit)

    unread,
    Nov 19, 2025, 6:29:20 PMNov 19
    to Scott Haseley, Chromium LUCI CQ, Menard, Alexis, chromium...@chromium.org, Olga Gerchikov, Nate Chapin, blink-revie...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, chikamu...@chromium.org, core-timi...@chromium.org, ddrone...@google.com, gavinp...@chromium.org, kinuko...@chromium.org, loading...@chromium.org, scheduler-...@chromium.org, speed-metrics...@chromium.org, web-schedulin...@chromium.org
    Attention needed from Scott Haseley

    Guohui Deng added 12 comments

    Patchset-level comments
    File-level comment, Patchset 6 (Latest):
    Guohui Deng . resolved

    1. I re-wrote the logic that "fork"s the task attribution using all the great suggestions from Scott; 2. I added one more test to cover the "fork" better.

    I think all the comments are addressed, but then there is a lot of new code.
    Thanks for reviewing.
    Cheers,
    Guohui

    File third_party/blink/renderer/core/html/html_frame_owner_element.cc
    Line 706, Patchset 1: if (resource_timing_context) {
    Scott Haseley . resolved

    Wha happens if this is null and `initiator_url` ends up empty, will it use a fallback somewhere else, or is intended to be empty for now?

    Guohui Deng

    For now, `InitiatorUrl` field in resource timing is an empty string if there is no valid value. An invalid |initiator_url| is converted to an empty string in `PerformanceResourceTiming::initiatorUrl()`

    So it doesn't distinguish between 1) lack of implementation in UA 2) the "initiator" really doesn't exist (like the main page loaded by user action)

    I expect it to remain that way until we find user case for it.

    Guohui Deng

    Mark as resolved.

    File third_party/blink/renderer/core/loader/frame_fetch_context.cc
    Line 489, Patchset 1: // The initiator is a JS.
    Scott Haseley . resolved

    Can you expand on this comment? I think this means that we're assuming JS is running because a v8::Context was entered?

    Also, is this always guaranteed to be called on the main/worker thread? Just wondering if you'd ever expect `isolate` to be null, and in what situations, since IIUC we Enter() the isolate during init (but only on relevant threads).

    Guohui Deng

    I made a helper function `third_party/blink/renderer/core/loader/initiator_helper.h` and I put the comments there. And I added an extra condition to align with how the Devtools determines if the initiator is JS.

    Guohui Deng

    Marked as resolved.

    File third_party/blink/renderer/core/scheduler/task_attribution_tracker_impl.cc
    Line 114, Patchset 4: TaskAttributionInfo* current_task_state = CurrentTaskState();
    Scott Haseley . resolved

    I think we should add a comment here as to why this is different than the other version.

    Can you add something like:

    ```
    // Unlike the other version of `SetTaskStateVariable()`, we don't check for
    // `WebSchedulingTaskState` because `SoftNavigationContext` is known not be
    // created in web scheduling tasks and continuations.
    ```
    Guohui Deng

    These are great suggestions! I re-wrote the related code. In the new patchset,
    I made `ForkAndSetVariable()` and make suggested comments in two places.

    Line 127, Patchset 1: TaskAttributionInfo* current_task_state = CurrentTaskState();
    Scott Haseley . resolved

    What about web scheduling task state? For soft navs, we can get away with overwriting this because we know this is only called just prior to dispatching input.

    Guohui Deng

    oops, I missed it big time. Now I test if the Current task state is an instance of TaskAttributionInfoImpl or WebSchedulingTaskState, and then overwrite |resource_timing_context| accordingly.

    Scott Haseley

    Nice. Left some comments about the approach (I'm interested if we can move some of the logic into the TaskAttributionTaskState classes), but this is what we need to do.

    Is there test coverage for this (you'd need to do something in a scheduler.postTask() callback or requestIdleTask() callback)? The orange lines on the CL make me think it's not covered yet, although those have been wrong (I haven't reviewed tests yet).

    Guohui Deng

    Yes I added one more test for this purpose.

    Line 127, Patchset 4: TaskAttributionTaskState* task_state =
    Scott Haseley . resolved

    nit: maybe `current_task_state` and `new_task_state` below, or `previous_task_state` for the existing one, and `current_task_state` for the new one (SetCurrentTaskStateImpl uses `previous_task_state`, so maybe match that).

    Same for the other version.

    Guohui Deng

    I ended up using `previous_task_state` and `next_task_state`. I see `current_task_state` is not used and I think `next_...` is more clear so I used `next..`. instead of `current_...`

    Line 131, Patchset 4: if (auto* task_attribution_info =
    Scott Haseley . resolved

    I wonder if it would be cleaner to add a `ForkAndSetVariable()` (or something) method to `TaskAttributionTaskState`, rather than all the casting?

    Guohui Deng

    Done

    Line 136, Patchset 4: next_task_id_, soft_navigation_context, resource_timing_context);
    Scott Haseley . resolved

    nit: can you just inline this (remove the temp variable)?

    Guohui Deng

    Done

    Line 139, Patchset 4: TaskAttributionInfo* inner_task_attribution_info =
    Scott Haseley . unresolved

    I think you can just get the soft nav context from `task_state` here, instead of reaching for the inner state (to avoid some temp variables)

    Guohui Deng

    I moved this logic to WebSchedulingTaskState internal function. There I think I need to get the TaskAttributionInfo to get the soft nav context.
    I leave this comment unsolved for visibility.

    Line 164, Patchset 4:TaskAttributionTrackerImpl::SetCurrentTaskStateImpl(
    Scott Haseley . resolved

    `TaskAttributionTaskState::GetCurrent()` is fairly optimized now, but still isn't quite as cheap as I wish it was. Can we change this to take the `previous_task_state`, since you have that in `SetTaskStateVariable`, and add an overload that passes TaskAttributionTaskState::GetCurrent() for when we don't have it?

    Guohui Deng

    Done.

    File third_party/blink/renderer/core/scheduler/task_attribution_util.h
    Line 60, Patchset 1: // `tracker` is null if `context` is not a Window or if
    Scott Haseley . unresolved

    Is this a problem for resource timing? PerformanceResourceTiming is available on workers.

    Guohui Deng

    I removed the comments. FYI at this CL we still not tracking the resource `initiator_url` in worker. But I plan to support that.

    Scott Haseley

    Task Attribution isn't available on Workers either, so we'll have to think that through. For the web scheduling APIs, I just use TaskAttributionTaskState::Get/SetCurrent() directly, but we can't do that elsewhere.

    Guohui Deng

    Thanks! I didn't know that. There are a few things for `initiator_url` that are of higher priority before I get to the `resource timing` on worker. Would like to consult with you at your convenience later to sort this out.

    I keep this unsolved for visibility.

    File third_party/blink/renderer/core/timing/resource_timing_context.h
    Line 13, Patchset 4:class CORE_EXPORT ResourceTimingContext final
    Scott Haseley . resolved

    nit: Please add a class comment about what this.

    Guohui Deng

    Done

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Scott Haseley
    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: I125e62d488eec5a85f8afa6cd61c399183c56d86
    Gerrit-Change-Number: 6960132
    Gerrit-PatchSet: 6
    Gerrit-Owner: Guohui Deng <guohu...@microsoft.com>
    Gerrit-Reviewer: Guohui Deng <guohu...@microsoft.com>
    Gerrit-Reviewer: Scott Haseley <shas...@chromium.org>
    Gerrit-CC: Menard, Alexis <alexis...@intel.com>
    Gerrit-CC: Nate Chapin <jap...@chromium.org>
    Gerrit-CC: Olga Gerchikov <gerc...@microsoft.com>
    Gerrit-Attention: Scott Haseley <shas...@chromium.org>
    Gerrit-Comment-Date: Wed, 19 Nov 2025 23:29:10 +0000
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Scott Haseley (Gerrit)

    unread,
    Nov 20, 2025, 1:36:59 PMNov 20
    to Guohui Deng, Chromium LUCI CQ, Menard, Alexis, chromium...@chromium.org, Olga Gerchikov, Nate Chapin, blink-revie...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, chikamu...@chromium.org, core-timi...@chromium.org, ddrone...@google.com, gavinp...@chromium.org, kinuko...@chromium.org, loading...@chromium.org, scheduler-...@chromium.org, speed-metrics...@chromium.org, web-schedulin...@chromium.org
    Attention needed from Guohui Deng

    Scott Haseley added 13 comments

    Patchset-level comments
    Scott Haseley . resolved

    Nice, this is getting close!

    File third_party/blink/renderer/core/html/html_frame_owner_element.cc
    Line 705, Patchset 6 (Latest): auto* tracker = scheduler::TaskAttributionTracker::From(isolate);
    Scott Haseley . unresolved

    nit: You might want to add a helper method to InitiatorHelper for getting the URL given the isolate since appears to be the same as in the other file, or a single method that returns std::optional<> where nullopt -> script isn't running.

    File third_party/blink/renderer/core/loader/initiator_helper.h
    Line 30, Patchset 6 (Latest): if (ThreadDebugger::From(isolate) && isolate->InContext()) {
    Scott Haseley . unresolved

    I don't quite understand this. The ThreadDebugger is created early in initialization (for main thread: https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/bindings/core/v8/v8_initializer.cc;l=1052-1053;drc=db569cd7847d479358bd391a18b2c28393803333;bpv=1;bpt=1), so why is this check needed?

    File third_party/blink/renderer/core/scheduler/task_attribution_task_state.h
    Line 72, Patchset 6 (Latest): const scheduler::TaskAttributionId*,
    Scott Haseley . unresolved

    Same here.

    Line 68, Patchset 6 (Latest): const scheduler::TaskAttributionId*,
    Scott Haseley . unresolved

    Let's pass this by value here.

    Line 67, Patchset 6 (Latest): virtual TaskAttributionTaskState* ForkAndSetVariable(
    Scott Haseley . unresolved

    Can you add a comment for these?

    File third_party/blink/renderer/core/scheduler/task_attribution_tracker_impl.cc
    Line 139, Patchset 4: TaskAttributionInfo* inner_task_attribution_info =
    Scott Haseley . resolved

    I think you can just get the soft nav context from `task_state` here, instead of reaching for the inner state (to avoid some temp variables)

    Guohui Deng

    I moved this logic to WebSchedulingTaskState internal function. There I think I need to get the TaskAttributionInfo to get the soft nav context.
    I leave this comment unsolved for visibility.

    Scott Haseley

    Acknowledged

    Line 176, Patchset 6 (Latest): TaskAttributionTaskState* next_task_state;
    Scott Haseley . unresolved

    nit: I think it would be marginally cleaner to initialize this in a ternary expression below to make it obvious that it's always set (same below). Otherwise this should probably be initialized to nullptr per style guide.

    Line 180, Patchset 6 (Latest): // Because `SoftNavigationContext` is known not be created in web scheduling
    // tasks and continuations, |previous_task_state| actually cannot be a
    // WebSchedulingTaskState..
    Scott Haseley . unresolved

    This probably isn't needed anymore, right? I think the comment by the NOTREACHED in WebSchedulingTaskState covers it now, and this doesn't really apply here anymore since ForkAndSet being called unconditionally.

    Line 221, Patchset 6 (Latest): TaskAttributionTaskState* previous_task_state =
    Scott Haseley . unresolved

    nit/optional: I'd just inline the call in the arg list and get rid of the temp variable.

    File third_party/blink/renderer/core/scheduler/task_attribution_util.h
    Line 60, Patchset 1: // `tracker` is null if `context` is not a Window or if
    Scott Haseley . unresolved

    Is this a problem for resource timing? PerformanceResourceTiming is available on workers.

    Guohui Deng

    I removed the comments. FYI at this CL we still not tracking the resource `initiator_url` in worker. But I plan to support that.

    Scott Haseley

    Task Attribution isn't available on Workers either, so we'll have to think that through. For the web scheduling APIs, I just use TaskAttributionTaskState::Get/SetCurrent() directly, but we can't do that elsewhere.

    Guohui Deng

    Thanks! I didn't know that. There are a few things for `initiator_url` that are of higher priority before I get to the `resource timing` on worker. Would like to consult with you at your convenience later to sort this out.

    I keep this unsolved for visibility.

    Scott Haseley

    ACK.

    File third_party/blink/renderer/core/scheduler/web_scheduling_task_state.cc
    Line 39, Patchset 6 (Latest): scheduler::TaskAttributionInfo* current_task_attribution_info =
    Scott Haseley . unresolved

    nit/optional: You could also delegate to TaskAttributionImpl::ForkAndSetVariable here, but I'm not sure it's much cleaner since you'd still need to create the TaskAttributionInfoImpl in that case.

    File third_party/blink/renderer/core/timing/resource_timing_context.h
    Line 14, Patchset 6 (Latest):// content is used to make `PerformanceResourceTiming` report.
    Scott Haseley . unresolved

    Can you clarify this? I think it means "Its content is included in PerformanceResourceTiming" ?

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Guohui Deng
    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: I125e62d488eec5a85f8afa6cd61c399183c56d86
    Gerrit-Change-Number: 6960132
    Gerrit-PatchSet: 6
    Gerrit-Owner: Guohui Deng <guohu...@microsoft.com>
    Gerrit-Reviewer: Guohui Deng <guohu...@microsoft.com>
    Gerrit-Reviewer: Scott Haseley <shas...@chromium.org>
    Gerrit-CC: Menard, Alexis <alexis...@intel.com>
    Gerrit-CC: Nate Chapin <jap...@chromium.org>
    Gerrit-CC: Olga Gerchikov <gerc...@microsoft.com>
    Gerrit-Attention: Guohui Deng <guohu...@microsoft.com>
    Gerrit-Comment-Date: Thu, 20 Nov 2025 18:36:49 +0000
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Guohui Deng (Gerrit)

    unread,
    Nov 21, 2025, 12:34:12 PMNov 21
    to Scott Haseley, Chromium LUCI CQ, Menard, Alexis, chromium...@chromium.org, Olga Gerchikov, Nate Chapin, blink-revie...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, chikamu...@chromium.org, core-timi...@chromium.org, ddrone...@google.com, gavinp...@chromium.org, kinuko...@chromium.org, loading...@chromium.org, scheduler-...@chromium.org, speed-metrics...@chromium.org, web-schedulin...@chromium.org
    Attention needed from Scott Haseley

    Guohui Deng added 11 comments

    Patchset-level comments
    File-level comment, Patchset 7 (Latest):
    Guohui Deng . resolved

    Yay getting closer!
    Thanks for the effort put in the review!

    File third_party/blink/renderer/core/html/html_frame_owner_element.cc
    Line 705, Patchset 6: auto* tracker = scheduler::TaskAttributionTracker::From(isolate);
    Scott Haseley . resolved

    nit: You might want to add a helper method to InitiatorHelper for getting the URL given the isolate since appears to be the same as in the other file, or a single method that returns std::optional<> where nullopt -> script isn't running.

    Guohui Deng

    Done.
    `InitiatorHelper::GetScriptInitiatorUrlFromValidIsolate(isolate)`

    File third_party/blink/renderer/core/loader/initiator_helper.h
    Line 30, Patchset 6: if (ThreadDebugger::From(isolate) && isolate->InContext()) {
    Scott Haseley . unresolved

    I don't quite understand this. The ThreadDebugger is created early in initialization (for main thread: https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/bindings/core/v8/v8_initializer.cc;l=1052-1053;drc=db569cd7847d479358bd391a18b2c28393803333;bpv=1;bpt=1), so why is this check needed?

    Guohui Deng

    Thanks for pointing this out! I realized for my purpose, I don't need this on workers. So I should not check `ThreadDebugger` like the |InspectorNetworkAgent| does.

    I also added the check "main thread" and updated the comment.

    File third_party/blink/renderer/core/scheduler/task_attribution_task_state.h
    Line 72, Patchset 6: const scheduler::TaskAttributionId*,
    Scott Haseley . resolved

    Same here.

    Guohui Deng

    Done

    Line 68, Patchset 6: const scheduler::TaskAttributionId*,
    Scott Haseley . resolved

    Let's pass this by value here.

    Guohui Deng

    Done

    Line 67, Patchset 6: virtual TaskAttributionTaskState* ForkAndSetVariable(
    Scott Haseley . resolved

    Can you add a comment for these?

    Guohui Deng

    Done

    File third_party/blink/renderer/core/scheduler/task_attribution_tracker_impl.cc
    Line 176, Patchset 6: TaskAttributionTaskState* next_task_state;
    Scott Haseley . resolved

    nit: I think it would be marginally cleaner to initialize this in a ternary expression below to make it obvious that it's always set (same below). Otherwise this should probably be initialized to nullptr per style guide.

    Guohui Deng

    Done.

    Yes it's much better now! 😊

    Line 180, Patchset 6: // Because `SoftNavigationContext` is known not be created in web scheduling

    // tasks and continuations, |previous_task_state| actually cannot be a
    // WebSchedulingTaskState..
    Scott Haseley . resolved

    This probably isn't needed anymore, right? I think the comment by the NOTREACHED in WebSchedulingTaskState covers it now, and this doesn't really apply here anymore since ForkAndSet being called unconditionally.

    Guohui Deng

    Done

    Line 221, Patchset 6: TaskAttributionTaskState* previous_task_state =
    Scott Haseley . resolved

    nit/optional: I'd just inline the call in the arg list and get rid of the temp variable.

    Guohui Deng

    Done

    File third_party/blink/renderer/core/scheduler/web_scheduling_task_state.cc
    Line 39, Patchset 6: scheduler::TaskAttributionInfo* current_task_attribution_info =
    Scott Haseley . unresolved

    nit/optional: You could also delegate to TaskAttributionImpl::ForkAndSetVariable here, but I'm not sure it's much cleaner since you'd still need to create the TaskAttributionInfoImpl in that case.

    Guohui Deng

    Yes I think delegating to `TaskAttributionImpl::ForkAndSetVariable` is very clear: logically it is a `TaskAttributionImpl` being forked. The reason why I didn't do that yet is that the `ForkAndSetVariable` is not exposed via `TaskAttributionInfo` interface. So I have to "cast" to `TaskAttributionImpl`. (Although the infrastructure for the cast is in place)

    File third_party/blink/renderer/core/timing/resource_timing_context.h
    Line 14, Patchset 6:// content is used to make `PerformanceResourceTiming` report.
    Scott Haseley . unresolved

    Can you clarify this? I think it means "Its content is included in PerformanceResourceTiming" ?

    Guohui Deng

    yes that's a better way to phrase it and I modified the comment accordingly 😊

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Scott Haseley
    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: I125e62d488eec5a85f8afa6cd61c399183c56d86
    Gerrit-Change-Number: 6960132
    Gerrit-PatchSet: 7
    Gerrit-Owner: Guohui Deng <guohu...@microsoft.com>
    Gerrit-Reviewer: Guohui Deng <guohu...@microsoft.com>
    Gerrit-Reviewer: Scott Haseley <shas...@chromium.org>
    Gerrit-CC: Menard, Alexis <alexis...@intel.com>
    Gerrit-CC: Nate Chapin <jap...@chromium.org>
    Gerrit-CC: Olga Gerchikov <gerc...@microsoft.com>
    Gerrit-Attention: Scott Haseley <shas...@chromium.org>
    Gerrit-Comment-Date: Fri, 21 Nov 2025 17:34:02 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Scott Haseley <shas...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Scott Haseley (Gerrit)

    unread,
    Dec 9, 2025, 6:01:34 PM (7 days ago) Dec 9
    to Guohui Deng, Chromium LUCI CQ, Menard, Alexis, chromium...@chromium.org, Olga Gerchikov, Nate Chapin, blink-revie...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, chikamu...@chromium.org, core-timi...@chromium.org, ddrone...@google.com, gavinp...@chromium.org, kinuko...@chromium.org, loading...@chromium.org, scheduler-...@chromium.org, speed-metrics...@chromium.org, web-schedulin...@chromium.org
    Attention needed from Guohui Deng

    Scott Haseley added 12 comments

    Patchset-level comments
    File-level comment, Patchset 8 (Latest):
    Scott Haseley . resolved

    Okay, I think this LGTM % comments (mostly nits). I'll stamp once the merge conflict / comments are all resolved.

    Adding mmocny to take a pass as well.

    File third_party/blink/renderer/core/loader/initiator_helper.h
    Line 29, Patchset 8 (Latest): DCHECK(IsMainThread());
    Scott Haseley . unresolved

    nit: Can we use `CHECK` here and below (current style guidance is to prefer CHECK, unless justified: https://source.chromium.org/chromium/chromium/src/+/main:styleguide/c++/checks.md)?

    Line 24, Patchset 8 (Latest): // JavaScript is rurrently running for "initiator" purpose as in 2025.
    Scott Haseley . unresolved
    ```suggestion
    // JavaScript is rurrently running for "initiator".
    ```

    (redundant given lead of paragraph)

    Also, maybe move this down to where the call is being made (above line 31), since it's an implementation detail (vs. a description of the method).

    Line 20, Patchset 8 (Latest): // As in 2025, there is no V8 API that definitively tells if JavaScript
    Scott Haseley . unresolved
    ```suggestion
    // As of 2025, there is no V8 API that definitively tells if JavaScript
    ```
    Line 30, Patchset 6: if (ThreadDebugger::From(isolate) && isolate->InContext()) {
    Scott Haseley . resolved

    I don't quite understand this. The ThreadDebugger is created early in initialization (for main thread: https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/bindings/core/v8/v8_initializer.cc;l=1052-1053;drc=db569cd7847d479358bd391a18b2c28393803333;bpv=1;bpt=1), so why is this check needed?

    Guohui Deng

    Thanks for pointing this out! I realized for my purpose, I don't need this on workers. So I should not check `ThreadDebugger` like the |InspectorNetworkAgent| does.

    I also added the check "main thread" and updated the comment.

    Scott Haseley

    ACK.

    File third_party/blink/renderer/core/scheduler/task_attribution_task_state.h
    Line 67, Patchset 8 (Latest): // Fork to a new copy, overriding with specified TaskAttributionID and
    Scott Haseley . unresolved

    ultra nit (same below): s/TaskAttributionID/TaskAttributionId (match case of type)

    File third_party/blink/renderer/core/scheduler/web_scheduling_task_state.cc
    Line 39, Patchset 6: scheduler::TaskAttributionInfo* current_task_attribution_info =
    Scott Haseley . unresolved

    nit/optional: You could also delegate to TaskAttributionImpl::ForkAndSetVariable here, but I'm not sure it's much cleaner since you'd still need to create the TaskAttributionInfoImpl in that case.

    Guohui Deng

    Yes I think delegating to `TaskAttributionImpl::ForkAndSetVariable` is very clear: logically it is a `TaskAttributionImpl` being forked. The reason why I didn't do that yet is that the `ForkAndSetVariable` is not exposed via `TaskAttributionInfo` interface. So I have to "cast" to `TaskAttributionImpl`. (Although the infrastructure for the cast is in place)

    Scott Haseley

    Yeah you'd have to cast first. The advantage of calling fork explicitly is the implementation is in place, but I'm okay with either. If we add more task attribution variables, this will need to change to something more scalable anyway.

    File third_party/blink/renderer/core/timing/resource_timing_context.h
    Line 14, Patchset 6:// content is used to make `PerformanceResourceTiming` report.
    Scott Haseley . resolved

    Can you clarify this? I think it means "Its content is included in PerformanceResourceTiming" ?

    Guohui Deng

    yes that's a better way to phrase it and I modified the comment accordingly 😊

    Scott Haseley

    Done

    File third_party/blink/web_tests/external/wpt/resource-timing/tentative/initiator-url/event-handler.html
    Line 13, Patchset 8 (Latest): the initiator_url points to script that setups the event handler.
    Scott Haseley . unresolved
    ```suggestion
    the initiator_url points to script that sets up the event handler.
    ```
    File third_party/blink/web_tests/external/wpt/resource-timing/tentative/initiator-url/external-script.html
    Line 14, Patchset 8 (Latest): and verifies that `iniatitor_url`s in ResourceTiming are expected.
    Scott Haseley . unresolved

    nit/suggestion (here and other tests):

    ```suggestion
    and verifies that `iniatitor_url`s in ResourceTiming entries are as expected.
    ```
    File third_party/blink/web_tests/external/wpt/resource-timing/tentative/initiator-url/inline-script.html
    Line 11, Patchset 8 (Latest): <p> This test verifies that, for an iframe loaded by script,
    the initiatorUrl is properly reported.
    </p>
    Scott Haseley . unresolved

    This should work for same-frame postMessage (maybe consider adding a test?), but I'm not sure if task attribution will ever support cross-frame propagation. Adding the test with the ideal state SGTM, but we should probably (separately) discuss what should happen for this.

    File third_party/blink/web_tests/external/wpt/resource-timing/tentative/initiator-url/post-task.html
    Line 29, Patchset 8 (Latest): " initiatorUlr from postTask()", resource + " timeout");
    Scott Haseley . unresolved

    typo?

    ```suggestion
    " initiatorUrl from postTask()", resource + " timeout");
    ```
    Open in Gerrit

    Related details

    Attention is currently required from:
    • Guohui Deng
    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: I125e62d488eec5a85f8afa6cd61c399183c56d86
    Gerrit-Change-Number: 6960132
    Gerrit-PatchSet: 8
    Gerrit-Owner: Guohui Deng <guohu...@microsoft.com>
    Gerrit-Reviewer: Guohui Deng <guohu...@microsoft.com>
    Gerrit-Reviewer: Scott Haseley <shas...@chromium.org>
    Gerrit-CC: Menard, Alexis <alexis...@intel.com>
    Gerrit-CC: Nate Chapin <jap...@chromium.org>
    Gerrit-CC: Olga Gerchikov <gerc...@microsoft.com>
    Gerrit-Attention: Guohui Deng <guohu...@microsoft.com>
    Gerrit-Comment-Date: Tue, 09 Dec 2025 23:01:25 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Scott Haseley (Gerrit)

    unread,
    Dec 9, 2025, 6:01:55 PM (7 days ago) Dec 9
    to Guohui Deng, Michal Mocny, Chromium LUCI CQ, Menard, Alexis, chromium...@chromium.org, Olga Gerchikov, Nate Chapin, blink-revie...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, chikamu...@chromium.org, core-timi...@chromium.org, ddrone...@google.com, gavinp...@chromium.org, kinuko...@chromium.org, loading...@chromium.org, scheduler-...@chromium.org, speed-metrics...@chromium.org, web-schedulin...@chromium.org
    Attention needed from Guohui Deng and Michal Mocny

    Scott Haseley added 1 comment

    Patchset-level comments
    Scott Haseley . resolved

    +mmocny for realz

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Guohui Deng
    • Michal Mocny
    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: I125e62d488eec5a85f8afa6cd61c399183c56d86
    Gerrit-Change-Number: 6960132
    Gerrit-PatchSet: 8
    Gerrit-Owner: Guohui Deng <guohu...@microsoft.com>
    Gerrit-Reviewer: Guohui Deng <guohu...@microsoft.com>
    Gerrit-Reviewer: Michal Mocny <mmo...@chromium.org>
    Gerrit-Reviewer: Scott Haseley <shas...@chromium.org>
    Gerrit-CC: Menard, Alexis <alexis...@intel.com>
    Gerrit-CC: Nate Chapin <jap...@chromium.org>
    Gerrit-CC: Olga Gerchikov <gerc...@microsoft.com>
    Gerrit-Attention: Guohui Deng <guohu...@microsoft.com>
    Gerrit-Attention: Michal Mocny <mmo...@chromium.org>
    Gerrit-Comment-Date: Tue, 09 Dec 2025 23:01:44 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Michal Mocny (Gerrit)

    unread,
    Dec 10, 2025, 11:53:07 AM (6 days ago) Dec 10
    to Guohui Deng, Scott Haseley, Chromium LUCI CQ, Menard, Alexis, chromium...@chromium.org, Olga Gerchikov, Nate Chapin, blink-revie...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, chikamu...@chromium.org, core-timi...@chromium.org, ddrone...@google.com, gavinp...@chromium.org, kinuko...@chromium.org, loading...@chromium.org, scheduler-...@chromium.org, speed-metrics...@chromium.org, web-schedulin...@chromium.org
    Attention needed from Guohui Deng

    Michal Mocny added 7 comments

    Patchset-level comments
    Michal Mocny . resolved

    Seems reasonable, and I appreciate all the tests including those that still fail. (I didn't review all the tests thoroughly)

    Commit Message
    Line 11, Patchset 8 (Latest):The `initiator-url` is now exposed for the following resources: 1)
    Resources fetched by script, in most common conditions. Resources
    fetched in event handlers, and imported scripts are not covered yet. So
    far there is no plan to support Other rarer conditions. 2) Iframe pages.
    Michal Mocny . unresolved

    Would you mind cleaning this up to make it clearer what IS supported after this patch, what ISNT YET supported but WILL be, vs what isnt.

    I think its:

    Supported:

    • Resources fetched by script
    • Iframe pages

    Not supported (yet):

    • Resources fetched by event handlers
    • Imported scripts

    Not supported (and unplanned):

    • ? "other rare conditions"

    (I see mention of stylesheet initiated scripts in the CL but I dont know if its the middle or the final category)

    File third_party/blink/renderer/core/loader/frame_fetch_context.cc
    Line 497, Patchset 8 (Latest): InitiatorHelper::GetScriptInitiatorUrlFromValidIsolate(isolate);
    Michal Mocny . unresolved

    I think it is it possible for this to return empty string-- do we want to fallback to document->Url in that case or keep empty string?

    File third_party/blink/renderer/core/loader/initiator_helper.h
    Line 24, Patchset 8 (Latest): // JavaScript is rurrently running for "initiator" purpose as in 2025.
    Scott Haseley . unresolved
    ```suggestion
    // JavaScript is rurrently running for "initiator".
    ```

    (redundant given lead of paragraph)

    Also, maybe move this down to where the call is being made (above line 31), since it's an implementation detail (vs. a description of the method).

    Michal Mocny

    +1 to remove redundancy and to move comment down.

    I suggest something as simple as:

    "We are assuming that |isolate->InContext()| indicates that JavaScript is running, though this isn't guaranteed. There is no v8 API that is truly definitive for this. This matches existing |InspectorNetworkAgent| usage."

    Line 16, Patchset 8 (Latest):class InitiatorHelper final {
    Michal Mocny . unresolved

    Nit: should this be ResourceInitiatorHelper? Will it expand beyond?

    File third_party/blink/renderer/core/scheduler/task_attribution_info_impl.h
    Line 27, Patchset 8 (Latest): ResourceTimingContext*);
    Michal Mocny . unresolved

    Scott: Should we start calling these "AsyncVariable" or at least "ContextValue" or something?

    File third_party/blink/renderer/core/script/pending_script.cc
    Line 181, Patchset 8 (Latest): {
    Michal Mocny . unresolved

    Nit: this scope spans to the end of the function-- could it be removed? (just leave unnested)

    If ever someone added any followup code after `ExecuteScriptBlockInternal` would it be important that the Scope be closed?

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Guohui Deng
    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: I125e62d488eec5a85f8afa6cd61c399183c56d86
    Gerrit-Change-Number: 6960132
    Gerrit-PatchSet: 8
    Gerrit-Owner: Guohui Deng <guohu...@microsoft.com>
    Gerrit-Reviewer: Guohui Deng <guohu...@microsoft.com>
    Gerrit-Reviewer: Michal Mocny <mmo...@chromium.org>
    Gerrit-Reviewer: Scott Haseley <shas...@chromium.org>
    Gerrit-CC: Menard, Alexis <alexis...@intel.com>
    Gerrit-CC: Nate Chapin <jap...@chromium.org>
    Gerrit-CC: Olga Gerchikov <gerc...@microsoft.com>
    Gerrit-Attention: Guohui Deng <guohu...@microsoft.com>
    Gerrit-Comment-Date: Wed, 10 Dec 2025 16:53:01 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Scott Haseley <shas...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Michal Mocny (Gerrit)

    unread,
    Dec 10, 2025, 11:53:27 AM (6 days ago) Dec 10
    to Guohui Deng, Scott Haseley, Chromium LUCI CQ, Menard, Alexis, chromium...@chromium.org, Olga Gerchikov, Nate Chapin, blink-revie...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, chikamu...@chromium.org, core-timi...@chromium.org, ddrone...@google.com, gavinp...@chromium.org, kinuko...@chromium.org, loading...@chromium.org, scheduler-...@chromium.org, speed-metrics...@chromium.org, web-schedulin...@chromium.org
    Attention needed from Guohui Deng

    Michal Mocny added 1 comment

    Patchset-level comments
    Michal Mocny . resolved

    Also, needs a Rebase and re-upload

    Gerrit-Comment-Date: Wed, 10 Dec 2025 16:53:21 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Scott Haseley (Gerrit)

    unread,
    Dec 10, 2025, 12:47:06 PM (6 days ago) Dec 10
    to Guohui Deng, Michal Mocny, Chromium LUCI CQ, Menard, Alexis, chromium...@chromium.org, Olga Gerchikov, Nate Chapin, blink-revie...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, chikamu...@chromium.org, core-timi...@chromium.org, ddrone...@google.com, gavinp...@chromium.org, kinuko...@chromium.org, loading...@chromium.org, scheduler-...@chromium.org, speed-metrics...@chromium.org, web-schedulin...@chromium.org
    Attention needed from Guohui Deng

    Scott Haseley added 1 comment

    File third_party/blink/renderer/core/scheduler/task_attribution_info_impl.h
    Line 27, Patchset 8 (Latest): ResourceTimingContext*);
    Michal Mocny . unresolved

    Scott: Should we start calling these "AsyncVariable" or at least "ContextValue" or something?

    Scott Haseley

    Probably. I think I suggested `ResourceTimingContext` to match SNC. I want to think about if we should have an `AsyncVariable` base class and generalize this (leaning towards yes, but as a follow-up). I'm thinking `AsyncVariable` + a slot in an array (vs. a map, since we have so few) might be better than leaking types here. It would make `Fork()` more scalable too. I'm okay with this as-is or changing to `ResourceTimingAsyncVariable`.

    Gerrit-Comment-Date: Wed, 10 Dec 2025 17:46:54 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Michal Mocny <mmo...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Guohui Deng (Gerrit)

    unread,
    Dec 12, 2025, 4:40:40 PM (4 days ago) Dec 12
    to Michal Mocny, Scott Haseley, Chromium LUCI CQ, Menard, Alexis, chromium...@chromium.org, Olga Gerchikov, Nate Chapin, blink-revie...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, chikamu...@chromium.org, core-timi...@chromium.org, ddrone...@google.com, gavinp...@chromium.org, kinuko...@chromium.org, loading...@chromium.org, scheduler-...@chromium.org, speed-metrics...@chromium.org, web-schedulin...@chromium.org
    Attention needed from Michal Mocny and Scott Haseley

    Guohui Deng added 15 comments

    Commit Message
    Line 11, Patchset 8:The `initiator-url` is now exposed for the following resources: 1)

    Resources fetched by script, in most common conditions. Resources
    fetched in event handlers, and imported scripts are not covered yet. So
    far there is no plan to support Other rarer conditions. 2) Iframe pages.
    Michal Mocny . unresolved

    Would you mind cleaning this up to make it clearer what IS supported after this patch, what ISNT YET supported but WILL be, vs what isnt.

    I think its:

    Supported:

    • Resources fetched by script
    • Iframe pages

    Not supported (yet):

    • Resources fetched by event handlers
    • Imported scripts

    Not supported (and unplanned):

    • ? "other rare conditions"

    (I see mention of stylesheet initiated scripts in the CL but I dont know if its the middle or the final category)

    Guohui Deng

    Done. And I fixed an error in the comment about "import JS".

    File third_party/blink/renderer/core/loader/frame_fetch_context.cc
    Line 497, Patchset 8: InitiatorHelper::GetScriptInitiatorUrlFromValidIsolate(isolate);
    Michal Mocny . resolved

    I think it is it possible for this to return empty string-- do we want to fallback to document->Url in that case or keep empty string?

    Guohui Deng

    For the "initiator_url" I intend to either report the url in a definitive way or leave it blank meaning "UA hasn't implemented it"/"We don't know the value". Since
    we expect that we cannot report the `initaitor_url` for all resources anyway, the goal is to provide useful information as much as possible. The provided `initiator_url` is deemed to be reliable and will be used without further investigation.

    This is very different from dev tools, where they always use "fallback" if that's possible. Because for dev tools it's always better to point to somewhere so the developers can start investigating than to point to nothing.

    File third_party/blink/renderer/core/loader/initiator_helper.h
    Line 29, Patchset 8: DCHECK(IsMainThread());
    Scott Haseley . resolved

    nit: Can we use `CHECK` here and below (current style guidance is to prefer CHECK, unless justified: https://source.chromium.org/chromium/chromium/src/+/main:styleguide/c++/checks.md)?

    Guohui Deng

    Done

    Line 24, Patchset 8: // JavaScript is rurrently running for "initiator" purpose as in 2025.
    Scott Haseley . resolved
    ```suggestion
    // JavaScript is rurrently running for "initiator".
    ```

    (redundant given lead of paragraph)

    Also, maybe move this down to where the call is being made (above line 31), since it's an implementation detail (vs. a description of the method).

    Michal Mocny

    +1 to remove redundancy and to move comment down.

    I suggest something as simple as:

    "We are assuming that |isolate->InContext()| indicates that JavaScript is running, though this isn't guaranteed. There is no v8 API that is truly definitive for this. This matches existing |InspectorNetworkAgent| usage."

    Guohui Deng

    Done

    Line 20, Patchset 8: // As in 2025, there is no V8 API that definitively tells if JavaScript
    Scott Haseley . unresolved
    ```suggestion

    // As of 2025, there is no V8 API that definitively tells if JavaScript
    ```
    Guohui Deng

    I took Michal's advice and changed the comment accordingly. I think his version is more concise.

    Line 16, Patchset 8:class InitiatorHelper final {
    Michal Mocny . resolved

    Nit: should this be ResourceInitiatorHelper? Will it expand beyond?

    Guohui Deng

    Done

    File third_party/blink/renderer/core/scheduler/task_attribution_info_impl.h
    Line 27, Patchset 8: ResourceTimingContext*);
    Michal Mocny . resolved

    Scott: Should we start calling these "AsyncVariable" or at least "ContextValue" or something?

    Scott Haseley

    Probably. I think I suggested `ResourceTimingContext` to match SNC. I want to think about if we should have an `AsyncVariable` base class and generalize this (leaning towards yes, but as a follow-up). I'm thinking `AsyncVariable` + a slot in an array (vs. a map, since we have so few) might be better than leaking types here. It would make `Fork()` more scalable too. I'm okay with this as-is or changing to `ResourceTimingAsyncVariable`.

    Guohui Deng

    That makes sense. I prefer to leave this as it is in this CL as it's already a very large one and Scott is O.K. with either.

    I will be very happy to make improvements in a separate follow-up CL.

    (Regarding of the `Fork()...`, I would like to continue the discussion at the
    web_scheduling_task_state.cc)

    File third_party/blink/renderer/core/scheduler/task_attribution_task_state.h
    Line 67, Patchset 8: // Fork to a new copy, overriding with specified TaskAttributionID and
    Scott Haseley . resolved

    ultra nit (same below): s/TaskAttributionID/TaskAttributionId (match case of type)

    Guohui Deng

    Done

    File third_party/blink/renderer/core/scheduler/task_attribution_util.h
    Line 60, Patchset 1: // `tracker` is null if `context` is not a Window or if
    Scott Haseley . resolved

    Is this a problem for resource timing? PerformanceResourceTiming is available on workers.

    Guohui Deng

    I removed the comments. FYI at this CL we still not tracking the resource `initiator_url` in worker. But I plan to support that.

    Scott Haseley

    Task Attribution isn't available on Workers either, so we'll have to think that through. For the web scheduling APIs, I just use TaskAttributionTaskState::Get/SetCurrent() directly, but we can't do that elsewhere.

    Guohui Deng

    Thanks! I didn't know that. There are a few things for `initiator_url` that are of higher priority before I get to the `resource timing` on worker. Would like to consult with you at your convenience later to sort this out.

    I keep this unsolved for visibility.

    Scott Haseley

    ACK.

    Guohui Deng

    Acknowledged

    File third_party/blink/renderer/core/scheduler/web_scheduling_task_state.cc
    Line 39, Patchset 6: scheduler::TaskAttributionInfo* current_task_attribution_info =
    Scott Haseley . unresolved

    nit/optional: You could also delegate to TaskAttributionImpl::ForkAndSetVariable here, but I'm not sure it's much cleaner since you'd still need to create the TaskAttributionInfoImpl in that case.

    Guohui Deng

    Yes I think delegating to `TaskAttributionImpl::ForkAndSetVariable` is very clear: logically it is a `TaskAttributionImpl` being forked. The reason why I didn't do that yet is that the `ForkAndSetVariable` is not exposed via `TaskAttributionInfo` interface. So I have to "cast" to `TaskAttributionImpl`. (Although the infrastructure for the cast is in place)

    Scott Haseley

    Yeah you'd have to cast first. The advantage of calling fork explicitly is the implementation is in place, but I'm okay with either. If we add more task attribution variables, this will need to change to something more scalable anyway.

    Guohui Deng

    As I commented in a different file, I would like to make the improvements in a follow-up CL.

    I noticed that to delegate to TaskAttributionInfoImpl::ForkAndSetVariable(), there are 3 steps:

    1) GetTaskAttributionInfo() to get member TaskAttributionInfoImpl;
    2) Call Fork() on TaskAttributionInfoImpl;
    3) Make a new WebSchedulingTaskState that wraps the result from previous step

    Two casts are needed. The second one is from `TaskAttributionTaskState`(from `Fork`) to `TaskAttributionInfo`. Either new casting infrastructure needs to be added, or we make a `Fork` function that returns `TaskAttributionInfoImpl` type. I am not sure which one is preferable, or let's please continue the discussion offline?

    Cheers,

    File third_party/blink/renderer/core/script/pending_script.cc
    Line 181, Patchset 8: {
    Michal Mocny . resolved

    Nit: this scope spans to the end of the function-- could it be removed? (just leave unnested)

    If ever someone added any followup code after `ExecuteScriptBlockInternal` would it be important that the Scope be closed?

    Guohui Deng

    That scope is indeed superfluous. I removed it.

    File third_party/blink/web_tests/external/wpt/resource-timing/tentative/initiator-url/event-handler.html
    Line 13, Patchset 8: the initiator_url points to script that setups the event handler.
    Scott Haseley . resolved
    ```suggestion
    the initiator_url points to script that sets up the event handler.
    ```
    Guohui Deng

    Done

    File third_party/blink/web_tests/external/wpt/resource-timing/tentative/initiator-url/external-script.html
    Line 14, Patchset 8: and verifies that `iniatitor_url`s in ResourceTiming are expected.
    Scott Haseley . resolved

    nit/suggestion (here and other tests):

    ```suggestion
    and verifies that `iniatitor_url`s in ResourceTiming entries are as expected.
    ```
    Guohui Deng

    Done

    File third_party/blink/web_tests/external/wpt/resource-timing/tentative/initiator-url/inline-script.html
    Line 11, Patchset 8: <p> This test verifies that, for an iframe loaded by script,

    the initiatorUrl is properly reported.
    </p>
    Scott Haseley . unresolved

    This should work for same-frame postMessage (maybe consider adding a test?), but I'm not sure if task attribution will ever support cross-frame propagation. Adding the test with the ideal state SGTM, but we should probably (separately) discuss what should happen for this.

    Guohui Deng

    There are separate tests for postMessage (currently failing) and I would add more separate tests for that if needed. Unfortunately, `postMessage` is not supported yet at this CL.

    I modified the comment here because it wasn't accurate.

    File third_party/blink/web_tests/external/wpt/resource-timing/tentative/initiator-url/post-task.html
    Line 29, Patchset 8: " initiatorUlr from postTask()", resource + " timeout");
    Scott Haseley . resolved

    typo?

    ```suggestion
    " initiatorUrl from postTask()", resource + " timeout");
    ```
    Guohui Deng

    Done

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Michal Mocny
    • Scott Haseley
    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: I125e62d488eec5a85f8afa6cd61c399183c56d86
    Gerrit-Change-Number: 6960132
    Gerrit-PatchSet: 11
    Gerrit-Owner: Guohui Deng <guohu...@microsoft.com>
    Gerrit-Reviewer: Guohui Deng <guohu...@microsoft.com>
    Gerrit-Reviewer: Michal Mocny <mmo...@chromium.org>
    Gerrit-Reviewer: Scott Haseley <shas...@chromium.org>
    Gerrit-CC: Menard, Alexis <alexis...@intel.com>
    Gerrit-CC: Nate Chapin <jap...@chromium.org>
    Gerrit-CC: Olga Gerchikov <gerc...@microsoft.com>
    Gerrit-Attention: Scott Haseley <shas...@chromium.org>
    Gerrit-Attention: Michal Mocny <mmo...@chromium.org>
    Gerrit-Comment-Date: Fri, 12 Dec 2025 21:40:27 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Guohui Deng <guohu...@microsoft.com>
    Comment-In-Reply-To: Scott Haseley <shas...@chromium.org>
    Comment-In-Reply-To: Michal Mocny <mmo...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Scott Haseley (Gerrit)

    unread,
    Dec 12, 2025, 5:31:59 PM (4 days ago) Dec 12
    to Guohui Deng, Michal Mocny, Chromium LUCI CQ, Menard, Alexis, chromium...@chromium.org, Olga Gerchikov, Nate Chapin, blink-revie...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, chikamu...@chromium.org, core-timi...@chromium.org, ddrone...@google.com, gavinp...@chromium.org, kinuko...@chromium.org, loading...@chromium.org, scheduler-...@chromium.org, speed-metrics...@chromium.org, web-schedulin...@chromium.org
    Attention needed from Guohui Deng and Michal Mocny

    Scott Haseley added 7 comments

    Patchset-level comments
    File-level comment, Patchset 11 (Latest):
    Scott Haseley . resolved

    Thanks for all the cleanup, a few more minor things.

    File third_party/blink/renderer/core/loader/frame_fetch_context.cc
    Line 495, Patchset 11 (Latest): // The initiator is a JS.
    Scott Haseley . unresolved

    nit: "a JS" is a little hard to parse -- does this mean a <script> or is it any JavaScript? I think it means "the initiator is the currently executing JavaScript." Maybe you can elaborate a bit.

    File third_party/blink/renderer/core/loader/initiator_helper.h
    Line 20, Patchset 8: // As in 2025, there is no V8 API that definitively tells if JavaScript
    Scott Haseley . resolved
    ```suggestion
    // As of 2025, there is no V8 API that definitively tells if JavaScript
    ```
    Guohui Deng

    I took Michal's advice and changed the comment accordingly. I think his version is more concise.

    Scott Haseley

    Acknowledged

    File third_party/blink/renderer/core/loader/resource_initiator_helper.h
    Line 33, Patchset 11 (Latest): static KURL GetScriptInitiatorUrlFromValidIsolate(v8::Isolate* isolate) {
    Scott Haseley . unresolved

    nit: maybe just make this take v8::Isolate& instead of adding the suffix (i.e. remove `FromValidIsolate`? It's not too common to add a suffix like this, but rather either enforce it via a ref or document that it can't be null, which this does via CHECK.

    File third_party/blink/renderer/core/scheduler/web_scheduling_task_state.cc
    Line 39, Patchset 6: scheduler::TaskAttributionInfo* current_task_attribution_info =
    Scott Haseley . resolved

    nit/optional: You could also delegate to TaskAttributionImpl::ForkAndSetVariable here, but I'm not sure it's much cleaner since you'd still need to create the TaskAttributionInfoImpl in that case.

    Guohui Deng

    Yes I think delegating to `TaskAttributionImpl::ForkAndSetVariable` is very clear: logically it is a `TaskAttributionImpl` being forked. The reason why I didn't do that yet is that the `ForkAndSetVariable` is not exposed via `TaskAttributionInfo` interface. So I have to "cast" to `TaskAttributionImpl`. (Although the infrastructure for the cast is in place)

    Scott Haseley

    Yeah you'd have to cast first. The advantage of calling fork explicitly is the implementation is in place, but I'm okay with either. If we add more task attribution variables, this will need to change to something more scalable anyway.

    Guohui Deng

    As I commented in a different file, I would like to make the improvements in a follow-up CL.

    I noticed that to delegate to TaskAttributionInfoImpl::ForkAndSetVariable(), there are 3 steps:

    1) GetTaskAttributionInfo() to get member TaskAttributionInfoImpl;
    2) Call Fork() on TaskAttributionInfoImpl;
    3) Make a new WebSchedulingTaskState that wraps the result from previous step

    Two casts are needed. The second one is from `TaskAttributionTaskState`(from `Fork`) to `TaskAttributionInfo`. Either new casting infrastructure needs to be added, or we make a `Fork` function that returns `TaskAttributionInfoImpl` type. I am not sure which one is preferable, or let's please continue the discussion offline?

    Cheers,

    Scott Haseley

    Acknowledged

    File third_party/blink/renderer/core/script/pending_script.cc
    Michal Mocny . resolved

    Nit: this scope spans to the end of the function-- could it be removed? (just leave unnested)

    If ever someone added any followup code after `ExecuteScriptBlockInternal` would it be important that the Scope be closed?

    Guohui Deng

    That scope is indeed superfluous. I removed it.

    Scott Haseley

    Thanks, that improves the diffs as well, which is nice.

    Line 208, Patchset 11 (Latest): // ExecuteScriptBlockInternal() is split just in order to prevent
    Scott Haseley . unresolved

    nit: can you change this comment back to avoid git blame churn?

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Guohui Deng
    • Michal Mocny
    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: I125e62d488eec5a85f8afa6cd61c399183c56d86
    Gerrit-Change-Number: 6960132
    Gerrit-PatchSet: 11
    Gerrit-Owner: Guohui Deng <guohu...@microsoft.com>
    Gerrit-Reviewer: Guohui Deng <guohu...@microsoft.com>
    Gerrit-Reviewer: Michal Mocny <mmo...@chromium.org>
    Gerrit-Reviewer: Scott Haseley <shas...@chromium.org>
    Gerrit-CC: Menard, Alexis <alexis...@intel.com>
    Gerrit-CC: Nate Chapin <jap...@chromium.org>
    Gerrit-CC: Olga Gerchikov <gerc...@microsoft.com>
    Gerrit-Attention: Guohui Deng <guohu...@microsoft.com>
    Gerrit-Attention: Michal Mocny <mmo...@chromium.org>
    Gerrit-Comment-Date: Fri, 12 Dec 2025 22:31:49 +0000
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Guohui Deng (Gerrit)

    unread,
    12:00 PM (10 hours ago) 12:00 PM
    to Michal Mocny, Scott Haseley, Chromium LUCI CQ, Menard, Alexis, chromium...@chromium.org, Olga Gerchikov, Nate Chapin, blink-revie...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, chikamu...@chromium.org, core-timi...@chromium.org, ddrone...@google.com, gavinp...@chromium.org, kinuko...@chromium.org, loading...@chromium.org, scheduler-...@chromium.org, speed-metrics...@chromium.org, web-schedulin...@chromium.org
    Attention needed from Michal Mocny and Scott Haseley

    Guohui Deng added 3 comments

    File third_party/blink/renderer/core/loader/frame_fetch_context.cc
    Line 495, Patchset 11: // The initiator is a JS.
    Scott Haseley . unresolved

    nit: "a JS" is a little hard to parse -- does this mean a <script> or is it any JavaScript? I think it means "the initiator is the currently executing JavaScript." Maybe you can elaborate a bit.

    Guohui Deng

    Done

    File third_party/blink/renderer/core/loader/resource_initiator_helper.h
    Line 33, Patchset 11: static KURL GetScriptInitiatorUrlFromValidIsolate(v8::Isolate* isolate) {
    Scott Haseley . resolved

    nit: maybe just make this take v8::Isolate& instead of adding the suffix (i.e. remove `FromValidIsolate`? It's not too common to add a suffix like this, but rather either enforce it via a ref or document that it can't be null, which this does via CHECK.

    Guohui Deng

    Done. Good idea and thanks.

    File third_party/blink/renderer/core/script/pending_script.cc
    Line 208, Patchset 11: // ExecuteScriptBlockInternal() is split just in order to prevent
    Scott Haseley . resolved

    nit: can you change this comment back to avoid git blame churn?

    Guohui Deng

    Done

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Michal Mocny
    • Scott Haseley
    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: I125e62d488eec5a85f8afa6cd61c399183c56d86
    Gerrit-Change-Number: 6960132
    Gerrit-PatchSet: 14
    Gerrit-Owner: Guohui Deng <guohu...@microsoft.com>
    Gerrit-Reviewer: Guohui Deng <guohu...@microsoft.com>
    Gerrit-Reviewer: Michal Mocny <mmo...@chromium.org>
    Gerrit-Reviewer: Scott Haseley <shas...@chromium.org>
    Gerrit-CC: Menard, Alexis <alexis...@intel.com>
    Gerrit-CC: Nate Chapin <jap...@chromium.org>
    Gerrit-CC: Olga Gerchikov <gerc...@microsoft.com>
    Gerrit-Attention: Scott Haseley <shas...@chromium.org>
    Gerrit-Attention: Michal Mocny <mmo...@chromium.org>
    Gerrit-Comment-Date: Tue, 16 Dec 2025 17:00:25 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Scott Haseley <shas...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy
    Reply all
    Reply to author
    Forward
    0 new messages