DevTools: use local root's devtools frame token for NavigationURLLoader. [chromium/src : main]

0 views
Skip to first unread message

Danil Somsikov (Gerrit)

unread,
4:00 AM (10 hours ago) 4:00 AM
to Alex Rudenko, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, navigation...@chromium.org, creis...@chromium.org, alexmo...@chromium.org, devtools-re...@chromium.org, blink-...@chromium.org
Attention needed from Alex Rudenko

Danil Somsikov voted Code-Review+1

Code-Review+1
Open in Gerrit

Related details

Attention is currently required from:
  • Alex Rudenko
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement 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: Ie17d804641b3cd5e74271de924c593ec820152c5
Gerrit-Change-Number: 7800333
Gerrit-PatchSet: 8
Gerrit-Owner: Alex Rudenko <alexr...@chromium.org>
Gerrit-Reviewer: Alex Rudenko <alexr...@chromium.org>
Gerrit-Reviewer: Danil Somsikov <d...@chromium.org>
Gerrit-Attention: Alex Rudenko <alexr...@chromium.org>
Gerrit-Comment-Date: Tue, 05 May 2026 08:00:32 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Danil Somsikov (Gerrit)

unread,
4:00 AM (10 hours ago) 4:00 AM
to Alex Rudenko, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, navigation...@chromium.org, creis...@chromium.org, alexmo...@chromium.org, devtools-re...@chromium.org, blink-...@chromium.org
Attention needed from Alex Rudenko

Danil Somsikov added 1 comment

Patchset-level comments
File-level comment, Patchset 8 (Latest):
Danil Somsikov . resolved

Nice!

Open in Gerrit

Related details

Attention is currently required from:
  • Alex Rudenko
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement 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: Ie17d804641b3cd5e74271de924c593ec820152c5
Gerrit-Change-Number: 7800333
Gerrit-PatchSet: 8
Gerrit-Owner: Alex Rudenko <alexr...@chromium.org>
Gerrit-Reviewer: Alex Rudenko <alexr...@chromium.org>
Gerrit-Reviewer: Danil Somsikov <d...@chromium.org>
Gerrit-Attention: Alex Rudenko <alexr...@chromium.org>
Gerrit-Comment-Date: Tue, 05 May 2026 08:00:40 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Charlie Reis (Gerrit)

unread,
12:54 PM (1 hour ago) 12:54 PM
to Alex Rudenko, Danil Somsikov, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, navigation...@chromium.org, creis...@chromium.org, alexmo...@chromium.org, devtools-re...@chromium.org, blink-...@chromium.org
Attention needed from Alex Rudenko

Charlie Reis added 2 comments

Patchset-level comments
Charlie Reis . resolved

Thanks-- some questions below to see if we can make this more obviously a correct fix, with fewer maintenance risks going forward.

File content/browser/renderer_host/navigation_request.cc
Line 5768, Patchset 8 (Latest): local_root_rfh->devtools_frame_token(),
Charlie Reis . unresolved

At first glance, this looks like a regression to me, but maybe that's from a lack of documentation of what this is for.

In general, it's better to use frame-specific info, since each frame under a local root may have a separate SiteInstance, origin, etc, even if they share the same SiteInstanceGroup and process. In this case, the dev_tools_frame_token is explicitly frame-specific in the name, making this line look wrong. That may not actually be the case for how it's used, but it's not clear.

I'm guessing that DevTools only creates throttling profiles for local roots, and that frames beneath them don't have a throttling profile? If that's the case, we should be more explicit in places like [here](https://source.chromium.org/chromium/chromium/src/+/main:content/browser/renderer_host/navigation_request_info.h;drc=fc44a91d176d55c9c43a89bd7eefce89d96d0472;l=46) and [here](https://source.chromium.org/chromium/chromium/src/+/main:content/browser/renderer_host/navigation_request_info.h;drc=fc44a91d176d55c9c43a89bd7eefce89d96d0472;l=120) that a local root's token is required.

I almost wonder if it would be better to use the actual frame's token and have an ability to look up the throttling profile via that frame's local root when the time comes? Or be more explicit here about passing in something about the throttling profile and not a "frame" token for a different frame, so that other code doesn't mistakenly use the token thinking it's for the current frame rather than the local frame root?

Open in Gerrit

Related details

