Remove embedder-defined Isolated Context [chromium/src : main]

1 view
Skip to first unread message

Andrew Rayskiy (Gerrit)

unread,
Apr 1, 2026, 9:03:57 AMApr 1
to Vlad Krot, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Simon Hangl, blink-...@chromium.org, alexmo...@chromium.org, creis...@chromium.org, navigation...@chromium.org
Attention needed from Vlad Krot

New activity on the change

Open in Gerrit

Related details

Attention is currently required from:
  • Vlad Krot
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: I39211cdb3950041852bf80234ce25cd3153eb9c4
Gerrit-Change-Number: 7642623
Gerrit-PatchSet: 15
Gerrit-Owner: Andrew Rayskiy <green...@google.com>
Gerrit-Reviewer: Andrew Rayskiy <green...@google.com>
Gerrit-Reviewer: Vlad Krot <vk...@google.com>
Gerrit-CC: Simon Hangl <sim...@google.com>
Gerrit-Attention: Vlad Krot <vk...@google.com>
Gerrit-Comment-Date: Wed, 01 Apr 2026 13:03:44 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Andrew Rayskiy (Gerrit)

unread,
Apr 1, 2026, 10:00:34 AMApr 1
to Camille Lamy, Vlad Krot, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Simon Hangl, blink-...@chromium.org, alexmo...@chromium.org, creis...@chromium.org, navigation...@chromium.org
Attention needed from Camille Lamy and Vlad Krot

Andrew Rayskiy added 1 comment

Patchset-level comments
File-level comment, Patchset 15 (Latest):
Andrew Rayskiy . resolved

Hey Camille, PTAL at `content/public/` files as well as `navigation_request.cc`.

Open in Gerrit

Related details

Attention is currently required from:
  • Camille Lamy
  • Vlad Krot
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: I39211cdb3950041852bf80234ce25cd3153eb9c4
Gerrit-Change-Number: 7642623
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: Vlad Krot <vk...@google.com>
Gerrit-CC: Simon Hangl <sim...@google.com>
Gerrit-Attention: Camille Lamy <cl...@chromium.org>
Gerrit-Attention: Vlad Krot <vk...@google.com>
Gerrit-Comment-Date: Wed, 01 Apr 2026 14:00:13 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Vlad Krot (Gerrit)

unread,
Apr 1, 2026, 11:09:47 AMApr 1
to Andrew Rayskiy, Camille Lamy, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Simon Hangl, blink-...@chromium.org, alexmo...@chromium.org, creis...@chromium.org, navigation...@chromium.org
Attention needed from Andrew Rayskiy and Camille Lamy

Vlad Krot voted Code-Review+1

Code-Review+1
Open in Gerrit

Related details

