[Direct Sockets] Implement dynamic enablement in Isolated Contexts [chromium/src : main]

0 views
Skip to first unread message

Andrew Rayskiy (Gerrit)

unread,
Mar 6, 2026, 9:55:02 AMMar 6
to Camille Lamy, Daniel Cheng, Yoshisato Yanagisawa, Luna Lu, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Simon Hangl, iclella...@chromium.org, alexmo...@chromium.org, asvitki...@chromium.org, blink-...@chromium.org, blink-work...@chromium.org, creis...@chromium.org, horo+...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, network-ser...@chromium.org, shimazu...@chromium.org
Attention needed from Camille Lamy, Daniel Cheng and Yoshisato Yanagisawa

Andrew Rayskiy added 1 comment

Patchset-level comments
File-level comment, Patchset 11 (Latest):
Andrew Rayskiy . unresolved

Hey folks, PTAL at the respective parts of the stack.

Camille -- please check `navigation_request.cc` and `//content` changes -- is this the right place to intercept the navigation? Ideally I'd use a `WebContentsObserver`, but I'm not sure where to store it on the `//content` layer.

Daniel -- please check the flag propagation logic and the overall implementation.

Yoshisato -- please take a look at the flag override propagation to the dedicated worker & whether it's an acceptable solution :)

Open in Gerrit

Related details

Attention is currently required from:
  • Camille Lamy
  • Daniel Cheng
  • Yoshisato Yanagisawa
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: I4305965ca5cb8352ac2cc0ebf874d4feac6d1a0e
Gerrit-Change-Number: 7639669
Gerrit-PatchSet: 11
Gerrit-Owner: Andrew Rayskiy <green...@google.com>
Gerrit-Reviewer: Andrew Rayskiy <green...@google.com>
Gerrit-Reviewer: Camille Lamy <cl...@chromium.org>
Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
Gerrit-Reviewer: Yoshisato Yanagisawa <yyana...@chromium.org>
Gerrit-CC: Luna Lu <loon...@chromium.org>
Gerrit-CC: Simon Hangl <sim...@google.com>
Gerrit-Attention: Camille Lamy <cl...@chromium.org>
Gerrit-Attention: Yoshisato Yanagisawa <yyana...@chromium.org>
Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
Gerrit-Comment-Date: Fri, 06 Mar 2026 14:54:48 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Andrew Rayskiy (Gerrit)

unread,
Mar 6, 2026, 9:57:18 AMMar 6
to Camille Lamy, Daniel Cheng, Yoshisato Yanagisawa, Luna Lu, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Simon Hangl, iclella...@chromium.org, alexmo...@chromium.org, asvitki...@chromium.org, blink-...@chromium.org, blink-work...@chromium.org, creis...@chromium.org, horo+...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, network-ser...@chromium.org, shimazu...@chromium.org
Attention needed from Camille Lamy, Daniel Cheng and Yoshisato Yanagisawa

Andrew Rayskiy added 1 comment

File services/network/public/cpp/permissions_policy/permissions_policy_features.json5
Line 329, Patchset 11 (Parent): depends_on: ["DirectSockets"],
Andrew Rayskiy . unresolved

