[Connection-Allowlist] Non-optional network_restrictions_id [chromium/src : main]

0 views
Skip to first unread message

Shivani Sharma (Gerrit)

unread,
Jun 5, 2026, 3:01:17 PM (6 days ago) Jun 5
to Xiaochen Zhou, Andrew Verge, Wang, Wei4, Kenneth R Christiansen, Mandy, Arnaud, Mangesh Ghiware, Heron Yang, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, devtools...@chromium.org, Hiroki Nakagawa, prerendering-reviews, net-r...@chromium.org, alexmo...@chromium.org, blink-work...@chromium.org, creis...@chromium.org, derinel+wat...@google.com, fenced-fra...@chromium.org, gavin...@chromium.org, horo+...@chromium.org, ipc-securi...@chromium.org, kinuko+ser...@chromium.org, kinuko...@chromium.org, loading...@chromium.org, navigation...@chromium.org, network-ser...@chromium.org, servicewor...@chromium.org, shimazu+se...@chromium.org, tburkar...@chromium.org, webauthn...@chromium.org
Attention needed from Andrew Verge and Xiaochen Zhou

Shivani Sharma added 1 comment

Patchset-level comments
File-level comment, Patchset 18 (Latest):
Shivani Sharma . resolved

PTAL at the overall change, thanks!

Open in Gerrit

Related details

Attention is currently required from:
  • Andrew Verge
  • Xiaochen Zhou
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Iddbff4f46eb38172d345173502172b0349f252e1
Gerrit-Change-Number: 7899247
Gerrit-PatchSet: 18
Gerrit-Owner: Shivani Sharma <shiva...@chromium.org>
Gerrit-Reviewer: Andrew Verge <ave...@chromium.org>
Gerrit-Reviewer: Xiaochen Zhou <xiaoc...@chromium.org>
Gerrit-CC: Heron Yang <hero...@google.com>
Gerrit-CC: Hiroki Nakagawa <nhi...@chromium.org>
Gerrit-CC: Kenneth R Christiansen <kenneth.r.c...@intel.com>
Gerrit-CC: Mandy, Arnaud <arnaud...@intel.com>
Gerrit-CC: Mangesh Ghiware <mghi...@google.com>
Gerrit-CC: Wang, Wei4 <wei4...@intel.com>
Gerrit-CC: prerendering-reviews <prerenderi...@chromium.org>
Gerrit-Attention: Andrew Verge <ave...@chromium.org>
Gerrit-Attention: Xiaochen Zhou <xiaoc...@chromium.org>
Gerrit-Comment-Date: Fri, 05 Jun 2026 19:01:08 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Andrew Verge (Gerrit)

unread,
Jun 5, 2026, 3:40:54 PM (6 days ago) Jun 5
to Shivani Sharma, Xiaochen Zhou, Wang, Wei4, Kenneth R Christiansen, Mandy, Arnaud, Mangesh Ghiware, Heron Yang, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, devtools...@chromium.org, Hiroki Nakagawa, prerendering-reviews, net-r...@chromium.org, alexmo...@chromium.org, blink-work...@chromium.org, creis...@chromium.org, derinel+wat...@google.com, fenced-fra...@chromium.org, gavin...@chromium.org, horo+...@chromium.org, ipc-securi...@chromium.org, kinuko+ser...@chromium.org, kinuko...@chromium.org, loading...@chromium.org, navigation...@chromium.org, network-ser...@chromium.org, servicewor...@chromium.org, shimazu+se...@chromium.org, tburkar...@chromium.org, webauthn...@chromium.org
Attention needed from Shivani Sharma and Xiaochen Zhou

Andrew Verge added 7 comments

File content/browser/devtools/protocol/devtools_network_resource_loader_browsertest.cc
Line 83, Patchset 18 (Latest): /*network_restrictions_id=*/base::UnguessableToken(),
Andrew Verge . unresolved

Should this be GetTestNetworkRestrictionsId?