Attention is currently required from:
  • Andrew Rayskiy
  • Camille Lamy
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: I39211cdb3950041852bf80234ce25cd3153eb9c4
    Gerrit-Change-Number: 7642623
    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: Vlad Krot <vk...@google.com>
    Gerrit-CC: Simon Hangl <sim...@google.com>
    Gerrit-Attention: Camille Lamy <cl...@chromium.org>
    Gerrit-Attention: Andrew Rayskiy <green...@google.com>
    Gerrit-Comment-Date: Wed, 01 Apr 2026 15:09:25 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Camille Lamy (Gerrit)

    unread,
    Apr 2, 2026, 5:38:48 AMApr 2
    to Andrew Rayskiy, Chris Thompson, Vlad Krot, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Simon Hangl, blink-...@chromium.org, alexmo...@chromium.org, creis...@chromium.org, navigation...@chromium.org
    Attention needed from Andrew Rayskiy and Chris Thompson

    Camille Lamy added 6 comments

    Patchset-level comments
    Camille Lamy . resolved

    Thanks! Adding Chris for a question about the change to direct sockets availability affecting PNA.

    Chris, for the context, the IWA team is splitting the way access to Direct Sockets is granted to contexts. Previously, Chrome Apps would force enable the IsolatedContext state. Now, they instead just force enable the access to Direct Sockets only. As part of this change, there is a modification in this CL that seems to bypass the PNA permission request when the Direct Sockets have been enabled for Chrome Apps (see comment in content/browser/direct_sockets/direct_sockets_service_impl.cc). Could you have a look and validate whether it makes sense to do this change? Thanks!

    Beyond the PNA question, I also have a more general question about the access to Direct Sockets from worker contexts. My read of the CL is that the embedder never gives access to ServiceWorkers. Is that correct? What happens to SharedWorkers and DirectWorkers? And worklet contexts?

    File content/browser/direct_sockets/direct_sockets_service_impl.cc
    Line 94, Patchset 15 (Latest):bool AreDirectSocketsAllowedByEmbedder(RenderFrameHost* rfh) {
    Camille Lamy . unresolved

    nit: For readability, I wonder if it would be possible to have a DirectSocketsPolicy::DirectSocketsAllowedByEmbedderForOrigin static method somewhere that does this and can be used here and in NavigationRequest. This is a nit, so feel free to ignore it.

    Line 162, Patchset 15 (Latest): if (AreDirectSocketsAllowedByEmbedder(rfh)) {
    Camille Lamy . unresolved

    Is it possible to find yourself in a situation where DirectSockets are enabled both by the embedder and because the context is isolated?

    Line 244, Patchset 15 (Latest): if (AreDirectSocketsAllowedByEmbedder(rfh)) {
    Camille Lamy . unresolved

    I think this one should be looked at. Adding chthomp to the review to look at the implications for PNA.

    Line 466, Patchset 15 (Latest): } else if (!AreDirectSocketsAllowedByEmbedder(render_frame_host)) {
    Camille Lamy . unresolved

    nit: maybe add a comment clarifying what is happening as the else (!) condition is not immediately obvious.

    File third_party/blink/renderer/modules/direct_sockets/socket.cc
    Line 111, Patchset 15 (Latest): // Embedder-enabled Direct Sockets run in custom contexts and do not rely on
    Camille Lamy . unresolved

    It would be good to validate here that we are in an embedder enabled custom context with an appropriate CHECK.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Andrew Rayskiy
    • Chris Thompson
    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: I39211cdb3950041852bf80234ce25cd3153eb9c4
      Gerrit-Change-Number: 7642623
      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: Chris Thompson <cth...@chromium.org>
      Gerrit-Reviewer: Vlad Krot <vk...@google.com>
      Gerrit-CC: Simon Hangl <sim...@google.com>
      Gerrit-Attention: Chris Thompson <cth...@chromium.org>
      Gerrit-Attention: Andrew Rayskiy <green...@google.com>
      Gerrit-Comment-Date: Thu, 02 Apr 2026 09:38:34 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Andrew Rayskiy (Gerrit)

      unread,
      Apr 2, 2026, 6:14:13 AMApr 2
      to Chris Thompson, Vlad Krot, Camille Lamy, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Simon Hangl, blink-...@chromium.org, alexmo...@chromium.org, creis...@chromium.org, navigation...@chromium.org
      Attention needed from Camille Lamy and Chris Thompson

      Andrew Rayskiy added 4 comments

      Patchset-level comments
      Camille Lamy . unresolved

      Thanks! Adding Chris for a question about the change to direct sockets availability affecting PNA.

      Chris, for the context, the IWA team is splitting the way access to Direct Sockets is granted to contexts. Previously, Chrome Apps would force enable the IsolatedContext state. Now, they instead just force enable the access to Direct Sockets only. As part of this change, there is a modification in this CL that seems to bypass the PNA permission request when the Direct Sockets have been enabled for Chrome Apps (see comment in content/browser/direct_sockets/direct_sockets_service_impl.cc). Could you have a look and validate whether it makes sense to do this change? Thanks!

      Beyond the PNA question, I also have a more general question about the access to Direct Sockets from worker contexts. My read of the CL is that the embedder never gives access to ServiceWorkers. Is that correct? What happens to SharedWorkers and DirectWorkers? And worklet contexts?

      Andrew Rayskiy

      Attaching my response to the PNA topic here (from another thread):

      ChrApps have historically been exempt from any PNA restrictions -- see the now removed `ShouldAllowPrivateNetworkAccessUnconditionally()` call; there's no behavior change here modulo the permissions-policy check which has no effect for ChrApps whatsoever.

      Direct Sockets are exposed in Windows and Dedicated, Shared, and Service Workers (see the [.idl](https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/modules/direct_sockets/tcp_socket.idl?q=-f:%5Eout%2F%20-f:%5Egen%2F%20-f:%5Esrc%2F%20case:auto%20tcp_socket.idl)), which effectively excludes worklets. However, Shared and Service Workers actually illustrate what happens when a project stalls; we never gained enough momentum to launch the API there due to unresolved permission policy issues. While we had some initial ideas (due to the baseline permissions policy being clearly defined), they never moved forward, leaving us with an unresolved gap :) With that in mind, there's nothing wrong with not moving forward with embedder access in those contexts (as stuff doesn't work there anyway)

      File content/browser/direct_sockets/direct_sockets_service_impl.cc
      Line 162, Patchset 15 (Latest): if (AreDirectSocketsAllowedByEmbedder(rfh)) {
      Camille Lamy . unresolved

      Is it possible to find yourself in a situation where DirectSockets are enabled both by the embedder and because the context is isolated?

      Andrew Rayskiy

      No, these two serve different purposes and cover different sets of origins.

      Line 244, Patchset 15 (Latest): if (AreDirectSocketsAllowedByEmbedder(rfh)) {
      Camille Lamy . unresolved

      I think this one should be looked at. Adding chthomp to the review to look at the implications for PNA.

      Andrew Rayskiy

      ChrApps have historically been exempt from any PNA restrictions -- see the now removed `ShouldAllowPrivateNetworkAccessUnconditionally()` call; there's no behavior change here modulo the permissions-policy check which has no effect for ChrApps whatsoever.

      File third_party/blink/renderer/modules/direct_sockets/socket.cc
      Line 111, Patchset 15 (Latest): // Embedder-enabled Direct Sockets run in custom contexts and do not rely on
      Camille Lamy . unresolved

      It would be good to validate here that we are in an embedder enabled custom context with an appropriate CHECK.

      Andrew Rayskiy

      That's not possible though -- the only signal we get from the browser is whether the runtime flag is enabled or not.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Camille Lamy
      • Chris Thompson
      Gerrit-Attention: Camille Lamy <cl...@chromium.org>
      Gerrit-Comment-Date: Thu, 02 Apr 2026 10:13:58 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Camille Lamy <cl...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Camille Lamy (Gerrit)

      unread,
      Apr 2, 2026, 12:13:38 PMApr 2
      to Andrew Rayskiy, Chris Thompson, Vlad Krot, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Simon Hangl, blink-...@chromium.org, alexmo...@chromium.org, creis...@chromium.org, navigation...@chromium.org
      Attention needed from Andrew Rayskiy and Chris Thompson

      Camille Lamy added 2 comments

      File content/browser/direct_sockets/direct_sockets_service_impl.cc
      Line 162, Patchset 15 (Latest): if (AreDirectSocketsAllowedByEmbedder(rfh)) {
      Camille Lamy . resolved

      Is it possible to find yourself in a situation where DirectSockets are enabled both by the embedder and because the context is isolated?

      Andrew Rayskiy

      No, these two serve different purposes and cover different sets of origins.

      Camille Lamy

      Acknowledged

      File third_party/blink/renderer/modules/direct_sockets/socket.cc
      Line 111, Patchset 15 (Latest): // Embedder-enabled Direct Sockets run in custom contexts and do not rely on
      Camille Lamy . unresolved

      It would be good to validate here that we are in an embedder enabled custom context with an appropriate CHECK.

      Andrew Rayskiy

      That's not possible though -- the only signal we get from the browser is whether the runtime flag is enabled or not.

      Camille Lamy

      And it also gets enabled in the IWA context?

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Andrew Rayskiy
      • Chris Thompson
      Gerrit-Attention: Andrew Rayskiy <green...@google.com>
      Gerrit-Comment-Date: Thu, 02 Apr 2026 16:13:24 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Camille Lamy <cl...@chromium.org>
      Comment-In-Reply-To: Andrew Rayskiy <green...@google.com>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Andrew Rayskiy (Gerrit)

      unread,
      Apr 2, 2026, 12:28:30 PMApr 2
      to Chris Thompson, Vlad Krot, Camille Lamy, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Simon Hangl, blink-...@chromium.org, alexmo...@chromium.org, creis...@chromium.org, navigation...@chromium.org
      Attention needed from Camille Lamy and Chris Thompson

      Andrew Rayskiy added 1 comment

      File third_party/blink/renderer/modules/direct_sockets/socket.cc
      Line 111, Patchset 15 (Latest): // Embedder-enabled Direct Sockets run in custom contexts and do not rely on
      Camille Lamy . unresolved

      It would be good to validate here that we are in an embedder enabled custom context with an appropriate CHECK.

      Andrew Rayskiy

      That's not possible though -- the only signal we get from the browser is whether the runtime flag is enabled or not.

      Camille Lamy

      And it also gets enabled in the IWA context?

      Andrew Rayskiy

      Indeed, that's exactly what happens in `content/browser/renderer_host/navigation_request.cc` -- see the `MutableRuntimeFeatureStateContext()`

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Camille Lamy
      • Chris Thompson
      Gerrit-Attention: Camille Lamy <cl...@chromium.org>
      Gerrit-Comment-Date: Thu, 02 Apr 2026 16:28:10 +0000
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Camille Lamy (Gerrit)

      unread,
      Apr 3, 2026, 5:22:55 AMApr 3
      to Andrew Rayskiy, Chris Thompson, Vlad Krot, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Simon Hangl, blink-...@chromium.org, alexmo...@chromium.org, creis...@chromium.org, navigation...@chromium.org
      Attention needed from Andrew Rayskiy and Chris Thompson

      Camille Lamy added 2 comments

      Patchset-level comments
      Camille Lamy . resolved

      Overall this is good for me, except the interaction with LNA part, on which I am waiting for Chris's opinion. It's quite possible that this it is fine to not check the LNA permission in this case, but I'd like us to explicitly make and document this decision.

      File third_party/blink/renderer/modules/direct_sockets/socket.cc
      Line 111, Patchset 15 (Latest): // Embedder-enabled Direct Sockets run in custom contexts and do not rely on
      Camille Lamy . resolved

      It would be good to validate here that we are in an embedder enabled custom context with an appropriate CHECK.

      Andrew Rayskiy

      That's not possible though -- the only signal we get from the browser is whether the runtime flag is enabled or not.

      Camille Lamy

      And it also gets enabled in the IWA context?

      Andrew Rayskiy

      Indeed, that's exactly what happens in `content/browser/renderer_host/navigation_request.cc` -- see the `MutableRuntimeFeatureStateContext()`

      Camille Lamy

      Acknowledged

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Andrew Rayskiy
      • Chris Thompson
      Gerrit-Attention: Andrew Rayskiy <green...@google.com>
      Gerrit-Comment-Date: Fri, 03 Apr 2026 09:22:38 +0000
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Chris Thompson (Gerrit)

      unread,
      Apr 3, 2026, 1:04:54 PMApr 3
      to Andrew Rayskiy, Vlad Krot, Camille Lamy, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Simon Hangl, blink-...@chromium.org, alexmo...@chromium.org, creis...@chromium.org, navigation...@chromium.org
      Attention needed from Andrew Rayskiy and Camille Lamy

      Chris Thompson voted and added 2 comments

      Votes added by Chris Thompson

      Code-Review+1

      2 comments

      Patchset-level comments
      Chris Thompson . resolved

      Answering the LNA question in-line. I also did a cursory overall review and this seems reasonable (but I did not do a deep code review).

      File content/browser/direct_sockets/direct_sockets_service_impl.cc
      Line 244, Patchset 15 (Latest): if (AreDirectSocketsAllowedByEmbedder(rfh)) {
      Camille Lamy . resolved

      I think this one should be looked at. Adding chthomp to the review to look at the implications for PNA.

      Andrew Rayskiy

      ChrApps have historically been exempt from any PNA restrictions -- see the now removed `ShouldAllowPrivateNetworkAccessUnconditionally()` call; there's no behavior change here modulo the permissions-policy check which has no effect for ChrApps whatsoever.

      Chris Thompson

      I'm comfortable with not worrying about LNA for Chrome Apps. The remaining Chrome Apps are limited and deprecated.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Andrew Rayskiy
      • Camille Lamy
      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: I39211cdb3950041852bf80234ce25cd3153eb9c4
      Gerrit-Change-Number: 7642623
      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: Chris Thompson <cth...@chromium.org>
      Gerrit-Reviewer: Vlad Krot <vk...@google.com>
      Gerrit-CC: Simon Hangl <sim...@google.com>
      Gerrit-Attention: Camille Lamy <cl...@chromium.org>
      Gerrit-Attention: Andrew Rayskiy <green...@google.com>
      Gerrit-Comment-Date: Fri, 03 Apr 2026 17:04:44 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Camille Lamy (Gerrit)

      unread,
      Apr 8, 2026, 6:08:55 AMApr 8
      to Andrew Rayskiy, Chris Thompson, Vlad Krot, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Simon Hangl, blink-...@chromium.org, alexmo...@chromium.org, creis...@chromium.org, navigation...@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
      Camille Lamy . resolved

      Thanks Chris! Lgtm

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Andrew Rayskiy
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement 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: I39211cdb3950041852bf80234ce25cd3153eb9c4
      Gerrit-Change-Number: 7642623
      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: Chris Thompson <cth...@chromium.org>
      Gerrit-Reviewer: Vlad Krot <vk...@google.com>
      Gerrit-CC: Simon Hangl <sim...@google.com>
      Gerrit-Attention: Andrew Rayskiy <green...@google.com>
      Gerrit-Comment-Date: Wed, 08 Apr 2026 10:08:35 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Andrew Rayskiy (Gerrit)

      unread,
      Apr 8, 2026, 12:27:52 PMApr 8
      to Camille Lamy, Chris Thompson, Vlad Krot, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Simon Hangl, blink-...@chromium.org, alexmo...@chromium.org, creis...@chromium.org, navigation...@chromium.org

      Andrew Rayskiy voted and added 3 comments

      Votes added by Andrew Rayskiy

      Commit-Queue+2

      3 comments

      Patchset-level comments
      Camille Lamy . resolved

      Thanks! Adding Chris for a question about the change to direct sockets availability affecting PNA.

      Chris, for the context, the IWA team is splitting the way access to Direct Sockets is granted to contexts. Previously, Chrome Apps would force enable the IsolatedContext state. Now, they instead just force enable the access to Direct Sockets only. As part of this change, there is a modification in this CL that seems to bypass the PNA permission request when the Direct Sockets have been enabled for Chrome Apps (see comment in content/browser/direct_sockets/direct_sockets_service_impl.cc). Could you have a look and validate whether it makes sense to do this change? Thanks!

      Beyond the PNA question, I also have a more general question about the access to Direct Sockets from worker contexts. My read of the CL is that the embedder never gives access to ServiceWorkers. Is that correct? What happens to SharedWorkers and DirectWorkers? And worklet contexts?

      Andrew Rayskiy

      Attaching my response to the PNA topic here (from another thread):

      ChrApps have historically been exempt from any PNA restrictions -- see the now removed `ShouldAllowPrivateNetworkAccessUnconditionally()` call; there's no behavior change here modulo the permissions-policy check which has no effect for ChrApps whatsoever.

      Direct Sockets are exposed in Windows and Dedicated, Shared, and Service Workers (see the [.idl](https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/modules/direct_sockets/tcp_socket.idl?q=-f:%5Eout%2F%20-f:%5Egen%2F%20-f:%5Esrc%2F%20case:auto%20tcp_socket.idl)), which effectively excludes worklets. However, Shared and Service Workers actually illustrate what happens when a project stalls; we never gained enough momentum to launch the API there due to unresolved permission policy issues. While we had some initial ideas (due to the baseline permissions policy being clearly defined), they never moved forward, leaving us with an unresolved gap :) With that in mind, there's nothing wrong with not moving forward with embedder access in those contexts (as stuff doesn't work there anyway)

      Andrew Rayskiy

      Acknowledged

      File content/browser/direct_sockets/direct_sockets_service_impl.cc
      Line 94, Patchset 15 (Latest):bool AreDirectSocketsAllowedByEmbedder(RenderFrameHost* rfh) {
      Camille Lamy . resolved

      nit: For readability, I wonder if it would be possible to have a DirectSocketsPolicy::DirectSocketsAllowedByEmbedderForOrigin static method somewhere that does this and can be used here and in NavigationRequest. This is a nit, so feel free to ignore it.

      Andrew Rayskiy

      Imo it won't change much -- the only difference would be in skipping the delegate presence check.

      Line 466, Patchset 15 (Latest): } else if (!AreDirectSocketsAllowedByEmbedder(render_frame_host)) {
      Camille Lamy . resolved

      nit: maybe add a comment clarifying what is happening as the else (!) condition is not immediately obvious.

      Andrew Rayskiy

      Will do in a follow-up!

      Open in Gerrit

      Related details

      Attention set is empty
      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: I39211cdb3950041852bf80234ce25cd3153eb9c4
        Gerrit-Change-Number: 7642623
        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: Chris Thompson <cth...@chromium.org>
        Gerrit-Reviewer: Vlad Krot <vk...@google.com>
        Gerrit-CC: Simon Hangl <sim...@google.com>
        Gerrit-Comment-Date: Wed, 08 Apr 2026 16:27:32 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: Yes
        satisfied_requirement
        open
        diffy

        Chromium LUCI CQ (Gerrit)

        unread,
        Apr 8, 2026, 1:56:25 PMApr 8
        to Andrew Rayskiy, Camille Lamy, Chris Thompson, Vlad Krot, AyeAye, chromium...@chromium.org, Simon Hangl, blink-...@chromium.org, alexmo...@chromium.org, creis...@chromium.org, navigation...@chromium.org

        Chromium LUCI CQ submitted the change

        Change information

        Commit message:
        Remove embedder-defined Isolated Context

        This CL replaces embedder-defined Isolated Context with on-demand
        enablement logic tailored specifically for Direct Sockets. As such,
        there are now two independent areas where Direct Sockets are exposed:

        * IsolatedContext (<=> Isolated Web Apps): API access is guarded by
        direct-sockets, direct-sockets-private and direct-sockets-multicast
        permissions policies; this is the core context for the API.

        * Embedder-specific contexts (mostly Chrome Apps + selected extensions):
        permissions policies are ignored here, so the system relies on
        ChrApp/extension manifest permissions (the "sockets" field) instead.
        Multicast is not accessible there (as there's no demand for it).

        See crrev.com/c/7639669 for the feature flag propagation flow.
        Bug: 340886976
        Change-Id: I39211cdb3950041852bf80234ce25cd3153eb9c4
        Reviewed-by: Camille Lamy <cl...@chromium.org>
        Reviewed-by: Vlad Krot <vk...@google.com>
        Commit-Queue: Andrew Rayskiy <green...@google.com>
        Reviewed-by: Chris Thompson <cth...@chromium.org>
        Cr-Commit-Position: refs/heads/main@{#1611657}
        Files:
        • M chrome/browser/chrome_content_browser_client.cc
        • M chrome/browser/chrome_content_browser_client.h
        • M chrome/browser/direct_sockets/chrome_direct_sockets_delegate.cc
        • M chrome/browser/direct_sockets/chrome_direct_sockets_delegate.h
        • M chrome/browser/direct_sockets/direct_sockets_apitest.cc
        • M content/browser/direct_sockets/direct_sockets_service_impl.cc
        • M content/browser/renderer_host/navigation_request.cc
        • M content/public/browser/content_browser_client.cc
        • M content/public/browser/content_browser_client.h
        • M content/public/browser/direct_sockets_delegate.h
        • M content/public/browser/isolated_context_util.cc
        • M third_party/blink/renderer/modules/direct_sockets/socket.cc
        • M third_party/blink/renderer/modules/direct_sockets/udp_socket.cc
        Change size: L
        Delta: 13 files changed, 143 insertions(+), 165 deletions(-)
        Branch: refs/heads/main
        Submit Requirements:
        • requirement satisfiedCode-Review: +1 by Camille Lamy, +1 by Vlad Krot, +1 by Chris Thompson
        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: I39211cdb3950041852bf80234ce25cd3153eb9c4
        Gerrit-Change-Number: 7642623
        Gerrit-PatchSet: 16
        Gerrit-Owner: Andrew Rayskiy <green...@google.com>
        Gerrit-Reviewer: Andrew Rayskiy <green...@google.com>
        Gerrit-Reviewer: Camille Lamy <cl...@chromium.org>
        Gerrit-Reviewer: Chris Thompson <cth...@chromium.org>
        Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
        Gerrit-Reviewer: Vlad Krot <vk...@google.com>
        open
        diffy
        satisfied_requirement
        Reply all
        Reply to author
        Forward
        0 new messages