In the new scheme the flag is enabled once the isolation status of a process has been determined (which happens based on COOP/COEP headers), i.e. after header parsing (so the timing doesn't match).

I'm also wondering whether it's acceptable to keep the `IsolatedContext` visibility modifier -- it's not really needed in any other embedders, so it's more of a consistency question. @dch...@chromium.org

Gerrit-Comment-Date: Fri, 06 Mar 2026 14:57:04 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

AI Code Reviewer (Gerrit)

unread,
Mar 6, 2026, 9:57:23 AMMar 6
to Andrew Rayskiy, Camille Lamy, Daniel Cheng, Yoshisato Yanagisawa, Luna Lu, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Simon Hangl, iclella...@chromium.org, alexmo...@chromium.org, asvitki...@chromium.org, blink-...@chromium.org, blink-work...@chromium.org, creis...@chromium.org, horo+...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, network-ser...@chromium.org, shimazu...@chromium.org
Attention needed from Camille Lamy, Daniel Cheng and Yoshisato Yanagisawa

AI Code Reviewer added 1 comment

File third_party/blink/renderer/core/workers/dedicated_worker_global_scope.h
Line 189, Patchset 11 (Latest): bool direct_sockets_force_enabled_in_parent = false;
AI Code Reviewer . unresolved

nit: Blink Style Guide: Naming - Precede boolean values with words like “is” and “did”. Consider naming this 'is_direct_sockets_force_enabled_in_parent'.

To keep this interaction as brief and non-intrusive as possible, please consider responding with one of following options:
**Done** | **OK But Won't Fix**: reason | **Later**: b/<bug_id> | **Invalid:** reason


_This comment was generated by [Experimental Blink C++ Code Review Agent](http://go/blink-c++-code-review-agent)._
_AI reviews can sometimes be inaccurate; We appreciate your 🙏 feedback 🙏 to help us improve._
_[File a bug](http://go/blink-c++-code-review-agent-feedback) | [Provide feedback on chat](https://chat.google.com/room/AAQA0zhQHe0?cls=4) | [Opt-out](https://ganpati2.corp.google.com/group/peep-genai-blink-agent-optout.prod)_

Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
Gerrit-CC: Luna Lu <loon...@chromium.org>
Gerrit-CC: Simon Hangl <sim...@google.com>
Gerrit-Attention: Camille Lamy <cl...@chromium.org>
Gerrit-Attention: Yoshisato Yanagisawa <yyana...@chromium.org>
Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
Gerrit-Comment-Date: Fri, 06 Mar 2026 14:57:19 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Camille Lamy (Gerrit)

unread,
Mar 6, 2026, 11:27:07 AMMar 6
to Andrew Rayskiy, AI Code Reviewer, Daniel Cheng, Yoshisato Yanagisawa, Luna Lu, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Simon Hangl, iclella...@chromium.org, alexmo...@chromium.org, asvitki...@chromium.org, blink-...@chromium.org, blink-work...@chromium.org, creis...@chromium.org, horo+...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, network-ser...@chromium.org, shimazu...@chromium.org
Attention needed from Andrew Rayskiy, Daniel Cheng and Yoshisato Yanagisawa

Camille Lamy added 2 comments

Patchset-level comments
Camille Lamy . resolved

Thanks! The plumbing in the worker code looks reasonable. I'll let Daniel comment on the rest of the Blink implementation. Do we have tests that check that DirectSockets are available or not when they're supposed to be?

File content/browser/renderer_host/navigation_request.cc
Line 128, Patchset 11 (Parent):#include "content/public/browser/navigation_controller.h"
Camille Lamy . unresolved

Why is this include removed?

Open in Gerrit

Related details

Attention is currently required from:
  • Andrew Rayskiy
  • Daniel Cheng
  • Yoshisato Yanagisawa
Gerrit-Attention: Andrew Rayskiy <green...@google.com>
Gerrit-Attention: Yoshisato Yanagisawa <yyana...@chromium.org>
Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
Gerrit-Comment-Date: Fri, 06 Mar 2026 16:26:52 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Yoshisato Yanagisawa (Gerrit)

unread,
Mar 10, 2026, 9:43:02 PMMar 10
to Andrew Rayskiy, AI Code Reviewer, Camille Lamy, Daniel Cheng, Luna Lu, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Simon Hangl, iclella...@chromium.org, alexmo...@chromium.org, asvitki...@chromium.org, blink-...@chromium.org, blink-work...@chromium.org, creis...@chromium.org, horo+...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, network-ser...@chromium.org, shimazu...@chromium.org
Attention needed from Andrew Rayskiy and Daniel Cheng

Yoshisato Yanagisawa added 3 comments

Patchset-level comments
File-level comment, Patchset 13 (Latest):
Yoshisato Yanagisawa . unresolved

I am not convinced the code style storing a flag inside GetRuntimeFeatureStateOverrideContext(). Is it natural way to do?
Also, is there an explainer etc for this behavior? All I can do for the area is verifying the implementation is aligned with the design approved by the security expert. Therefore, I hope to see such design.

File third_party/blink/renderer/core/workers/dedicated_worker_global_scope.cc
Line 210, Patchset 13 (Latest): GetRuntimeFeatureStateOverrideContext()->SetDirectSocketsForceEnabled();
Yoshisato Yanagisawa . unresolved

Will this runtime feature state only affects to this Execution Context? Or, can this be more global parameter?

Also, once the flag is enabled, the flag won't be disabled. Is it intended?

Line 303, Patchset 13 (Latest): // then set worker global scope's cross-origin isolated capability to false."
Yoshisato Yanagisawa . unresolved

Upon https://html.spec.whatwg.org/#initialize-worker-policy-container, what happens if this is the about scheme?
I assume this step is Step 1 (Maybe updated since it was originally written?)

Or, is the behavior not specced yet?

Open in Gerrit

Related details

Attention is currently required from:
  • Andrew Rayskiy
  • Daniel Cheng
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: I4305965ca5cb8352ac2cc0ebf874d4feac6d1a0e
Gerrit-Change-Number: 7639669
Gerrit-PatchSet: 13
Gerrit-Owner: Andrew Rayskiy <green...@google.com>
Gerrit-Reviewer: Andrew Rayskiy <green...@google.com>
Gerrit-Reviewer: Camille Lamy <cl...@chromium.org>
Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
Gerrit-Reviewer: Yoshisato Yanagisawa <yyana...@chromium.org>
Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
Gerrit-CC: Luna Lu <loon...@chromium.org>
Gerrit-CC: Simon Hangl <sim...@google.com>
Gerrit-Attention: Andrew Rayskiy <green...@google.com>
Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
Gerrit-Comment-Date: Wed, 11 Mar 2026 01:42:38 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Yoshisato Yanagisawa (Gerrit)

unread,
Mar 10, 2026, 9:43:42 PMMar 10
to Andrew Rayskiy, AI Code Reviewer, Camille Lamy, Daniel Cheng, Luna Lu, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Simon Hangl, iclella...@chromium.org, alexmo...@chromium.org, asvitki...@chromium.org, blink-...@chromium.org, blink-work...@chromium.org, creis...@chromium.org, horo+...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, network-ser...@chromium.org, shimazu...@chromium.org
Attention needed from Andrew Rayskiy and Daniel Cheng

Yoshisato Yanagisawa added 1 comment

Patchset-level comments
Yoshisato Yanagisawa . resolved

Note that I cannot access the linked crbug.

Gerrit-Comment-Date: Wed, 11 Mar 2026 01:43:18 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Andrew Rayskiy (Gerrit)

unread,
Mar 11, 2026, 12:06:13 PMMar 11
to AI Code Reviewer, Camille Lamy, Daniel Cheng, Yoshisato Yanagisawa, Luna Lu, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Simon Hangl, iclella...@chromium.org, alexmo...@chromium.org, asvitki...@chromium.org, blink-...@chromium.org, blink-work...@chromium.org, creis...@chromium.org, horo+...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, network-ser...@chromium.org, shimazu...@chromium.org
Attention needed from Daniel Cheng and Yoshisato Yanagisawa

Andrew Rayskiy added 3 comments

Patchset-level comments
Yoshisato Yanagisawa . unresolved

I am not convinced the code style storing a flag inside GetRuntimeFeatureStateOverrideContext(). Is it natural way to do?
Also, is there an explainer etc for this behavior? All I can do for the area is verifying the implementation is aligned with the design approved by the security expert. Therefore, I hope to see such design.

Andrew Rayskiy

As I wrote in the very first comment, I'll be happy to see any suggestions for a clearer/less invasive way of propagating the flag to workers.

The idea is outlined in [go/isolated-context-is-fun](http://go/isolated-context-is-fun); IsolatedContext is spec-ed [here](https://wicg.github.io/isolated-web-apps/isolated-contexts.html), Direct Sockets are spec-ed [here](https://wicg.github.io/direct-sockets/); my hope is to have @cl...@chromium.org and @dch...@chromium.org as security experts here :)

File third_party/blink/renderer/core/workers/dedicated_worker_global_scope.cc
Line 210, Patchset 13 (Latest): GetRuntimeFeatureStateOverrideContext()->SetDirectSocketsForceEnabled();
Yoshisato Yanagisawa . unresolved

Will this runtime feature state only affects to this Execution Context? Or, can this be more global parameter?

Also, once the flag is enabled, the flag won't be disabled. Is it intended?

Andrew Rayskiy

Yes, this only affects the current execution context; example check for a different feature looks like [this](https://source.chromium.org/chromium/chromium/src/+/main:out/linux-Debug/gen/third_party/blink/renderer/platform/runtime_enabled_features.cc;drc=7e4f7573fb027b6babb7fd8d086b295958b6f731;l=7722) (i.e. it first check the context-scoped override, and then defaults to the global per-process state). So it's intentional that it doesn't get reset.

Line 303, Patchset 13 (Latest): // then set worker global scope's cross-origin isolated capability to false."
Yoshisato Yanagisawa . unresolved

Upon https://html.spec.whatwg.org/#initialize-worker-policy-container, what happens if this is the about scheme?
I assume this step is Step 1 (Maybe updated since it was originally written?)

Or, is the behavior not specced yet?

Andrew Rayskiy

I believe we never spec-ed this. Is this an issue? I was largely hoping to keep the same behavior that `IsolatedContext` currently provides.

Open in Gerrit

Related details

Attention is currently required from:
  • Daniel Cheng
  • Yoshisato Yanagisawa
Gerrit-Attention: Yoshisato Yanagisawa <yyana...@chromium.org>
Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
Gerrit-Comment-Date: Wed, 11 Mar 2026 16:05:58 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Yoshisato Yanagisawa <yyana...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Yoshisato Yanagisawa (Gerrit)

unread,
Mar 13, 2026, 3:27:59 AMMar 13
to Andrew Rayskiy, AI Code Reviewer, Camille Lamy, Daniel Cheng, Luna Lu, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Simon Hangl, iclella...@chromium.org, alexmo...@chromium.org, asvitki...@chromium.org, blink-...@chromium.org, blink-work...@chromium.org, creis...@chromium.org, horo+...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, network-ser...@chromium.org, shimazu...@chromium.org
Attention needed from Andrew Rayskiy and Daniel Cheng

Yoshisato Yanagisawa voted and added 3 comments

Votes added by Yoshisato Yanagisawa

Code-Review+1

3 comments

Patchset-level comments
Yoshisato Yanagisawa . unresolved

I am not convinced the code style storing a flag inside GetRuntimeFeatureStateOverrideContext(). Is it natural way to do?
Also, is there an explainer etc for this behavior? All I can do for the area is verifying the implementation is aligned with the design approved by the security expert. Therefore, I hope to see such design.

Andrew Rayskiy

As I wrote in the very first comment, I'll be happy to see any suggestions for a clearer/less invasive way of propagating the flag to workers.

The idea is outlined in [go/isolated-context-is-fun](http://go/isolated-context-is-fun); IsolatedContext is spec-ed [here](https://wicg.github.io/isolated-web-apps/isolated-contexts.html), Direct Sockets are spec-ed [here](https://wicg.github.io/direct-sockets/); my hope is to have @cl...@chromium.org and @dch...@chromium.org as security experts here :)

Yoshisato Yanagisawa

I feel the implementation reasonable.

File third_party/blink/renderer/core/workers/dedicated_worker_global_scope.cc
Line 210, Patchset 13 (Latest): GetRuntimeFeatureStateOverrideContext()->SetDirectSocketsForceEnabled();
Yoshisato Yanagisawa . resolved

Will this runtime feature state only affects to this Execution Context? Or, can this be more global parameter?

Also, once the flag is enabled, the flag won't be disabled. Is it intended?

Andrew Rayskiy

Yes, this only affects the current execution context; example check for a different feature looks like [this](https://source.chromium.org/chromium/chromium/src/+/main:out/linux-Debug/gen/third_party/blink/renderer/platform/runtime_enabled_features.cc;drc=7e4f7573fb027b6babb7fd8d086b295958b6f731;l=7722) (i.e. it first check the context-scoped override, and then defaults to the global per-process state). So it's intentional that it doesn't get reset.

Yoshisato Yanagisawa

Acknowledged

Line 303, Patchset 13 (Latest): // then set worker global scope's cross-origin isolated capability to false."
Yoshisato Yanagisawa . resolved

Upon https://html.spec.whatwg.org/#initialize-worker-policy-container, what happens if this is the about scheme?
I assume this step is Step 1 (Maybe updated since it was originally written?)

Or, is the behavior not specced yet?

Andrew Rayskiy

I believe we never spec-ed this. Is this an issue? I was largely hoping to keep the same behavior that `IsolatedContext` currently provides.

Yoshisato Yanagisawa

Acknowledged

Open in Gerrit

Related details

Attention is currently required from:
  • Andrew Rayskiy
  • Daniel Cheng
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: I4305965ca5cb8352ac2cc0ebf874d4feac6d1a0e
    Gerrit-Change-Number: 7639669
    Gerrit-PatchSet: 13
    Gerrit-Owner: Andrew Rayskiy <green...@google.com>
    Gerrit-Reviewer: Andrew Rayskiy <green...@google.com>
    Gerrit-Reviewer: Camille Lamy <cl...@chromium.org>
    Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
    Gerrit-Reviewer: Yoshisato Yanagisawa <yyana...@chromium.org>
    Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
    Gerrit-CC: Luna Lu <loon...@chromium.org>
    Gerrit-CC: Simon Hangl <sim...@google.com>
    Gerrit-Attention: Andrew Rayskiy <green...@google.com>
    Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
    Gerrit-Comment-Date: Fri, 13 Mar 2026 07:27:34 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    Comment-In-Reply-To: Andrew Rayskiy <green...@google.com>
    Comment-In-Reply-To: Yoshisato Yanagisawa <yyana...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Daniel Cheng (Gerrit)

    unread,
    Mar 20, 2026, 3:44:41 AMMar 20
    to Andrew Rayskiy, Daniel Cheng, Code Review Nudger, Yoshisato Yanagisawa, AI Code Reviewer, Camille Lamy, Luna Lu, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Simon Hangl, iclella...@chromium.org, alexmo...@chromium.org, asvitki...@chromium.org, blink-...@chromium.org, blink-work...@chromium.org, creis...@chromium.org, horo+...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, network-ser...@chromium.org, shimazu...@chromium.org
    Attention needed from Andrew Rayskiy

    Daniel Cheng voted and added 3 comments

    Votes added by Daniel Cheng

    Code-Review+1

    3 comments

    Patchset-level comments
    Daniel Cheng . resolved

    lgtm w/nits

    File third_party/blink/renderer/core/workers/dedicated_worker_global_scope.cc
    Line 310, Patchset 13 (Latest): GetRuntimeFeatureStateOverrideContext()->SetDirectSocketsForceDisabled();
    Daniel Cheng . unresolved

    I guess I'm a little worried that this will be easy to overlook in the future. Is this specced/documented anywhere?

    File third_party/blink/renderer/core/workers/global_scope_creation_params.h
    Line 87, Patchset 13 (Latest): bool direct_sockets_enabled_in_parent = false,
    Daniel Cheng . unresolved

    is there a reason this doesn't include "forced" here? If so, what's the distinction?

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Andrew Rayskiy
    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: I4305965ca5cb8352ac2cc0ebf874d4feac6d1a0e
    Gerrit-Change-Number: 7639669
    Gerrit-PatchSet: 13
    Gerrit-Owner: Andrew Rayskiy <green...@google.com>
    Gerrit-Reviewer: Andrew Rayskiy <green...@google.com>
    Gerrit-Reviewer: Camille Lamy <cl...@chromium.org>
    Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
    Gerrit-Reviewer: Yoshisato Yanagisawa <yyana...@chromium.org>
    Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
    Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
    Gerrit-CC: Luna Lu <loon...@chromium.org>
    Gerrit-CC: Simon Hangl <sim...@google.com>
    Gerrit-Attention: Andrew Rayskiy <green...@google.com>
    Gerrit-Comment-Date: Fri, 20 Mar 2026 07:44:31 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Andrew Rayskiy (Gerrit)

    unread,
    Mar 31, 2026, 12:45:19 PMMar 31
    to Daniel Cheng, Code Review Nudger, Yoshisato Yanagisawa, AI Code Reviewer, Camille Lamy, Luna Lu, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Simon Hangl, iclella...@chromium.org, alexmo...@chromium.org, asvitki...@chromium.org, blink-...@chromium.org, blink-work...@chromium.org, creis...@chromium.org, horo+...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, network-ser...@chromium.org, shimazu...@chromium.org
    Attention needed from Camille Lamy and Daniel Cheng

    Andrew Rayskiy added 6 comments

    Patchset-level comments
    File-level comment, Patchset 11:
    Andrew Rayskiy . resolved

    Hey folks, PTAL at the respective parts of the stack.

    Camille -- please check `navigation_request.cc` and `//content` changes -- is this the right place to intercept the navigation? Ideally I'd use a `WebContentsObserver`, but I'm not sure where to store it on the `//content` layer.

    Daniel -- please check the flag propagation logic and the overall implementation.

    Yoshisato -- please take a look at the flag override propagation to the dedicated worker & whether it's an acceptable solution :)

    Andrew Rayskiy

    Acknowledged

    File-level comment, Patchset 13:
    Yoshisato Yanagisawa . resolved

    I am not convinced the code style storing a flag inside GetRuntimeFeatureStateOverrideContext(). Is it natural way to do?
    Also, is there an explainer etc for this behavior? All I can do for the area is verifying the implementation is aligned with the design approved by the security expert. Therefore, I hope to see such design.

    Andrew Rayskiy

    As I wrote in the very first comment, I'll be happy to see any suggestions for a clearer/less invasive way of propagating the flag to workers.

    The idea is outlined in [go/isolated-context-is-fun](http://go/isolated-context-is-fun); IsolatedContext is spec-ed [here](https://wicg.github.io/isolated-web-apps/isolated-contexts.html), Direct Sockets are spec-ed [here](https://wicg.github.io/direct-sockets/); my hope is to have @cl...@chromium.org and @dch...@chromium.org as security experts here :)

    Yoshisato Yanagisawa

    I feel the implementation reasonable.

    Andrew Rayskiy

    Acknowledged

    File content/browser/renderer_host/navigation_request.cc
    Line 128, Patchset 11 (Parent):#include "content/public/browser/navigation_controller.h"
    Camille Lamy . resolved

    Why is this include removed?

    Andrew Rayskiy

    Done

    File third_party/blink/renderer/core/workers/dedicated_worker_global_scope.h
    Line 189, Patchset 11: bool direct_sockets_force_enabled_in_parent = false;
    AI Code Reviewer . resolved

    nit: Blink Style Guide: Naming - Precede boolean values with words like “is” and “did”. Consider naming this 'is_direct_sockets_force_enabled_in_parent'.

    To keep this interaction as brief and non-intrusive as possible, please consider responding with one of following options:
    **Done** | **OK But Won't Fix**: reason | **Later**: b/<bug_id> | **Invalid:** reason


    _This comment was generated by [Experimental Blink C++ Code Review Agent](http://go/blink-c++-code-review-agent)._
    _AI reviews can sometimes be inaccurate; We appreciate your 🙏 feedback 🙏 to help us improve._
    _[File a bug](http://go/blink-c++-code-review-agent-feedback) | [Provide feedback on chat](https://chat.google.com/room/AAQA0zhQHe0?cls=4) | [Opt-out](https://ganpati2.corp.google.com/group/peep-genai-blink-agent-optout.prod)_

    Andrew Rayskiy

    Acknowledged

    File third_party/blink/renderer/core/workers/dedicated_worker_global_scope.cc
    Line 310, Patchset 13: GetRuntimeFeatureStateOverrideContext()->SetDirectSocketsForceDisabled();
    Daniel Cheng . unresolved

    I guess I'm a little worried that this will be easy to overlook in the future. Is this specced/documented anywhere?

    Andrew Rayskiy

    I believe the idea was that `IsolatedContext` is an continuation of `CrossOriginIsolated`, hence it mirrors the conditions that reset `cross_origin_isolated_capability_` (and so do direct sockets). It's not specced IIUC.

    File third_party/blink/renderer/core/workers/global_scope_creation_params.h
    Line 87, Patchset 13: bool direct_sockets_enabled_in_parent = false,
    Daniel Cheng . resolved

    is there a reason this doesn't include "forced" here? If so, what's the distinction?

    Andrew Rayskiy

    I simply forgot!

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Camille Lamy
    • Daniel Cheng
    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: I4305965ca5cb8352ac2cc0ebf874d4feac6d1a0e
    Gerrit-Change-Number: 7639669
    Gerrit-PatchSet: 14
    Gerrit-Owner: Andrew Rayskiy <green...@google.com>
    Gerrit-Reviewer: Andrew Rayskiy <green...@google.com>
    Gerrit-Reviewer: Camille Lamy <cl...@chromium.org>
    Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
    Gerrit-Reviewer: Yoshisato Yanagisawa <yyana...@chromium.org>
    Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
    Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
    Gerrit-CC: Luna Lu <loon...@chromium.org>
    Gerrit-CC: Simon Hangl <sim...@google.com>
    Gerrit-Attention: Camille Lamy <cl...@chromium.org>
    Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
    Gerrit-Comment-Date: Tue, 31 Mar 2026 16:45:04 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
    Comment-In-Reply-To: Camille Lamy <cl...@chromium.org>
    Comment-In-Reply-To: Andrew Rayskiy <green...@google.com>
    Comment-In-Reply-To: Yoshisato Yanagisawa <yyana...@chromium.org>
    Comment-In-Reply-To: Daniel Cheng <dch...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Andrew Rayskiy (Gerrit)

    unread,
    Mar 31, 2026, 1:02:20 PMMar 31
    to Daniel Cheng, Code Review Nudger, Yoshisato Yanagisawa, AI Code Reviewer, Camille Lamy, Luna Lu, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Simon Hangl, iclella...@chromium.org, alexmo...@chromium.org, asvitki...@chromium.org, blink-...@chromium.org, blink-work...@chromium.org, creis...@chromium.org, horo+...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, network-ser...@chromium.org, shimazu...@chromium.org
    Attention needed from Camille Lamy and Daniel Cheng

    Andrew Rayskiy added 2 comments

    File services/network/public/cpp/permissions_policy/permissions_policy_features.json5
    Line 329, Patchset 11 (Parent): depends_on: ["DirectSockets"],
    Andrew Rayskiy . resolved

    In the new scheme the flag is enabled once the isolation status of a process has been determined (which happens based on COOP/COEP headers), i.e. after header parsing (so the timing doesn't match).

    I'm also wondering whether it's acceptable to keep the `IsolatedContext` visibility modifier -- it's not really needed in any other embedders, so it's more of a consistency question. @dch...@chromium.org

    Andrew Rayskiy

    (decided to keep this as is)

    File third_party/blink/renderer/core/workers/dedicated_worker_global_scope.cc
    Line 310, Patchset 13: GetRuntimeFeatureStateOverrideContext()->SetDirectSocketsForceDisabled();
    Daniel Cheng . resolved

    I guess I'm a little worried that this will be easy to overlook in the future. Is this specced/documented anywhere?

    Andrew Rayskiy

    I believe the idea was that `IsolatedContext` is an continuation of `CrossOriginIsolated`, hence it mirrors the conditions that reset `cross_origin_isolated_capability_` (and so do direct sockets). It's not specced IIUC.

    Andrew Rayskiy

    (discussed offline -- let's keep the status quo)

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Camille Lamy
    • Daniel Cheng
    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: I4305965ca5cb8352ac2cc0ebf874d4feac6d1a0e
      Gerrit-Change-Number: 7639669
      Gerrit-PatchSet: 14
      Gerrit-Owner: Andrew Rayskiy <green...@google.com>
      Gerrit-Reviewer: Andrew Rayskiy <green...@google.com>
      Gerrit-Reviewer: Camille Lamy <cl...@chromium.org>
      Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
      Gerrit-Reviewer: Yoshisato Yanagisawa <yyana...@chromium.org>
      Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
      Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
      Gerrit-CC: Luna Lu <loon...@chromium.org>
      Gerrit-CC: Simon Hangl <sim...@google.com>
      Gerrit-Attention: Camille Lamy <cl...@chromium.org>
      Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
      Gerrit-Comment-Date: Tue, 31 Mar 2026 17:02:08 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Andrew Rayskiy <green...@google.com>
      Comment-In-Reply-To: Daniel Cheng <dch...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Camille Lamy (Gerrit)

      unread,
      Apr 1, 2026, 4:54:00 AMApr 1
      to Andrew Rayskiy, Daniel Cheng, Code Review Nudger, Yoshisato Yanagisawa, AI Code Reviewer, Luna Lu, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Simon Hangl, iclella...@chromium.org, alexmo...@chromium.org, asvitki...@chromium.org, blink-...@chromium.org, blink-work...@chromium.org, creis...@chromium.org, horo+...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, network-ser...@chromium.org, shimazu...@chromium.org
      Attention needed from Andrew Rayskiy

      Camille Lamy voted and added 1 comment

      Votes added by Camille Lamy

      Code-Review+1

      1 comment

      Patchset-level comments
      Open in Gerrit

      Related details

      Attention is currently required from:
      • Andrew Rayskiy
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement 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: I4305965ca5cb8352ac2cc0ebf874d4feac6d1a0e
      Gerrit-Change-Number: 7639669
      Gerrit-PatchSet: 14
      Gerrit-Owner: Andrew Rayskiy <green...@google.com>
      Gerrit-Reviewer: Andrew Rayskiy <green...@google.com>
      Gerrit-Reviewer: Camille Lamy <cl...@chromium.org>
      Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
      Gerrit-Reviewer: Yoshisato Yanagisawa <yyana...@chromium.org>
      Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
      Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
      Gerrit-CC: Luna Lu <loon...@chromium.org>
      Gerrit-CC: Simon Hangl <sim...@google.com>
      Gerrit-Attention: Andrew Rayskiy <green...@google.com>
      Gerrit-Comment-Date: Wed, 01 Apr 2026 08:53:42 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      satisfied_requirement
      open
      diffy

      Andrew Rayskiy (Gerrit)

      unread,
      Apr 1, 2026, 4:56:33 AMApr 1
      to Camille Lamy, Daniel Cheng, Code Review Nudger, Yoshisato Yanagisawa, AI Code Reviewer, Luna Lu, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Simon Hangl, iclella...@chromium.org, alexmo...@chromium.org, asvitki...@chromium.org, blink-...@chromium.org, blink-work...@chromium.org, creis...@chromium.org, horo+...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, network-ser...@chromium.org, shimazu...@chromium.org

      Andrew Rayskiy voted Commit-Queue+2

      Commit-Queue+2
      Open in Gerrit

      Related details

      Attention set is empty
      Gerrit-Comment-Date: Wed, 01 Apr 2026 08:56:13 +0000
      Gerrit-HasComments: No
      Gerrit-Has-Labels: Yes
      satisfied_requirement
      open
      diffy

      Chromium LUCI CQ (Gerrit)

      unread,
      Apr 1, 2026, 4:59:34 AMApr 1
      to Andrew Rayskiy, Camille Lamy, Daniel Cheng, Code Review Nudger, Yoshisato Yanagisawa, AI Code Reviewer, Luna Lu, AyeAye, chromium...@chromium.org, Simon Hangl, iclella...@chromium.org, alexmo...@chromium.org, asvitki...@chromium.org, blink-...@chromium.org, blink-work...@chromium.org, creis...@chromium.org, horo+...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, network-ser...@chromium.org, shimazu...@chromium.org

      Chromium LUCI CQ submitted the change

      Change information

      Commit message:
      [Direct Sockets] Implement dynamic enablement in Isolated Contexts

      This CL transitions Direct Sockets enablement to a dynamic model as
      described in go/isolated-context-is-fun.

      The goal is to allow Direct Sockets to remain available in
      embedder-defined contexts (such as Chrome Apps, Extensions, and the
      terminal on CrOS) while permitting a future tightening of the
      "Isolated Context" definition that would otherwise hide these APIs.
      Enablement is now explicitly calculated in the browser and propagated
      to the renderer and its dedicated workers.

      (See crrev.com/c/7642623 for a follow-up).

      New Approach:
      - Browser-side calculation in NavigationRequest::ReadyToCommitNavigation
      - Propagation via a new 'direct_sockets_enabled_in_parent' field in
      GlobalScopeCreationParams.
      - Dedicated workers inherit this state from their parent context and
      force-enable the feature in the worker's RuntimeFeatureStateContext
      override.

      Shortcomings & Scope:
      - Shared and Service Workers are currently out of scope and default to
      disabled. Since Direct Sockets were never launched for these types,
      handling them separately is deferred.
      - Permissions-Policy visibility is limited in embedder-defined
      contexts (e.g., Chrome Apps, Extensions, or chrome-untrusted://terminal).
      Capabilities like 'direct-sockets' will be enabled by default, but
      cannot currently be disabled via headers in these contexts. This is
      acceptable as these environments already gate access via manifest
      permissions or internal allowlists.
      - The implementation for dedicated workers is somewhat hacky as it
      manually overrides the runtime feature state during initialization
      to stay in sync with the parent's dynamic enablement.

      NO_IFTTT=No changes to permissions policy exposure
      Change-Id: I4305965ca5cb8352ac2cc0ebf874d4feac6d1a0e
      Bug: 340886976
      Reviewed-by: Yoshisato Yanagisawa <yyana...@chromium.org>
      Reviewed-by: Daniel Cheng <dch...@chromium.org>
      Reviewed-by: Camille Lamy <cl...@chromium.org>
      Commit-Queue: Andrew Rayskiy <green...@google.com>
      Cr-Commit-Position: refs/heads/main@{#1608372}
      Files:
      • M content/browser/renderer_host/navigation_request.cc
      • M services/network/public/cpp/permissions_policy/permissions_policy_features.json5
      • M third_party/blink/renderer/core/exported/web_shared_worker_impl.cc
      • M third_party/blink/renderer/core/permissions_policy/permissions_policy_test.cc
      • M third_party/blink/renderer/core/workers/dedicated_worker.cc
      • M third_party/blink/renderer/core/workers/dedicated_worker_global_scope.cc
      • M third_party/blink/renderer/core/workers/dedicated_worker_global_scope.h
      • M third_party/blink/renderer/core/workers/global_scope_creation_params.cc
      • M third_party/blink/renderer/core/workers/global_scope_creation_params.h
      • M third_party/blink/renderer/modules/direct_sockets/multicast_controller.idl
      • M third_party/blink/renderer/modules/direct_sockets/tcp_server_socket.idl
      • M third_party/blink/renderer/modules/direct_sockets/tcp_socket.idl
      • M third_party/blink/renderer/modules/direct_sockets/udp_socket.idl
      • M third_party/blink/renderer/modules/exported/web_embedded_worker_impl.cc
      • M third_party/blink/renderer/platform/runtime_enabled_features.json5
      Change size: M
      Delta: 15 files changed, 74 insertions(+), 48 deletions(-)
      Branch: refs/heads/main
      Submit Requirements:
      • requirement satisfiedCode-Review: +1 by Daniel Cheng, +1 by Camille Lamy, +1 by Yoshisato Yanagisawa
      Open in Gerrit
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: merged
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I4305965ca5cb8352ac2cc0ebf874d4feac6d1a0e
      Gerrit-Change-Number: 7639669
      Gerrit-PatchSet: 15
      Gerrit-Owner: Andrew Rayskiy <green...@google.com>
      Gerrit-Reviewer: Andrew Rayskiy <green...@google.com>
      Gerrit-Reviewer: Camille Lamy <cl...@chromium.org>
      Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
      Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
      Gerrit-Reviewer: Yoshisato Yanagisawa <yyana...@chromium.org>
      Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
      open
      diffy
      satisfied_requirement
      Reply all
      Reply to author
      Forward
      0 new messages