Attention is currently required from:
  • Alex Rudenko
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement 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: Ie17d804641b3cd5e74271de924c593ec820152c5
    Gerrit-Change-Number: 7800333
    Gerrit-PatchSet: 8
    Gerrit-Owner: Alex Rudenko <alexr...@chromium.org>
    Gerrit-Reviewer: Alex Rudenko <alexr...@chromium.org>
    Gerrit-Reviewer: Charlie Reis <cr...@chromium.org>
    Gerrit-Reviewer: Danil Somsikov <d...@chromium.org>
    Gerrit-Attention: Alex Rudenko <alexr...@chromium.org>
    Gerrit-Comment-Date: Tue, 05 May 2026 16:54:02 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Alex Rudenko (Gerrit)

    unread,
    1:15 PM (1 hour ago) 1:15 PM
    to Charlie Reis, Danil Somsikov, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, navigation...@chromium.org, creis...@chromium.org, alexmo...@chromium.org, devtools-re...@chromium.org, blink-...@chromium.org
    Attention needed from Charlie Reis

    Alex Rudenko added 1 comment

    File content/browser/renderer_host/navigation_request.cc
    Line 5768, Patchset 8 (Latest): local_root_rfh->devtools_frame_token(),
    Charlie Reis . unresolved

    At first glance, this looks like a regression to me, but maybe that's from a lack of documentation of what this is for.

    In general, it's better to use frame-specific info, since each frame under a local root may have a separate SiteInstance, origin, etc, even if they share the same SiteInstanceGroup and process. In this case, the dev_tools_frame_token is explicitly frame-specific in the name, making this line look wrong. That may not actually be the case for how it's used, but it's not clear.

    I'm guessing that DevTools only creates throttling profiles for local roots, and that frames beneath them don't have a throttling profile? If that's the case, we should be more explicit in places like [here](https://source.chromium.org/chromium/chromium/src/+/main:content/browser/renderer_host/navigation_request_info.h;drc=fc44a91d176d55c9c43a89bd7eefce89d96d0472;l=46) and [here](https://source.chromium.org/chromium/chromium/src/+/main:content/browser/renderer_host/navigation_request_info.h;drc=fc44a91d176d55c9c43a89bd7eefce89d96d0472;l=120) that a local root's token is required.

    I almost wonder if it would be better to use the actual frame's token and have an ability to look up the throttling profile via that frame's local root when the time comes? Or be more explicit here about passing in something about the throttling profile and not a "frame" token for a different frame, so that other code doesn't mistakenly use the token thinking it's for the current frame rather than the local frame root?

    Alex Rudenko

    DevTools is currently fairly inconsistent in how it creates these tokens. For instance, for subresource requests it is using correctly the local root token [1][2] but for workers the wrong token is set similar to navigation requests for iframes fixed in this CL. The throttling configuration in Chrome DevTools Protocol applies per target which includes the main frame and local frames. Out-of-process frames have dedicated targets. That's why this change aims to figure out where the CDP target boundary is by using is_local_root to match the behavior for subresource requests in the renderer which is the expected behavior from the client perspective.

    I almost wonder if it would be better to use the actual frame's token and have an ability to look up the throttling profile via that frame's local root when the time comes?

    I think the limitation here is that the throttling profiles are used in the network service that does not have the information about the free tree making it impossible to determine if two frames belong to the same CDP target.

    Or be more explicit here about passing in something about the throttling profile and not a "frame" token for a different frame, so that other code doesn't mistakenly use the token thinking it's for the current frame rather than the local frame root?

    Attention is currently required from:
    • Charlie Reis
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement 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: Ie17d804641b3cd5e74271de924c593ec820152c5
    Gerrit-Change-Number: 7800333
    Gerrit-PatchSet: 8
    Gerrit-Owner: Alex Rudenko <alexr...@chromium.org>
    Gerrit-Reviewer: Alex Rudenko <alexr...@chromium.org>
    Gerrit-Reviewer: Charlie Reis <cr...@chromium.org>
    Gerrit-Reviewer: Danil Somsikov <d...@chromium.org>
    Gerrit-Attention: Charlie Reis <cr...@chromium.org>
    Gerrit-Comment-Date: Tue, 05 May 2026 17:15:07 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Charlie Reis <cr...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy
    Reply all
    Reply to author
    Forward
    0 new messages