File content/browser/renderer_host/navigation_request.cc
Line 1827, Patchset 18 (Latest): network_restrictions_id_(base::UnguessableToken()) {
TRACE_EVENT("navigation", "NavigationRequest::NavigationRequest",
Andrew Verge . unresolved

Please fix this WARNING reported by ClangTidy: check: readability-redundant-member-init

initializer for member 'network_restri...

check: readability-redundant-member-init

initializer for member 'network_restrictions_id_' is redundant (https://clang.llvm.org/extra/clang-tidy/checks/readability/redundant-member-init.html)

(Note: You can add `Skip-Clang-Tidy-Checks: readability-redundant-member-init` footer to the CL description to skip the check)

(Lint observed on `linux-clang-tidy-rel`, but not on `android-clang-tidy-rel` or `mac-clang-tidy-rel`)

File content/browser/renderer_host/network_restrictions_navigation_throttle.cc
Line 26, Patchset 18 (Latest): if (navigation_request->IsSameDocument()) {
Andrew Verge . unresolved

In this case, should we set the ID on the request to be the ID of the current document? If we're trying to make the ID non-optional, I do think it's beneficial to have it populated with the "right" value for consistency, in places where we can predict what that value is.

File content/browser/service_worker/service_worker_host.cc
Line 99, Patchset 18 (Latest): /*network_restrictions_id=*/network::GetTODONetworkRestrictionsId()),
Andrew Verge . resolved

Note that here and below, the current Service Worker CL I have up for review will implement these.

File services/network/public/cpp/constants.h
Line 27, Patchset 18 (Latest):// required by the interface but has not been implemented yet.
Andrew Verge . unresolved

Maybe add a comment here that we'll clean up this function eventually, unlike the other two.

File services/network/public/mojom/network_context.mojom
Line 1483, Patchset 18 (Latest): mojo_base.mojom.UnguessableToken network_restrictions_id);
Andrew Verge . resolved

Not blocking for this CL, but now that this is not optional, we should consider moving this higher up in the arguments list given its importance (I got this feedback on one of my Websocket/Webtransport CLs this week.)

File services/network/websocket_factory_unittest.cc
Line 243, Patchset 18 (Latest):TEST_F(WebSocketFactoryTest, CreateWebSocketBypassWithNoOpRestrictionsID) {
Andrew Verge . unresolved

Do we need these tests? Seems a little out of place to test the NoOp ID just in this one spot.

Open in Gerrit

Related details

Attention is currently required from:
  • Shivani Sharma
  • Xiaochen Zhou
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: Iddbff4f46eb38172d345173502172b0349f252e1
    Gerrit-Change-Number: 7899247
    Gerrit-PatchSet: 18
    Gerrit-Owner: Shivani Sharma <shiva...@chromium.org>
    Gerrit-Reviewer: Andrew Verge <ave...@chromium.org>
    Gerrit-Reviewer: Xiaochen Zhou <xiaoc...@chromium.org>
    Gerrit-CC: Heron Yang <hero...@google.com>
    Gerrit-CC: Hiroki Nakagawa <nhi...@chromium.org>
    Gerrit-CC: Kenneth R Christiansen <kenneth.r.c...@intel.com>
    Gerrit-CC: Mandy, Arnaud <arnaud...@intel.com>
    Gerrit-CC: Mangesh Ghiware <mghi...@google.com>
    Gerrit-CC: Wang, Wei4 <wei4...@intel.com>
    Gerrit-CC: prerendering-reviews <prerenderi...@chromium.org>
    Gerrit-Attention: Shivani Sharma <shiva...@chromium.org>
    Gerrit-Attention: Xiaochen Zhou <xiaoc...@chromium.org>
    Gerrit-Comment-Date: Fri, 05 Jun 2026 19:40:46 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Xiaochen Zhou (Gerrit)

    unread,
    Jun 5, 2026, 4:35:09 PM (6 days ago) Jun 5
    to Shivani Sharma, Andrew Verge, Wang, Wei4, Kenneth R Christiansen, Mandy, Arnaud, Mangesh Ghiware, Heron Yang, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, devtools...@chromium.org, Hiroki Nakagawa, prerendering-reviews, net-r...@chromium.org, alexmo...@chromium.org, blink-work...@chromium.org, creis...@chromium.org, derinel+wat...@google.com, fenced-fra...@chromium.org, gavin...@chromium.org, horo+...@chromium.org, ipc-securi...@chromium.org, kinuko+ser...@chromium.org, kinuko...@chromium.org, loading...@chromium.org, navigation...@chromium.org, network-ser...@chromium.org, servicewor...@chromium.org, shimazu+se...@chromium.org, tburkar...@chromium.org, webauthn...@chromium.org
    Attention needed from Shivani Sharma

    Xiaochen Zhou added 2 comments

    File services/network/network_context.cc
    Line 2083, Patchset 18 (Latest): if (!IsNetworkForNetworkRestrictionsIdAndUrlAllowed(network_restrictions_id,
    Xiaochen Zhou . resolved

    Non-blocking comment: In IsNetworkForNetworkRestrictionsIdAndUrlAllowed, perhaps consider early return if the the id == GetNoOpNetworkRestrictionsId(), so we can avoid a map lookup.

    File services/network/public/cpp/constants.h
    Line 24, Patchset 18 (Latest):const base::UnguessableToken& GetNoOpNetworkRestrictionsId();
    Xiaochen Zhou . unresolved

    We would like to require developers to choose one of the followings for network restriction id param:

    • The context's ID.
    • Or use one of the 3 functions here.

    But passing a `base::UnguessableToken::Null()` or `base::UnguessableToken{}` still compiles. Developers not aware of CA perhaps think this is reasonable.

    Perhaps we can have a wrapper class around base::UnguessableToken that disables the default constructor (marking it private). And it offers factory methods like these 3 and force developer to choose one.

    A lot more work is required though for adding the wrapper class.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Shivani Sharma
    Gerrit-Comment-Date: Fri, 05 Jun 2026 20:35:02 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Shivani Sharma (Gerrit)

    unread,
    Jun 5, 2026, 9:06:55 PM (5 days ago) Jun 5
    to Xiaochen Zhou, Andrew Verge, Wang, Wei4, Kenneth R Christiansen, Mandy, Arnaud, Mangesh Ghiware, Heron Yang, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, devtools...@chromium.org, Hiroki Nakagawa, prerendering-reviews, net-r...@chromium.org, alexmo...@chromium.org, blink-work...@chromium.org, creis...@chromium.org, derinel+wat...@google.com, fenced-fra...@chromium.org, gavin...@chromium.org, horo+...@chromium.org, ipc-securi...@chromium.org, kinuko+ser...@chromium.org, kinuko...@chromium.org, loading...@chromium.org, navigation...@chromium.org, network-ser...@chromium.org, servicewor...@chromium.org, shimazu+se...@chromium.org, tburkar...@chromium.org, webauthn...@chromium.org
    Attention needed from Andrew Verge and Xiaochen Zhou

    Shivani Sharma added 9 comments

    File content/browser/devtools/protocol/devtools_network_resource_loader_browsertest.cc
    Line 83, Patchset 18: /*network_restrictions_id=*/base::UnguessableToken(),
    Andrew Verge . resolved

    Should this be GetTestNetworkRestrictionsId?

    Shivani Sharma

    Done

    File content/browser/renderer_host/navigation_request.cc
    Line 1827, Patchset 18: network_restrictions_id_(base::UnguessableToken()) {

    TRACE_EVENT("navigation", "NavigationRequest::NavigationRequest",
    Andrew Verge . resolved

    Please fix this WARNING reported by ClangTidy: check: readability-redundant-member-init

    initializer for member 'network_restri...

    check: readability-redundant-member-init

    initializer for member 'network_restrictions_id_' is redundant (https://clang.llvm.org/extra/clang-tidy/checks/readability/redundant-member-init.html)

    (Note: You can add `Skip-Clang-Tidy-Checks: readability-redundant-member-init` footer to the CL description to skip the check)

    (Lint observed on `linux-clang-tidy-rel`, but not on `android-clang-tidy-rel` or `mac-clang-tidy-rel`)

    Shivani Sharma

    Done

    File content/browser/renderer_host/network_restrictions_navigation_throttle.cc
    Line 26, Patchset 18: if (navigation_request->IsSameDocument()) {
    Andrew Verge . resolved

    In this case, should we set the ID on the request to be the ID of the current document? If we're trying to make the ID non-optional, I do think it's beneficial to have it populated with the "right" value for consistency, in places where we can predict what that value is.

    Shivani Sharma

    Done

    File content/browser/service_worker/service_worker_host.cc
    Line 99, Patchset 18: /*network_restrictions_id=*/network::GetTODONetworkRestrictionsId()),
    Andrew Verge . resolved

    Note that here and below, the current Service Worker CL I have up for review will implement these.

    Shivani Sharma

    ack

    File services/network/network_context.cc
    Line 2083, Patchset 18: if (!IsNetworkForNetworkRestrictionsIdAndUrlAllowed(network_restrictions_id,
    Xiaochen Zhou . resolved

    Non-blocking comment: In IsNetworkForNetworkRestrictionsIdAndUrlAllowed, perhaps consider early return if the the id == GetNoOpNetworkRestrictionsId(), so we can avoid a map lookup.

    File services/network/public/cpp/constants.h
    Line 27, Patchset 18:// required by the interface but has not been implemented yet.
    Andrew Verge . resolved

    Maybe add a comment here that we'll clean up this function eventually, unlike the other two.

    Shivani Sharma

    Done

    Line 24, Patchset 18:const base::UnguessableToken& GetNoOpNetworkRestrictionsId();
    Xiaochen Zhou . resolved

    We would like to require developers to choose one of the followings for network restriction id param:

    • The context's ID.
    • Or use one of the 3 functions here.

    But passing a `base::UnguessableToken::Null()` or `base::UnguessableToken{}` still compiles. Developers not aware of CA perhaps think this is reasonable.

    Perhaps we can have a wrapper class around base::UnguessableToken that disables the default constructor (marking it private). And it offers factory methods like these 3 and force developer to choose one.

    A lot more work is required though for adding the wrapper class.

    Shivani Sharma

    Created 520464337 and added a TODO here. I think it will be a nice addition but ok to be unblocking for launch.

    File services/network/public/mojom/network_context.mojom
    Line 1483, Patchset 18: mojo_base.mojom.UnguessableToken network_restrictions_id);
    Andrew Verge . resolved

    Not blocking for this CL, but now that this is not optional, we should consider moving this higher up in the arguments list given its importance (I got this feedback on one of my Websocket/Webtransport CLs this week.)

    Shivani Sharma

    ack

    File services/network/websocket_factory_unittest.cc
    Line 243, Patchset 18:TEST_F(WebSocketFactoryTest, CreateWebSocketBypassWithNoOpRestrictionsID) {
    Andrew Verge . resolved

    Do we need these tests? Seems a little out of place to test the NoOp ID just in this one spot.

    Shivani Sharma

    Yeah I don't think these are really needed.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Andrew Verge
    • Xiaochen Zhou
    Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedReview-Enforcement
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: Iddbff4f46eb38172d345173502172b0349f252e1
      Gerrit-Change-Number: 7899247
      Gerrit-PatchSet: 19
      Gerrit-Owner: Shivani Sharma <shiva...@chromium.org>
      Gerrit-Reviewer: Andrew Verge <ave...@chromium.org>
      Gerrit-Reviewer: Xiaochen Zhou <xiaoc...@chromium.org>
      Gerrit-CC: Heron Yang <hero...@google.com>
      Gerrit-CC: Hiroki Nakagawa <nhi...@chromium.org>
      Gerrit-CC: Kenneth R Christiansen <kenneth.r.c...@intel.com>
      Gerrit-CC: Mandy, Arnaud <arnaud...@intel.com>
      Gerrit-CC: Mangesh Ghiware <mghi...@google.com>
      Gerrit-CC: Wang, Wei4 <wei4...@intel.com>
      Gerrit-CC: prerendering-reviews <prerenderi...@chromium.org>
      Gerrit-Attention: Andrew Verge <ave...@chromium.org>
      Gerrit-Attention: Xiaochen Zhou <xiaoc...@chromium.org>
      Gerrit-Comment-Date: Sat, 06 Jun 2026 01:06:45 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Andrew Verge <ave...@chromium.org>
      Comment-In-Reply-To: Xiaochen Zhou <xiaoc...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Xiaochen Zhou (Gerrit)

      unread,
      Jun 8, 2026, 9:04:30 AM (3 days ago) Jun 8
      to Shivani Sharma, Chromium LUCI CQ, Andrew Verge, Wang, Wei4, Kenneth R Christiansen, Mandy, Arnaud, Mangesh Ghiware, Heron Yang, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, devtools...@chromium.org, Hiroki Nakagawa, prerendering-reviews, net-r...@chromium.org, alexmo...@chromium.org, blink-work...@chromium.org, creis...@chromium.org, derinel+wat...@google.com, fenced-fra...@chromium.org, gavin...@chromium.org, horo+...@chromium.org, ipc-securi...@chromium.org, kinuko+ser...@chromium.org, kinuko...@chromium.org, loading...@chromium.org, navigation...@chromium.org, network-ser...@chromium.org, servicewor...@chromium.org, shimazu+se...@chromium.org, tburkar...@chromium.org, webauthn...@chromium.org
      Attention needed from Andrew Verge and Shivani Sharma

      Xiaochen Zhou voted Code-Review+1

      Code-Review+1
      Open in Gerrit

      Related details

      Attention is currently required from:
      • Andrew Verge
      • Shivani Sharma
      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: Iddbff4f46eb38172d345173502172b0349f252e1
        Gerrit-Change-Number: 7899247
        Gerrit-PatchSet: 20
        Gerrit-Owner: Shivani Sharma <shiva...@chromium.org>
        Gerrit-Reviewer: Andrew Verge <ave...@chromium.org>
        Gerrit-Reviewer: Shivani Sharma <shiva...@chromium.org>
        Gerrit-Reviewer: Xiaochen Zhou <xiaoc...@chromium.org>
        Gerrit-CC: Heron Yang <hero...@google.com>
        Gerrit-CC: Hiroki Nakagawa <nhi...@chromium.org>
        Gerrit-CC: Kenneth R Christiansen <kenneth.r.c...@intel.com>
        Gerrit-CC: Mandy, Arnaud <arnaud...@intel.com>
        Gerrit-CC: Mangesh Ghiware <mghi...@google.com>
        Gerrit-CC: Wang, Wei4 <wei4...@intel.com>
        Gerrit-CC: prerendering-reviews <prerenderi...@chromium.org>
        Gerrit-Attention: Shivani Sharma <shiva...@chromium.org>
        Gerrit-Attention: Andrew Verge <ave...@chromium.org>
        Gerrit-Comment-Date: Mon, 08 Jun 2026 13:04:16 +0000
        Gerrit-HasComments: No
        Gerrit-Has-Labels: Yes
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Andrew Verge (Gerrit)

        unread,
        Jun 8, 2026, 9:09:49 AM (3 days ago) Jun 8
        to Shivani Sharma, Xiaochen Zhou, Chromium LUCI CQ, Wang, Wei4, Kenneth R Christiansen, Mandy, Arnaud, Mangesh Ghiware, Heron Yang, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, devtools...@chromium.org, Hiroki Nakagawa, prerendering-reviews, net-r...@chromium.org, alexmo...@chromium.org, blink-work...@chromium.org, creis...@chromium.org, derinel+wat...@google.com, fenced-fra...@chromium.org, gavin...@chromium.org, horo+...@chromium.org, ipc-securi...@chromium.org, kinuko+ser...@chromium.org, kinuko...@chromium.org, loading...@chromium.org, navigation...@chromium.org, network-ser...@chromium.org, servicewor...@chromium.org, shimazu+se...@chromium.org, tburkar...@chromium.org, webauthn...@chromium.org
        Attention needed from Shivani Sharma

        Andrew Verge voted Code-Review+1

        Code-Review+1
        Open in Gerrit

        Related details

        Attention is currently required from:
        • Shivani Sharma
        Gerrit-Comment-Date: Mon, 08 Jun 2026 13:09:36 +0000
        Gerrit-HasComments: No
        Gerrit-Has-Labels: Yes
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Shivani Sharma (Gerrit)

        unread,
        Jun 8, 2026, 10:18:32 AM (3 days ago) Jun 8
        to Kenichi Ishibashi, Alex Moshchuk, Mike West, Noam Rosenthal, Andrew Verge, Xiaochen Zhou, Chromium LUCI CQ, Wang, Wei4, Kenneth R Christiansen, Mandy, Arnaud, Mangesh Ghiware, Heron Yang, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, devtools...@chromium.org, Hiroki Nakagawa, prerendering-reviews, net-r...@chromium.org, alexmo...@chromium.org, blink-work...@chromium.org, creis...@chromium.org, derinel+wat...@google.com, fenced-fra...@chromium.org, gavin...@chromium.org, horo+...@chromium.org, ipc-securi...@chromium.org, kinuko+ser...@chromium.org, kinuko...@chromium.org, loading...@chromium.org, navigation...@chromium.org, network-ser...@chromium.org, servicewor...@chromium.org, shimazu+se...@chromium.org, tburkar...@chromium.org, webauthn...@chromium.org
        Attention needed from Alex Moshchuk and Kenichi Ishibashi

        Shivani Sharma added 1 comment

        Patchset-level comments
        File-level comment, Patchset 21 (Latest):
        Shivani Sharma . resolved

        Thanks!

        bashi@: PTAL at services/network*, thanks!
        alexmos@: PTAL at content/browser*, thanks!

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Alex Moshchuk
        • Kenichi Ishibashi
        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: Iddbff4f46eb38172d345173502172b0349f252e1
        Gerrit-Change-Number: 7899247
        Gerrit-PatchSet: 21
        Gerrit-Owner: Shivani Sharma <shiva...@chromium.org>
        Gerrit-Reviewer: Alex Moshchuk <ale...@chromium.org>
        Gerrit-Reviewer: Andrew Verge <ave...@chromium.org>
        Gerrit-Reviewer: Kenichi Ishibashi <ba...@chromium.org>
        Gerrit-Reviewer: Shivani Sharma <shiva...@chromium.org>
        Gerrit-Reviewer: Xiaochen Zhou <xiaoc...@chromium.org>
        Gerrit-CC: Heron Yang <hero...@google.com>
        Gerrit-CC: Hiroki Nakagawa <nhi...@chromium.org>
        Gerrit-CC: Kenneth R Christiansen <kenneth.r.c...@intel.com>
        Gerrit-CC: Mandy, Arnaud <arnaud...@intel.com>
        Gerrit-CC: Mangesh Ghiware <mghi...@google.com>
        Gerrit-CC: Mike West <mk...@chromium.org>
        Gerrit-CC: Noam Rosenthal <nrose...@google.com>
        Gerrit-Attention: Alex Moshchuk <ale...@chromium.org>
        Gerrit-Attention: Kenichi Ishibashi <ba...@chromium.org>
        Gerrit-Comment-Date: Mon, 08 Jun 2026 14:18:20 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Kenichi Ishibashi (Gerrit)

        unread,
        Jun 8, 2026, 9:01:52 PM (2 days ago) Jun 8
        to Shivani Sharma, Alex Moshchuk, Mike West, Noam Rosenthal, Andrew Verge, Xiaochen Zhou, Chromium LUCI CQ, Wang, Wei4, Kenneth R Christiansen, Mandy, Arnaud, Mangesh Ghiware, Heron Yang, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, devtools...@chromium.org, Hiroki Nakagawa, prerendering-reviews, net-r...@chromium.org, alexmo...@chromium.org, blink-work...@chromium.org, creis...@chromium.org, derinel+wat...@google.com, fenced-fra...@chromium.org, gavin...@chromium.org, horo+...@chromium.org, ipc-securi...@chromium.org, kinuko+ser...@chromium.org, kinuko...@chromium.org, loading...@chromium.org, navigation...@chromium.org, network-ser...@chromium.org, servicewor...@chromium.org, shimazu+se...@chromium.org, tburkar...@chromium.org, webauthn...@chromium.org
        Attention needed from Alex Moshchuk and Shivani Sharma

        Kenichi Ishibashi voted and added 1 comment

        Votes added by Kenichi Ishibashi

        Code-Review+1

        1 comment

        Patchset-level comments
        File-level comment, Patchset 22 (Latest):
        Kenichi Ishibashi . resolved

        lgtm

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Alex Moshchuk
        • Shivani Sharma
        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: Iddbff4f46eb38172d345173502172b0349f252e1
        Gerrit-Change-Number: 7899247
        Gerrit-PatchSet: 22
        Gerrit-Owner: Shivani Sharma <shiva...@chromium.org>
        Gerrit-Reviewer: Alex Moshchuk <ale...@chromium.org>
        Gerrit-Reviewer: Andrew Verge <ave...@chromium.org>
        Gerrit-Reviewer: Kenichi Ishibashi <ba...@chromium.org>
        Gerrit-Reviewer: Shivani Sharma <shiva...@chromium.org>
        Gerrit-Reviewer: Xiaochen Zhou <xiaoc...@chromium.org>
        Gerrit-CC: Heron Yang <hero...@google.com>
        Gerrit-CC: Hiroki Nakagawa <nhi...@chromium.org>
        Gerrit-CC: Kenneth R Christiansen <kenneth.r.c...@intel.com>
        Gerrit-CC: Mandy, Arnaud <arnaud...@intel.com>
        Gerrit-CC: Mangesh Ghiware <mghi...@google.com>
        Gerrit-CC: Mike West <mk...@chromium.org>
        Gerrit-CC: Noam Rosenthal <nrose...@google.com>
        Gerrit-CC: Wang, Wei4 <wei4...@intel.com>
        Gerrit-CC: prerendering-reviews <prerenderi...@chromium.org>
        Gerrit-Attention: Alex Moshchuk <ale...@chromium.org>
        Gerrit-Attention: Shivani Sharma <shiva...@chromium.org>
        Gerrit-Comment-Date: Tue, 09 Jun 2026 01:01:29 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: Yes
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Alex Moshchuk (Gerrit)

        unread,
        Jun 8, 2026, 10:08:04 PM (2 days ago) Jun 8
        to Shivani Sharma, Kenichi Ishibashi, Mike West, Noam Rosenthal, Andrew Verge, Xiaochen Zhou, Chromium LUCI CQ, Wang, Wei4, Kenneth R Christiansen, Mandy, Arnaud, Mangesh Ghiware, Heron Yang, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, devtools...@chromium.org, Hiroki Nakagawa, prerendering-reviews, net-r...@chromium.org, alexmo...@chromium.org, blink-work...@chromium.org, creis...@chromium.org, derinel+wat...@google.com, fenced-fra...@chromium.org, gavin...@chromium.org, horo+...@chromium.org, ipc-securi...@chromium.org, kinuko+ser...@chromium.org, kinuko...@chromium.org, loading...@chromium.org, navigation...@chromium.org, network-ser...@chromium.org, servicewor...@chromium.org, shimazu+se...@chromium.org, tburkar...@chromium.org, webauthn...@chromium.org
        Attention needed from Shivani Sharma

        Alex Moshchuk voted and added 5 comments

        Votes added by Alex Moshchuk

        Code-Review+1

        5 comments

        Patchset-level comments
        Alex Moshchuk . resolved

        Thanks, content/ LGTM with a few notes.

        File content/browser/preloading/preconnect/preconnect_manager_impl.cc
        Line 23, Patchset 22 (Latest):#include "services/network/public/cpp/constants.h"
        Alex Moshchuk . unresolved

        It seems that this is included and used in both the browser process code and network service process code. Does that mean that the browser process and NS process will have differing values for network::GetNoOpNetworkRestrictionsId(), etc, since we will create a unique token in each process? Is that ok?

        Line 70, Patchset 22 (Latest): base::optional_ref<base::UnguessableToken> network_restrictions_id)
        Alex Moshchuk . unresolved

        Would this also need to be updated to remove the optional at some point?

        File content/browser/renderer_host/document_associated_data.cc
        Line 130, Patchset 22 (Latest): return base::UnguessableToken::Null();
        Alex Moshchuk . unresolved

        General note: it's invalid to send an empty UnguessableToken over Mojo - [see here](https://source.chromium.org/chromium/chromium/src/+/main:base/unguessable_token.h;l=47-50;drc=cdc524b176956e1aa3d4bb4e3b4d7b156b6cbaa9). I wonder if that can cause any issues if this is read for an initial empty document of a brand new tab, or something where we don't otherwise create or inherit the network restrictions ID. I guess that document is unlikely to be scripted by another frame to do a network request that would need this, but it could potentially happen in a corner case via extension content scripts or DevTools.

        So I wonder if it should be invalid to return a null token here.

        File services/network/websocket_factory_unittest.cc
        Line 117, Patchset 22 (Latest): /*network_restrictions_id=*/base::UnguessableToken());
        Alex Moshchuk . unresolved

        GetTestNetworkRestrictionsId()?

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Shivani Sharma
        Submit Requirements:
          • requirement satisfiedCode-Coverage
          • requirement is not satisfiedCode-Owners
          • requirement satisfiedCode-Review
          • requirement is not satisfiedNo-Unresolved-Comments
          • requirement satisfiedReview-Enforcement
          Gerrit-Attention: Shivani Sharma <shiva...@chromium.org>
          Gerrit-Comment-Date: Tue, 09 Jun 2026 02:07:44 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: Yes
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Shivani Sharma (Gerrit)

          unread,
          Jun 10, 2026, 2:21:05 PM (17 hours ago) Jun 10
          to James Maclean, Alex Moshchuk, Kenichi Ishibashi, Mike West, Noam Rosenthal, Andrew Verge, Xiaochen Zhou, Chromium LUCI CQ, Wang, Wei4, Kenneth R Christiansen, Mandy, Arnaud, Mangesh Ghiware, Heron Yang, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, devtools...@chromium.org, Hiroki Nakagawa, prerendering-reviews, android-web...@chromium.org, net-r...@chromium.org, alexmo...@chromium.org, blink-work...@chromium.org, creis...@chromium.org, derinel+wat...@google.com, fenced-fra...@chromium.org, gavin...@chromium.org, horo+...@chromium.org, ipc-securi...@chromium.org, kinuko+ser...@chromium.org, kinuko...@chromium.org, loading...@chromium.org, navigation...@chromium.org, network-ser...@chromium.org, servicewor...@chromium.org, shimazu+se...@chromium.org, tburkar...@chromium.org, webauthn...@chromium.org
          Attention needed from Alex Moshchuk

          Shivani Sharma added 4 comments

          File content/browser/preloading/preconnect/preconnect_manager_impl.cc
          Line 23, Patchset 22:#include "services/network/public/cpp/constants.h"
          Alex Moshchuk . unresolved

          It seems that this is included and used in both the browser process code and network service process code. Does that mean that the browser process and NS process will have differing values for network::GetNoOpNetworkRestrictionsId(), etc, since we will create a unique token in each process? Is that ok?

          Shivani Sharma

          That's a great point.
          The Test and TODO constants are ok to be in both processes with different values.

          The NoOp constant should only be necessary for populating the id in the browser process and network service should be agnostic to the value. If we tried to do early return based on NoOp before checking the network_restriction_ids_ map in the n/w service then it wouldn't really be working on the right NoOp value and other than that there is no use for it in the n/w service. Moving it to the content/browser layer makes sense but some of the layers like device/ cannot depend on content/ so instead I am adding a dcheck for it to only be invoked in the browser process.

          Line 70, Patchset 22: base::optional_ref<base::UnguessableToken> network_restrictions_id)
          Alex Moshchuk . resolved

          Would this also need to be updated to remove the optional at some point?

          Shivani Sharma

          Done

          File content/browser/renderer_host/document_associated_data.cc
          Line 130, Patchset 22: return base::UnguessableToken::Null();
          Alex Moshchuk . unresolved

          General note: it's invalid to send an empty UnguessableToken over Mojo - [see here](https://source.chromium.org/chromium/chromium/src/+/main:base/unguessable_token.h;l=47-50;drc=cdc524b176956e1aa3d4bb4e3b4d7b156b6cbaa9). I wonder if that can cause any issues if this is read for an initial empty document of a brand new tab, or something where we don't otherwise create or inherit the network restrictions ID. I guess that document is unlikely to be scripted by another frame to do a network request that would need this, but it could potentially happen in a corner case via extension content scripts or DevTools.

          So I wonder if it should be invalid to return a null token here.

          Shivani Sharma

          Thanks! I was adding the changes to always have this be initialized to no-op id in the follow up CL, but actually moving these changes here so this CL is safe. Also added DCHECKs for id to be non-empty before the network context mojo calls are called.

          File services/network/websocket_factory_unittest.cc
          Line 117, Patchset 22: /*network_restrictions_id=*/base::UnguessableToken());
          Alex Moshchuk . resolved

          GetTestNetworkRestrictionsId()?

          Shivani Sharma

          Done

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Alex Moshchuk
          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: Iddbff4f46eb38172d345173502172b0349f252e1
            Gerrit-Change-Number: 7899247
            Gerrit-PatchSet: 24
            Gerrit-Owner: Shivani Sharma <shiva...@chromium.org>
            Gerrit-Reviewer: Alex Moshchuk <ale...@chromium.org>
            Gerrit-Reviewer: Andrew Verge <ave...@chromium.org>
            Gerrit-Reviewer: Kenichi Ishibashi <ba...@chromium.org>
            Gerrit-Reviewer: Shivani Sharma <shiva...@chromium.org>
            Gerrit-Reviewer: Xiaochen Zhou <xiaoc...@chromium.org>
            Gerrit-CC: Heron Yang <hero...@google.com>
            Gerrit-CC: Hiroki Nakagawa <nhi...@chromium.org>
            Gerrit-CC: James Maclean <wjma...@chromium.org>
            Gerrit-CC: Kenneth R Christiansen <kenneth.r.c...@intel.com>
            Gerrit-CC: Mandy, Arnaud <arnaud...@intel.com>
            Gerrit-CC: Mangesh Ghiware <mghi...@google.com>
            Gerrit-CC: Mike West <mk...@chromium.org>
            Gerrit-CC: Noam Rosenthal <nrose...@google.com>
            Gerrit-CC: Wang, Wei4 <wei4...@intel.com>
            Gerrit-CC: prerendering-reviews <prerenderi...@chromium.org>
            Gerrit-Attention: Alex Moshchuk <ale...@chromium.org>
            Gerrit-Comment-Date: Wed, 10 Jun 2026 18:20:44 +0000
            Gerrit-HasComments: Yes
            Gerrit-Has-Labels: No
            Comment-In-Reply-To: Alex Moshchuk <ale...@chromium.org>
            satisfied_requirement
            unsatisfied_requirement
            open
            diffy

            Xiaochen Zhou (Gerrit)

            unread,
            Jun 10, 2026, 5:02:27 PM (14 hours ago) Jun 10
            to Shivani Sharma, James Maclean, Alex Moshchuk, Kenichi Ishibashi, Mike West, Noam Rosenthal, Andrew Verge, Chromium LUCI CQ, Wang, Wei4, Kenneth R Christiansen, Mandy, Arnaud, Mangesh Ghiware, Heron Yang, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, devtools...@chromium.org, Hiroki Nakagawa, prerendering-reviews, android-web...@chromium.org, net-r...@chromium.org, alexmo...@chromium.org, blink-work...@chromium.org, creis...@chromium.org, derinel+wat...@google.com, fenced-fra...@chromium.org, gavin...@chromium.org, horo+...@chromium.org, ipc-securi...@chromium.org, kinuko+ser...@chromium.org, kinuko...@chromium.org, loading...@chromium.org, navigation...@chromium.org, network-ser...@chromium.org, servicewor...@chromium.org, shimazu+se...@chromium.org, tburkar...@chromium.org, webauthn...@chromium.org
            Attention needed from Alex Moshchuk, Andrew Verge, Kenichi Ishibashi and Shivani Sharma

            Xiaochen Zhou voted and added 2 comments

            Votes added by Xiaochen Zhou

            Code-Review+1

            2 comments

            Patchset-level comments
            File-level comment, Patchset 26 (Latest):
            Xiaochen Zhou . resolved

            LGTM % one comment.

            File docs/connection_allowlist_design.md
            Line 97, Patchset 26 (Latest): * **Selecting the ID at Calling Sites**:
            Xiaochen Zhou . unresolved

            It seems the note about `GetTODONetworkRestrictionsId()` has been removed, is it intentional?

            Open in Gerrit

            Related details

            Attention is currently required from:
            • Alex Moshchuk
            • Andrew Verge
            • Kenichi Ishibashi
            • Shivani Sharma
            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: Iddbff4f46eb38172d345173502172b0349f252e1
              Gerrit-Change-Number: 7899247
              Gerrit-PatchSet: 26
              Gerrit-Owner: Shivani Sharma <shiva...@chromium.org>
              Gerrit-Reviewer: Alex Moshchuk <ale...@chromium.org>
              Gerrit-Reviewer: Andrew Verge <ave...@chromium.org>
              Gerrit-Reviewer: Kenichi Ishibashi <ba...@chromium.org>
              Gerrit-Reviewer: Shivani Sharma <shiva...@chromium.org>
              Gerrit-Reviewer: Xiaochen Zhou <xiaoc...@chromium.org>
              Gerrit-CC: Heron Yang <hero...@google.com>
              Gerrit-CC: Hiroki Nakagawa <nhi...@chromium.org>
              Gerrit-CC: James Maclean <wjma...@chromium.org>
              Gerrit-CC: Kenneth R Christiansen <kenneth.r.c...@intel.com>
              Gerrit-CC: Mandy, Arnaud <arnaud...@intel.com>
              Gerrit-CC: Mangesh Ghiware <mghi...@google.com>
              Gerrit-CC: Mike West <mk...@chromium.org>
              Gerrit-CC: Noam Rosenthal <nrose...@google.com>
              Gerrit-CC: Wang, Wei4 <wei4...@intel.com>
              Gerrit-CC: prerendering-reviews <prerenderi...@chromium.org>
              Gerrit-Attention: Alex Moshchuk <ale...@chromium.org>
              Gerrit-Attention: Shivani Sharma <shiva...@chromium.org>
              Gerrit-Attention: Andrew Verge <ave...@chromium.org>
              Gerrit-Attention: Kenichi Ishibashi <ba...@chromium.org>
              Gerrit-Comment-Date: Wed, 10 Jun 2026 21:02:19 +0000
              Gerrit-HasComments: Yes
              Gerrit-Has-Labels: Yes
              satisfied_requirement
              unsatisfied_requirement
              open
              diffy

              Shivani Sharma (Gerrit)

              unread,
              Jun 10, 2026, 5:30:12 PM (14 hours ago) Jun 10
              to Xiaochen Zhou, James Maclean, Alex Moshchuk, Kenichi Ishibashi, Mike West, Noam Rosenthal, Andrew Verge, Chromium LUCI CQ, Wang, Wei4, Kenneth R Christiansen, Mandy, Arnaud, Mangesh Ghiware, Heron Yang, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, devtools...@chromium.org, Hiroki Nakagawa, prerendering-reviews, android-web...@chromium.org, net-r...@chromium.org, alexmo...@chromium.org, blink-work...@chromium.org, creis...@chromium.org, derinel+wat...@google.com, fenced-fra...@chromium.org, gavin...@chromium.org, horo+...@chromium.org, ipc-securi...@chromium.org, kinuko+ser...@chromium.org, kinuko...@chromium.org, loading...@chromium.org, navigation...@chromium.org, network-ser...@chromium.org, servicewor...@chromium.org, shimazu+se...@chromium.org, tburkar...@chromium.org, webauthn...@chromium.org
              Attention needed from Alex Moshchuk, Andrew Verge and Kenichi Ishibashi

              Shivani Sharma added 1 comment

              File docs/connection_allowlist_design.md
              Line 97, Patchset 26 (Latest): * **Selecting the ID at Calling Sites**:
              Xiaochen Zhou . resolved

              It seems the note about `GetTODONetworkRestrictionsId()` has been removed, is it intentional?

              Shivani Sharma

              Yes I am thinking that TODO will be removed soon after CA impl completion so doesn't really need to be in the doc.

              Open in Gerrit

              Related details

              Attention is currently required from:
              • Alex Moshchuk
              • Andrew Verge
              • Kenichi Ishibashi
              Gerrit-Attention: Andrew Verge <ave...@chromium.org>
              Gerrit-Attention: Kenichi Ishibashi <ba...@chromium.org>
              Gerrit-Comment-Date: Wed, 10 Jun 2026 21:29:45 +0000
              Gerrit-HasComments: Yes
              Gerrit-Has-Labels: No
              Comment-In-Reply-To: Xiaochen Zhou <xiaoc...@chromium.org>
              satisfied_requirement
              unsatisfied_requirement
              open
              diffy

              Alex Moshchuk (Gerrit)

              unread,
              Jun 10, 2026, 5:44:59 PM (13 hours ago) Jun 10
              to Shivani Sharma, Xiaochen Zhou, James Maclean, Kenichi Ishibashi, Mike West, Noam Rosenthal, Andrew Verge, Chromium LUCI CQ, Wang, Wei4, Kenneth R Christiansen, Mandy, Arnaud, Mangesh Ghiware, Heron Yang, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, devtools...@chromium.org, Hiroki Nakagawa, prerendering-reviews, android-web...@chromium.org, net-r...@chromium.org, alexmo...@chromium.org, blink-work...@chromium.org, creis...@chromium.org, derinel+wat...@google.com, fenced-fra...@chromium.org, gavin...@chromium.org, horo+...@chromium.org, ipc-securi...@chromium.org, kinuko+ser...@chromium.org, kinuko...@chromium.org, loading...@chromium.org, navigation...@chromium.org, network-ser...@chromium.org, servicewor...@chromium.org, shimazu+se...@chromium.org, tburkar...@chromium.org, webauthn...@chromium.org
              Attention needed from Andrew Verge and Kenichi Ishibashi

              Alex Moshchuk voted and added 5 comments

              Votes added by Alex Moshchuk

              Code-Review+1

              5 comments

              File content/browser/preloading/preconnect/preconnect_manager_impl.cc
              Line 23, Patchset 22:#include "services/network/public/cpp/constants.h"
              Alex Moshchuk . unresolved

              It seems that this is included and used in both the browser process code and network service process code. Does that mean that the browser process and NS process will have differing values for network::GetNoOpNetworkRestrictionsId(), etc, since we will create a unique token in each process? Is that ok?

              Shivani Sharma

              That's a great point.
              The Test and TODO constants are ok to be in both processes with different values.

              The NoOp constant should only be necessary for populating the id in the browser process and network service should be agnostic to the value. If we tried to do early return based on NoOp before checking the network_restriction_ids_ map in the n/w service then it wouldn't really be working on the right NoOp value and other than that there is no use for it in the n/w service. Moving it to the content/browser layer makes sense but some of the layers like device/ cannot depend on content/ so instead I am adding a dcheck for it to only be invoked in the browser process.

              Alex Moshchuk

              Ack. I'm not sure if there's a better way to check for the browser process from the network service code (I suppose we can't access switches::kProcessType :/); I'll leave that part to network service reviewers.

              I noticed that this will probably come up for Xiaochen's suggestion in https://chromium-review.git.corp.google.com/c/chromium/src/+/7899247/comment/a32c8401_91fbd03f/ to return early for NoOp case. I agree that a cleaner way forward would be with some sort of wrapper or union type (as crbug.com/520464337 suggests), where the bypass_allowlist case is more explicit, or sending the NoOp token to the network service if it needs to be in sync there.

              Line 228, Patchset 26 (Latest): DCHECK(!network_restrictions_id.is_empty());
              Alex Moshchuk . unresolved

              nit: prefer CHECK in new code

              File content/browser/renderer_host/document_associated_data.cc
              Line 114, Patchset 26 (Latest): DCHECK(!network_restrictions_id.is_empty());
              Alex Moshchuk . unresolved

              (CHECKs here as well)

              Line 130, Patchset 22: return base::UnguessableToken::Null();
              Alex Moshchuk . resolved

              General note: it's invalid to send an empty UnguessableToken over Mojo - [see here](https://source.chromium.org/chromium/chromium/src/+/main:base/unguessable_token.h;l=47-50;drc=cdc524b176956e1aa3d4bb4e3b4d7b156b6cbaa9). I wonder if that can cause any issues if this is read for an initial empty document of a brand new tab, or something where we don't otherwise create or inherit the network restrictions ID. I guess that document is unlikely to be scripted by another frame to do a network request that would need this, but it could potentially happen in a corner case via extension content scripts or DevTools.

              So I wonder if it should be invalid to return a null token here.

              Shivani Sharma

              Thanks! I was adding the changes to always have this be initialized to no-op id in the follow up CL, but actually moving these changes here so this CL is safe. Also added DCHECKs for id to be non-empty before the network context mojo calls are called.

              Alex Moshchuk

              Acknowledged

              File services/network/public/cpp/constants.cc
              Line 27, Patchset 26 (Latest): DCHECKBrowserProcess();
              Alex Moshchuk . unresolved

              s/DCHECK/CHECK/g here as well, and it should also probably have a comment about why this is only safe to call from the browser process (i.e., covering the shared token discussion and maybe a TODO pointing to the bug you filed).

              Open in Gerrit

              Related details

              Attention is currently required from:
              • Andrew Verge
              • Kenichi Ishibashi
              Gerrit-Attention: Andrew Verge <ave...@chromium.org>
              Gerrit-Attention: Kenichi Ishibashi <ba...@chromium.org>
              Gerrit-Comment-Date: Wed, 10 Jun 2026 21:44:41 +0000
              Gerrit-HasComments: Yes
              Gerrit-Has-Labels: Yes
              Comment-In-Reply-To: Alex Moshchuk <ale...@chromium.org>
              Comment-In-Reply-To: Shivani Sharma <shiva...@chromium.org>
              satisfied_requirement
              unsatisfied_requirement
              open
              diffy

              Shivani Sharma (Gerrit)

              unread,
              Jun 10, 2026, 6:46:26 PM (12 hours ago) Jun 10
              to Alex Moshchuk, Xiaochen Zhou, James Maclean, Kenichi Ishibashi, Mike West, Noam Rosenthal, Andrew Verge, Chromium LUCI CQ, Wang, Wei4, Kenneth R Christiansen, Mandy, Arnaud, Mangesh Ghiware, Heron Yang, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, devtools...@chromium.org, Hiroki Nakagawa, prerendering-reviews, android-web...@chromium.org, net-r...@chromium.org, alexmo...@chromium.org, blink-work...@chromium.org, creis...@chromium.org, derinel+wat...@google.com, fenced-fra...@chromium.org, gavin...@chromium.org, horo+...@chromium.org, ipc-securi...@chromium.org, kinuko+ser...@chromium.org, kinuko...@chromium.org, loading...@chromium.org, navigation...@chromium.org, network-ser...@chromium.org, servicewor...@chromium.org, shimazu+se...@chromium.org, tburkar...@chromium.org, webauthn...@chromium.org
              Attention needed from Alex Moshchuk, Andrew Verge and Kenichi Ishibashi

              Shivani Sharma added 4 comments

              File content/browser/preloading/preconnect/preconnect_manager_impl.cc
              Line 23, Patchset 22:#include "services/network/public/cpp/constants.h"
              Alex Moshchuk . resolved

              It seems that this is included and used in both the browser process code and network service process code. Does that mean that the browser process and NS process will have differing values for network::GetNoOpNetworkRestrictionsId(), etc, since we will create a unique token in each process? Is that ok?

              Shivani Sharma

              That's a great point.
              The Test and TODO constants are ok to be in both processes with different values.

              The NoOp constant should only be necessary for populating the id in the browser process and network service should be agnostic to the value. If we tried to do early return based on NoOp before checking the network_restriction_ids_ map in the n/w service then it wouldn't really be working on the right NoOp value and other than that there is no use for it in the n/w service. Moving it to the content/browser layer makes sense but some of the layers like device/ cannot depend on content/ so instead I am adding a dcheck for it to only be invoked in the browser process.

              Alex Moshchuk

              Ack. I'm not sure if there's a better way to check for the browser process from the network service code (I suppose we can't access switches::kProcessType :/); I'll leave that part to network service reviewers.

              I noticed that this will probably come up for Xiaochen's suggestion in https://chromium-review.git.corp.google.com/c/chromium/src/+/7899247/comment/a32c8401_91fbd03f/ to return early for NoOp case. I agree that a cleaner way forward would be with some sort of wrapper or union type (as crbug.com/520464337 suggests), where the bypass_allowlist case is more explicit, or sending the NoOp token to the network service if it needs to be in sync there.

              Shivani Sharma

              Acknowledged

              Line 228, Patchset 26: DCHECK(!network_restrictions_id.is_empty());
              Alex Moshchuk . unresolved

              nit: prefer CHECK in new code

              Shivani Sharma

              Done but with NotFatalUntil for M165 (over 6 months from now) to be on the safe side. Hope that's fine.

              File content/browser/renderer_host/document_associated_data.cc
              Line 114, Patchset 26: DCHECK(!network_restrictions_id.is_empty());
              Alex Moshchuk . resolved

              (CHECKs here as well)

              Shivani Sharma

              Done

              File services/network/public/cpp/constants.cc
              Line 27, Patchset 26: DCHECKBrowserProcess();
              Alex Moshchuk . resolved

              s/DCHECK/CHECK/g here as well, and it should also probably have a comment about why this is only safe to call from the browser process (i.e., covering the shared token discussion and maybe a TODO pointing to the bug you filed).

              Shivani Sharma

              Done

              Open in Gerrit

              Related details

              Attention is currently required from:
              • Alex Moshchuk
              • Andrew Verge
              • Kenichi Ishibashi
              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: Iddbff4f46eb38172d345173502172b0349f252e1
              Gerrit-Change-Number: 7899247
              Gerrit-PatchSet: 27
              Gerrit-Owner: Shivani Sharma <shiva...@chromium.org>
              Gerrit-Reviewer: Alex Moshchuk <ale...@chromium.org>
              Gerrit-Reviewer: Andrew Verge <ave...@chromium.org>
              Gerrit-Reviewer: Kenichi Ishibashi <ba...@chromium.org>
              Gerrit-Reviewer: Shivani Sharma <shiva...@chromium.org>
              Gerrit-Reviewer: Xiaochen Zhou <xiaoc...@chromium.org>
              Gerrit-CC: Heron Yang <hero...@google.com>
              Gerrit-CC: Hiroki Nakagawa <nhi...@chromium.org>
              Gerrit-CC: James Maclean <wjma...@chromium.org>
              Gerrit-CC: Kenneth R Christiansen <kenneth.r.c...@intel.com>
              Gerrit-CC: Mandy, Arnaud <arnaud...@intel.com>
              Gerrit-CC: Mangesh Ghiware <mghi...@google.com>
              Gerrit-CC: Mike West <mk...@chromium.org>
              Gerrit-CC: Noam Rosenthal <nrose...@google.com>
              Gerrit-CC: Wang, Wei4 <wei4...@intel.com>
              Gerrit-CC: prerendering-reviews <prerenderi...@chromium.org>
              Gerrit-Attention: Alex Moshchuk <ale...@chromium.org>
              Gerrit-Attention: Andrew Verge <ave...@chromium.org>
              Gerrit-Attention: Kenichi Ishibashi <ba...@chromium.org>
              Gerrit-Comment-Date: Wed, 10 Jun 2026 22:46:15 +0000
              Gerrit-HasComments: Yes
              Gerrit-Has-Labels: No
              satisfied_requirement
              unsatisfied_requirement
              open
              diffy

              Andrew Verge (Gerrit)

              unread,
              Jun 10, 2026, 10:32:30 PM (9 hours ago) Jun 10
              to Shivani Sharma, Alex Moshchuk, Xiaochen Zhou, James Maclean, Kenichi Ishibashi, Mike West, Noam Rosenthal, Chromium LUCI CQ, Wang, Wei4, Kenneth R Christiansen, Mandy, Arnaud, Mangesh Ghiware, Heron Yang, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, devtools...@chromium.org, Hiroki Nakagawa, prerendering-reviews, android-web...@chromium.org, net-r...@chromium.org, alexmo...@chromium.org, blink-work...@chromium.org, creis...@chromium.org, derinel+wat...@google.com, fenced-fra...@chromium.org, gavin...@chromium.org, horo+...@chromium.org, ipc-securi...@chromium.org, kinuko+ser...@chromium.org, kinuko...@chromium.org, loading...@chromium.org, navigation...@chromium.org, network-ser...@chromium.org, servicewor...@chromium.org, shimazu+se...@chromium.org, tburkar...@chromium.org, webauthn...@chromium.org
              Attention needed from Alex Moshchuk, Kenichi Ishibashi and Shivani Sharma

              Andrew Verge voted Code-Review+1

              Code-Review+1
              Open in Gerrit

              Related details

              Attention is currently required from:
              • Alex Moshchuk
              • Kenichi Ishibashi
              • Shivani Sharma
              Gerrit-Attention: Shivani Sharma <shiva...@chromium.org>
              Gerrit-Attention: Kenichi Ishibashi <ba...@chromium.org>
              Gerrit-Comment-Date: Thu, 11 Jun 2026 02:32:20 +0000
              Gerrit-HasComments: No
              Gerrit-Has-Labels: Yes
              satisfied_requirement
              unsatisfied_requirement
              open
              diffy

              Kenichi Ishibashi (Gerrit)

              unread,
              3:37 AM (3 hours ago) 3:37 AM
              to Shivani Sharma, Andrew Verge, Alex Moshchuk, Xiaochen Zhou, James Maclean, Mike West, Noam Rosenthal, Chromium LUCI CQ, Wang, Wei4, Kenneth R Christiansen, Mandy, Arnaud, Mangesh Ghiware, Heron Yang, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, devtools...@chromium.org, Hiroki Nakagawa, prerendering-reviews, android-web...@chromium.org, net-r...@chromium.org, alexmo...@chromium.org, blink-work...@chromium.org, creis...@chromium.org, derinel+wat...@google.com, fenced-fra...@chromium.org, gavin...@chromium.org, horo+...@chromium.org, ipc-securi...@chromium.org, kinuko+ser...@chromium.org, kinuko...@chromium.org, loading...@chromium.org, navigation...@chromium.org, network-ser...@chromium.org, servicewor...@chromium.org, shimazu+se...@chromium.org, tburkar...@chromium.org, webauthn...@chromium.org
              Attention needed from Alex Moshchuk and Shivani Sharma

              Kenichi Ishibashi voted Code-Review+1

              Code-Review+1
              Open in Gerrit

              Related details

              Attention is currently required from:
              • Alex Moshchuk
              • Shivani Sharma
              Gerrit-Comment-Date: Thu, 11 Jun 2026 07:37:21 +0000
              Gerrit-HasComments: No
              Gerrit-Has-Labels: Yes
              satisfied_requirement
              unsatisfied_requirement
              open
              diffy
              Reply all
              Reply to author
              Forward
              0 new messages