Fenced frame: Network cutoff callback waits for sub-fenced frames. [chromium/src : main]

0 views
Skip to first unread message

Andrew Verge (Gerrit)

unread,
Apr 9, 2024, 4:35:27 PMApr 9
to Liam Brady, Tricium, Garrett Tanzer, Shivani Sharma, Chromium LUCI CQ, chromium...@chromium.org, alexmo...@chromium.org, blink-...@chromium.org, creis...@chromium.org, navigation...@chromium.org
Attention needed from Garrett Tanzer, Liam Brady, Nasko Oskov and Shivani Sharma

Andrew Verge added 3 comments

File content/browser/renderer_host/render_frame_host_impl.cc
Line 9233, Patchset 5: // TODO(averge): Credentialless iframes have their own per-`Page` nonce that
Shivani Sharma . unresolved

Wasn't this TODO handled in https://chromium-review.googlesource.com/c/chromium/src/+/5376066 ?

Andrew Verge

+1

`RevokeNetworkForNonces` will only call this function after both nonces have been tagged for revocation, so there's no extra work to do.

Line 9254, Patchset 8 (Latest): bool network_cutoff_ready = all_children_have_network_cutoff &&
Andrew Verge . unresolved

In the case where we have a fenced frame and an iframe nested underneath it, traversal will hit the iframe first. It will use the properties of the closest ancestor, which is the parent fenced frame, and trigger the revocation callback for it.

The iteration will then move up to the fenced frame itself, but all of the work has been done already when examining the iframe. Can we add a clause like this:

```
// If network has already been disabled for this node previously, ignore it.
if (properties->has_disabled_untrusted_network()) {
continue;
}
```

This prevents a fenced frame tree frame which has already had network fully disabled (meaning, bit is set and callback has been run) from being examined again. Might save some cycles?

Line 9269, Patchset 7: continue;
Andrew Verge . unresolved

Do you need continues? Whether you enter this inner if clause or not, you'll still repeat the loop at the end of `if (network_cutoff_ready)`

Same below.

Open in Gerrit

Related details

Attention is currently required from:
  • Garrett Tanzer
  • Liam Brady
  • Nasko Oskov
  • Shivani Sharma
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I88522ea9d3a7d261124fc740681c27537b056cdb
Gerrit-Change-Number: 5426603
Gerrit-PatchSet: 8
Gerrit-Owner: Liam Brady <lbr...@google.com>
Gerrit-Reviewer: Andrew Verge <ave...@chromium.org>
Gerrit-Reviewer: Garrett Tanzer <gta...@chromium.org>
Gerrit-Reviewer: Liam Brady <lbr...@google.com>
Gerrit-Reviewer: Nasko Oskov <na...@chromium.org>
Gerrit-CC: Shivani Sharma <shiva...@chromium.org>
Gerrit-Attention: Garrett Tanzer <gta...@chromium.org>
Gerrit-Attention: Liam Brady <lbr...@google.com>
Gerrit-Attention: Shivani Sharma <shiva...@chromium.org>
Gerrit-Attention: Nasko Oskov <na...@chromium.org>
Gerrit-Comment-Date: Tue, 09 Apr 2024 20:35:13 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Shivani Sharma <shiva...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Liam Brady (Gerrit)

unread,
Apr 9, 2024, 5:21:27 PMApr 9
to Tricium, Garrett Tanzer, Andrew Verge, Shivani Sharma, Chromium LUCI CQ, chromium...@chromium.org, alexmo...@chromium.org, blink-...@chromium.org, creis...@chromium.org, navigation...@chromium.org
Attention needed from Andrew Verge, Garrett Tanzer, Nasko Oskov and Shivani Sharma

Liam Brady added 7 comments

Commit Message
Line 7, Patchset 5:Fenced frame: Network cutoff callback waits for subframes.
Shivani Sharma . resolved

nit: sub-fenced frames

Liam Brady

Done

Line 13, Patchset 5:accessed until all subframes have also cut off their own network.
Shivani Sharma . resolved

nit: sub-fenced frames here and in other places.

Liam Brady

Done

Line 19, Patchset 5:network cutoff has truly kicked in. In other words, once all subframes
in a fenced frame tree have had their network cut off, only then will
Shivani Sharma . resolved

nested fenced frame start their own FF tree, so this sounds confusing and seems to handle iframes. Suggest rephrasing to:
"once all sub-fenced frame trees have had..."

Liam Brady

Done

Line 34, Patchset 5:The function that determines the network cutoff status involves a
recursive depth-first traversal of the entire frame tree (including
crossing fenced frame boundaries) to see if any subframes still have
Shivani Sharma . resolved

I haven't yet looked at the code, but can we instead recompute the ancestor FFs' disable

Liam Brady

We need to look at each frame, since a fenced frame's same-origin child iframe could've been the frame that called `disableUntrustedNetwork()`, which would require calling the resolve callback housed in that `RenderFrameHost`'s `FencedDocumentData`.

I think we can do what Andrew's suggesting [here](https://chromium-review.googlesource.com/c/chromium/src/+/5426603/comment/cef6b2f2_9efb7e0e/) to avoid repeating work.

File content/browser/renderer_host/render_frame_host_impl.cc
Line 9233, Patchset 5: // TODO(averge): Credentialless iframes have their own per-`Page` nonce that
Shivani Sharma . resolved

Wasn't this TODO handled in https://chromium-review.googlesource.com/c/chromium/src/+/5376066 ?

Andrew Verge

+1

`RevokeNetworkForNonces` will only call this function after both nonces have been tagged for revocation, so there's no extra work to do.

Liam Brady

Done

Line 9254, Patchset 8: bool network_cutoff_ready = all_children_have_network_cutoff &&
Andrew Verge . resolved

In the case where we have a fenced frame and an iframe nested underneath it, traversal will hit the iframe first. It will use the properties of the closest ancestor, which is the parent fenced frame, and trigger the revocation callback for it.

The iteration will then move up to the fenced frame itself, but all of the work has been done already when examining the iframe. Can we add a clause like this:

```
// If network has already been disabled for this node previously, ignore it.
if (properties->has_disabled_untrusted_network()) {
continue;
}
```

This prevents a fenced frame tree frame which has already had network fully disabled (meaning, bit is set and callback has been run) from being examined again. Might save some cycles?

Liam Brady

We still need to run any callbacks registered in the `RenderFrameHost`'s `FencedDocumentData`, but I can add this to save some redundant processing.

Andrew Verge . resolved

Do you need continues? Whether you enter this inner if clause or not, you'll still repeat the loop at the end of `if (network_cutoff_ready)`

Same below.

Liam Brady

Done

Open in Gerrit

Related details

Attention is currently required from:
  • Andrew Verge
  • Garrett Tanzer
  • Nasko Oskov
  • Shivani Sharma
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Review
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: I88522ea9d3a7d261124fc740681c27537b056cdb
Gerrit-Change-Number: 5426603
Gerrit-PatchSet: 9
Gerrit-Owner: Liam Brady <lbr...@google.com>
Gerrit-Reviewer: Andrew Verge <ave...@chromium.org>
Gerrit-Reviewer: Garrett Tanzer <gta...@chromium.org>
Gerrit-Reviewer: Liam Brady <lbr...@google.com>
Gerrit-Reviewer: Nasko Oskov <na...@chromium.org>
Gerrit-CC: Shivani Sharma <shiva...@chromium.org>
Gerrit-Attention: Garrett Tanzer <gta...@chromium.org>
Gerrit-Attention: Andrew Verge <ave...@chromium.org>
Gerrit-Attention: Shivani Sharma <shiva...@chromium.org>
Gerrit-Attention: Nasko Oskov <na...@chromium.org>
Gerrit-Comment-Date: Tue, 09 Apr 2024 21:21:16 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Andrew Verge <ave...@chromium.org>
Comment-In-Reply-To: Shivani Sharma <shiva...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Shivani Sharma (Gerrit)

unread,
Apr 10, 2024, 4:51:47 PMApr 10
to Liam Brady, Tricium, Garrett Tanzer, Andrew Verge, Chromium LUCI CQ, chromium...@chromium.org, alexmo...@chromium.org, blink-...@chromium.org, creis...@chromium.org, navigation...@chromium.org
Attention needed from Andrew Verge, Garrett Tanzer, Liam Brady and Nasko Oskov

Shivani Sharma added 2 comments

File content/browser/fenced_frame/fenced_frame_config.h
Line 642, Patchset 10 (Latest): bool is_partition_nonce_revoked_ = false;

// Whether this fenced frame has had its network access cut off (i.e., if this
// is true, untrusted network access should be disabled and access to
// unpartitioned storage should be enabled.)
bool has_disabled_untrusted_network_ = false;
Shivani Sharma . unresolved

both of these are states of the progress of disableUntrustedNetwork so suggest putting them in an enum. Using kCurrentFrameTreeComplete for is_partition_nonce_revoked_

`enum class DisableUntrustedNetworkStatus {
kNotStarted,
kCurrentFrameTreeComplete,
kCurrentAndNestedFrameTreesComplete
}`
Line 586, Patchset 10 (Latest): // The nonce that will be included in the IsolationInfo for network requests
Shivani Sharma . unresolved

replace the rest of the comment with "IsolationInfo, CookiePartitionKey and StorageKey for network, cookie and storage partitioning, respectively. As part of IsolationInfo it is also used to identify which network requests should be disallowed in the network service if the initiator fenced frame tree has had its network cutoff via disableUntrustedNetwork()."

Open in Gerrit

Related details

Attention is currently required from:
  • Andrew Verge
  • Garrett Tanzer
  • Liam Brady
  • Nasko Oskov
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I88522ea9d3a7d261124fc740681c27537b056cdb
    Gerrit-Change-Number: 5426603
    Gerrit-PatchSet: 10
    Gerrit-Owner: Liam Brady <lbr...@google.com>
    Gerrit-Reviewer: Andrew Verge <ave...@chromium.org>
    Gerrit-Reviewer: Garrett Tanzer <gta...@chromium.org>
    Gerrit-Reviewer: Liam Brady <lbr...@google.com>
    Gerrit-Reviewer: Nasko Oskov <na...@chromium.org>
    Gerrit-CC: Shivani Sharma <shiva...@chromium.org>
    Gerrit-Attention: Garrett Tanzer <gta...@chromium.org>
    Gerrit-Attention: Andrew Verge <ave...@chromium.org>
    Gerrit-Attention: Liam Brady <lbr...@google.com>
    Gerrit-Attention: Nasko Oskov <na...@chromium.org>
    Gerrit-Comment-Date: Wed, 10 Apr 2024 20:51:39 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Garrett Tanzer (Gerrit)

    unread,
    Apr 11, 2024, 11:55:52 AMApr 11
    to Liam Brady, Tricium, Andrew Verge, Shivani Sharma, Chromium LUCI CQ, chromium...@chromium.org, alexmo...@chromium.org, blink-...@chromium.org, creis...@chromium.org, navigation...@chromium.org
    Attention needed from Andrew Verge, Liam Brady and Shivani Sharma

    Garrett Tanzer added 2 comments

    File content/browser/fenced_frame/fenced_frame_config.h
    Line 642, Patchset 10 (Latest): bool is_partition_nonce_revoked_ = false;

    // Whether this fenced frame has had its network access cut off (i.e., if this
    // is true, untrusted network access should be disabled and access to
    // unpartitioned storage should be enabled.)
    bool has_disabled_untrusted_network_ = false;
    Shivani Sharma . unresolved

    both of these are states of the progress of disableUntrustedNetwork so suggest putting them in an enum. Using kCurrentFrameTreeComplete for is_partition_nonce_revoked_

    `enum class DisableUntrustedNetworkStatus {
    kNotStarted,
    kCurrentFrameTreeComplete,
    kCurrentAndNestedFrameTreesComplete
    }`
    Garrett Tanzer

    +1

    File third_party/blink/web_tests/wpt_internal/fenced_frame/disable-untrusted-network-nested.https.html
    Line 7, Patchset 10 (Latest):<script src="resources/utils.js"></script>
    Garrett Tanzer . unresolved

    I think at least some of the WPT test cases could be integrated into the existing shared storage get() tests:

    For example, there is a TODO explicitly for this:
    https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/web_tests/wpt_internal/fenced_frame/content-shared-storage-get.https.html;l=123

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Andrew Verge
    • Liam Brady
    • Shivani Sharma
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I88522ea9d3a7d261124fc740681c27537b056cdb
    Gerrit-Change-Number: 5426603
    Gerrit-PatchSet: 10
    Gerrit-Owner: Liam Brady <lbr...@google.com>
    Gerrit-Reviewer: Andrew Verge <ave...@chromium.org>
    Gerrit-Reviewer: Garrett Tanzer <gta...@chromium.org>
    Gerrit-Reviewer: Liam Brady <lbr...@google.com>
    Gerrit-Reviewer: Nasko Oskov <na...@chromium.org>
    Gerrit-CC: Shivani Sharma <shiva...@chromium.org>
    Gerrit-Attention: Andrew Verge <ave...@chromium.org>
    Gerrit-Attention: Liam Brady <lbr...@google.com>
    Gerrit-Attention: Shivani Sharma <shiva...@chromium.org>
    Gerrit-Comment-Date: Thu, 11 Apr 2024 15:55:42 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Shivani Sharma <shiva...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Andrew Verge (Gerrit)

    unread,
    Apr 11, 2024, 3:36:19 PMApr 11
    to Liam Brady, Tricium, Garrett Tanzer, Shivani Sharma, Chromium LUCI CQ, chromium...@chromium.org, alexmo...@chromium.org, blink-...@chromium.org, creis...@chromium.org, navigation...@chromium.org
    Attention needed from Liam Brady and Shivani Sharma

    Andrew Verge added 1 comment

    File third_party/blink/web_tests/wpt_internal/fenced_frame/disable-untrusted-network-nested.https.html
    Line 25, Patchset 10 (Latest): could_call_get = true;
    Andrew Verge . unresolved

    You can skip all the `could_call_get` stuff by adding an `assert_unreached()` at this line instead. If the get() completes successfully, the assert will be executed next, which will throw immediately.

    Then you can double check the type of error in the catch, and make sure it's not `AssertionError`, I believe

    https://web-platform-tests.org/writing-tests/testharness-api.html#assert_unreached

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Liam Brady
    • Shivani Sharma
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I88522ea9d3a7d261124fc740681c27537b056cdb
    Gerrit-Change-Number: 5426603
    Gerrit-PatchSet: 10
    Gerrit-Owner: Liam Brady <lbr...@google.com>
    Gerrit-Reviewer: Andrew Verge <ave...@chromium.org>
    Gerrit-Reviewer: Garrett Tanzer <gta...@chromium.org>
    Gerrit-Reviewer: Liam Brady <lbr...@google.com>
    Gerrit-Reviewer: Nasko Oskov <na...@chromium.org>
    Gerrit-CC: Shivani Sharma <shiva...@chromium.org>
    Gerrit-Attention: Liam Brady <lbr...@google.com>
    Gerrit-Attention: Shivani Sharma <shiva...@chromium.org>
    Gerrit-Comment-Date: Thu, 11 Apr 2024 19:36:04 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Liam Brady (Gerrit)

    unread,
    Apr 11, 2024, 5:47:48 PMApr 11
    to Tricium, Garrett Tanzer, Andrew Verge, Shivani Sharma, Chromium LUCI CQ, chromium...@chromium.org, alexmo...@chromium.org, blink-...@chromium.org, creis...@chromium.org, navigation...@chromium.org
    Attention needed from Andrew Verge, Garrett Tanzer and Shivani Sharma

    Liam Brady added 4 comments

    File content/browser/fenced_frame/fenced_frame_config.h
    Line 642, Patchset 10: bool is_partition_nonce_revoked_ = false;


    // Whether this fenced frame has had its network access cut off (i.e., if this
    // is true, untrusted network access should be disabled and access to
    // unpartitioned storage should be enabled.)
    bool has_disabled_untrusted_network_ = false;
    Shivani Sharma . resolved

    both of these are states of the progress of disableUntrustedNetwork so suggest putting them in an enum. Using kCurrentFrameTreeComplete for is_partition_nonce_revoked_

    `enum class DisableUntrustedNetworkStatus {
    kNotStarted,
    kCurrentFrameTreeComplete,
    kCurrentAndNestedFrameTreesComplete
    }`
    Garrett Tanzer

    +1

    Liam Brady

    Done

    Line 586, Patchset 10: // The nonce that will be included in the IsolationInfo for network requests
    Shivani Sharma . resolved

    replace the rest of the comment with "IsolationInfo, CookiePartitionKey and StorageKey for network, cookie and storage partitioning, respectively. As part of IsolationInfo it is also used to identify which network requests should be disallowed in the network service if the initiator fenced frame tree has had its network cutoff via disableUntrustedNetwork()."

    Liam Brady

    Done

    File third_party/blink/web_tests/wpt_internal/fenced_frame/disable-untrusted-network-nested.https.html
    Line 7, Patchset 10:<script src="resources/utils.js"></script>
    Garrett Tanzer . resolved

    I think at least some of the WPT test cases could be integrated into the existing shared storage get() tests:

    For example, there is a TODO explicitly for this:
    https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/web_tests/wpt_internal/fenced_frame/content-shared-storage-get.https.html;l=123

    Liam Brady

    Done

    Line 25, Patchset 10: could_call_get = true;
    Andrew Verge . resolved

    You can skip all the `could_call_get` stuff by adding an `assert_unreached()` at this line instead. If the get() completes successfully, the assert will be executed next, which will throw immediately.

    Then you can double check the type of error in the catch, and make sure it's not `AssertionError`, I believe

    https://web-platform-tests.org/writing-tests/testharness-api.html#assert_unreached

    Liam Brady

    Resolving since I'm merging this test into the test in `content-shared-storage-get.https.html`, which already does that.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Andrew Verge
    • Garrett Tanzer
    • Shivani Sharma
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Review
    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: I88522ea9d3a7d261124fc740681c27537b056cdb
    Gerrit-Change-Number: 5426603
    Gerrit-PatchSet: 13
    Gerrit-Owner: Liam Brady <lbr...@google.com>
    Gerrit-Reviewer: Andrew Verge <ave...@chromium.org>
    Gerrit-Reviewer: Garrett Tanzer <gta...@chromium.org>
    Gerrit-Reviewer: Liam Brady <lbr...@google.com>
    Gerrit-Reviewer: Nasko Oskov <na...@chromium.org>
    Gerrit-CC: Shivani Sharma <shiva...@chromium.org>
    Gerrit-Attention: Garrett Tanzer <gta...@chromium.org>
    Gerrit-Attention: Andrew Verge <ave...@chromium.org>
    Gerrit-Attention: Shivani Sharma <shiva...@chromium.org>
    Gerrit-Comment-Date: Thu, 11 Apr 2024 21:47:37 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Garrett Tanzer <gta...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Garrett Tanzer (Gerrit)

    unread,
    Apr 12, 2024, 10:08:00 AMApr 12
    to Liam Brady, Tricium, Andrew Verge, Shivani Sharma, Chromium LUCI CQ, chromium...@chromium.org, alexmo...@chromium.org, blink-...@chromium.org, creis...@chromium.org, navigation...@chromium.org
    Attention needed from Andrew Verge, Liam Brady and Shivani Sharma

    Garrett Tanzer added 3 comments

    File content/browser/fenced_frame/fenced_frame_config.h
    Line 539, Patchset 13 (Latest): bool HasDisabledUntrustedNetwork() const {
    Garrett Tanzer . unresolved

    I would rather keep the names of these accessors similar to the enums. It's not really clear that "HasDisabledUntrustedNetwork" applies to all descendants.

    `HasDisabledNetworkForCurrentFrameTree`
    `HasDisabledNetworkForCurrentAndDescendantFrameTrees`

    Line 216, Patchset 13 (Latest): kCurrentAndNestedFrameTreesComplete
    Garrett Tanzer . unresolved

    can we say `Descendant` instead of `Nested`, since nested could mean 1 level of nesting only

    Line 215, Patchset 13 (Latest): // Set after all descendant fenced frames have had network cutoff.
    Garrett Tanzer . unresolved

    nit: cutoff -> cut off.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Andrew Verge
    • Liam Brady
    • Shivani Sharma
    Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I88522ea9d3a7d261124fc740681c27537b056cdb
      Gerrit-Change-Number: 5426603
      Gerrit-PatchSet: 13
      Gerrit-Owner: Liam Brady <lbr...@google.com>
      Gerrit-Reviewer: Andrew Verge <ave...@chromium.org>
      Gerrit-Reviewer: Garrett Tanzer <gta...@chromium.org>
      Gerrit-Reviewer: Liam Brady <lbr...@google.com>
      Gerrit-Reviewer: Nasko Oskov <na...@chromium.org>
      Gerrit-CC: Shivani Sharma <shiva...@chromium.org>
      Gerrit-Attention: Andrew Verge <ave...@chromium.org>
      Gerrit-Attention: Liam Brady <lbr...@google.com>
      Gerrit-Attention: Shivani Sharma <shiva...@chromium.org>
      Gerrit-Comment-Date: Fri, 12 Apr 2024 14:07:48 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Liam Brady (Gerrit)

      unread,
      Apr 12, 2024, 11:31:15 AMApr 12
      to Tricium, Garrett Tanzer, Andrew Verge, Shivani Sharma, Chromium LUCI CQ, chromium...@chromium.org, alexmo...@chromium.org, blink-...@chromium.org, creis...@chromium.org, navigation...@chromium.org
      Attention needed from Andrew Verge, Garrett Tanzer and Shivani Sharma

      Liam Brady added 3 comments

      File content/browser/fenced_frame/fenced_frame_config.h
      Line 539, Patchset 13: bool HasDisabledUntrustedNetwork() const {
      Garrett Tanzer . resolved

      I would rather keep the names of these accessors similar to the enums. It's not really clear that "HasDisabledUntrustedNetwork" applies to all descendants.

      `HasDisabledNetworkForCurrentFrameTree`
      `HasDisabledNetworkForCurrentAndDescendantFrameTrees`

      Liam Brady

      Done

      Line 216, Patchset 13: kCurrentAndNestedFrameTreesComplete
      Garrett Tanzer . resolved

      can we say `Descendant` instead of `Nested`, since nested could mean 1 level of nesting only

      Liam Brady

      Done

      Line 215, Patchset 13: // Set after all descendant fenced frames have had network cutoff.
      Garrett Tanzer . resolved

      nit: cutoff -> cut off.

      Liam Brady

      Done

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Andrew Verge
      • Garrett Tanzer
      • Shivani Sharma
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Review
      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: I88522ea9d3a7d261124fc740681c27537b056cdb
      Gerrit-Change-Number: 5426603
      Gerrit-PatchSet: 14
      Gerrit-Owner: Liam Brady <lbr...@google.com>
      Gerrit-Reviewer: Andrew Verge <ave...@chromium.org>
      Gerrit-Reviewer: Garrett Tanzer <gta...@chromium.org>
      Gerrit-Reviewer: Liam Brady <lbr...@google.com>
      Gerrit-Reviewer: Nasko Oskov <na...@chromium.org>
      Gerrit-CC: Shivani Sharma <shiva...@chromium.org>
      Gerrit-Attention: Garrett Tanzer <gta...@chromium.org>
      Gerrit-Attention: Andrew Verge <ave...@chromium.org>
      Gerrit-Attention: Shivani Sharma <shiva...@chromium.org>
      Gerrit-Comment-Date: Fri, 12 Apr 2024 15:31:01 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Garrett Tanzer <gta...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Shivani Sharma (Gerrit)

      unread,
      Apr 12, 2024, 12:04:43 PMApr 12
      to Liam Brady, Tricium, Garrett Tanzer, Andrew Verge, Chromium LUCI CQ, chromium...@chromium.org, alexmo...@chromium.org, blink-...@chromium.org, creis...@chromium.org, navigation...@chromium.org
      Attention needed from Andrew Verge, Garrett Tanzer and Liam Brady

      Shivani Sharma added 5 comments

      File content/browser/fenced_frame/fenced_frame_config.h
      Line 545, Patchset 14 (Latest): void MarkPartitionNonceRevoked() {
      Shivani Sharma . unresolved

      For consistency, MarkDisabledNetworkForCurrentFrameTree() and MarkDisabledNetworkForCurrentAndDescendantFrameTrees() for the next function.

      Line 535, Patchset 14 (Latest): return disable_untrusted_network_status_ !=
      DisableUntrustedNetworkStatus::kNotStarted;
      Shivani Sharma . unresolved

      disable_untrusted_network_status_ == DisableUntrustedNetworkStatus::kCurrentFrameTreeComplete

      File content/browser/renderer_host/render_frame_host_impl.h
      Line 4124, Patchset 14 (Latest): // revocation can only happen when network access has been disabled for its
      // FencedFrameProperties' partition_nonce_ as well as for all of its
      // descendants. This is calculated for all FrameTreeNodes, including nodes
      Shivani Sharma . unresolved

      Since disabling network is not just nonce-based, let's rephrase this to:
      "// Network revocation can only happen when network access has been disabled for this fenced frame tree as well as for all of its descendant fenced frame trees."

      and then the next sentence can be removed since it's redundant.

      File content/browser/renderer_host/render_frame_host_impl.cc
      Line 9283, Patchset 14 (Latest): // If we are not in a frame tree with a FencedFrameProperties, then network
      // cutoff isn't possible.
      Shivani Sharma . unresolved

      what about urn-iframes. They will have FencedFrameProperties but still network cut-off isn't possible?

      Line 9297, Patchset 14 (Latest): fenced_document_data->RunDisabledUntrustedNetworkCallbacks();
      Shivani Sharma . unresolved

      shouldn't RunDisabledUntrustedNetworkCallbacks only get called when properties->MarkUntrustedNetworkDisabled() is called?

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Andrew Verge
      • Garrett Tanzer
      • Liam Brady
      Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement is not satisfiedCode-Review
        • requirement is not satisfiedNo-Unresolved-Comments
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: I88522ea9d3a7d261124fc740681c27537b056cdb
        Gerrit-Change-Number: 5426603
        Gerrit-PatchSet: 14
        Gerrit-Owner: Liam Brady <lbr...@google.com>
        Gerrit-Reviewer: Andrew Verge <ave...@chromium.org>
        Gerrit-Reviewer: Garrett Tanzer <gta...@chromium.org>
        Gerrit-Reviewer: Liam Brady <lbr...@google.com>
        Gerrit-Reviewer: Nasko Oskov <na...@chromium.org>
        Gerrit-Reviewer: Shivani Sharma <shiva...@chromium.org>
        Gerrit-Attention: Garrett Tanzer <gta...@chromium.org>
        Gerrit-Attention: Andrew Verge <ave...@chromium.org>
        Gerrit-Attention: Liam Brady <lbr...@google.com>
        Gerrit-Comment-Date: Fri, 12 Apr 2024 16:04:11 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Andrew Verge (Gerrit)

        unread,
        Apr 12, 2024, 12:26:02 PMApr 12
        to Liam Brady, Shivani Sharma, Tricium, Garrett Tanzer, Chromium LUCI CQ, chromium...@chromium.org, alexmo...@chromium.org, blink-...@chromium.org, creis...@chromium.org, navigation...@chromium.org
        Attention needed from Garrett Tanzer, Liam Brady and Shivani Sharma

        Andrew Verge added 1 comment

        File content/browser/renderer_host/render_frame_host_impl.cc
        Line 9283, Patchset 14 (Latest): // If we are not in a frame tree with a FencedFrameProperties, then network
        // cutoff isn't possible.
        Shivani Sharma . unresolved

        what about urn-iframes. They will have FencedFrameProperties but still network cut-off isn't possible?

        Andrew Verge

        Could we just skip checking the URN iframe properties, and use `GetFencedFrameProperties(kFrameTreeRoot)` unconditionally?

        • If this traversal hits a fenced frame or any of its descendant iframes of any type, the revocation check will be done for the fenced frame root's properties.
        • If a child frame revokes network on behalf of the fenced frame root, all other frames in the tree will hit the clause on line 9291 and continue until we exit the fenced frame
        • If network is not ready to be revoked, then each parent frame will propagate that bit up via `node_ids_with_network_allowed_descendants`, same as right now.
        Open in Gerrit

        Related details

        Attention is currently required from:
        • Garrett Tanzer
        • Liam Brady
        • Shivani Sharma
        Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement is not satisfiedCode-Review
        • requirement is not satisfiedNo-Unresolved-Comments
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: I88522ea9d3a7d261124fc740681c27537b056cdb
        Gerrit-Change-Number: 5426603
        Gerrit-PatchSet: 14
        Gerrit-Owner: Liam Brady <lbr...@google.com>
        Gerrit-Reviewer: Andrew Verge <ave...@chromium.org>
        Gerrit-Reviewer: Garrett Tanzer <gta...@chromium.org>
        Gerrit-Reviewer: Liam Brady <lbr...@google.com>
        Gerrit-Reviewer: Nasko Oskov <na...@chromium.org>
        Gerrit-Reviewer: Shivani Sharma <shiva...@chromium.org>
        Gerrit-Attention: Garrett Tanzer <gta...@chromium.org>
        Gerrit-Attention: Liam Brady <lbr...@google.com>
        Gerrit-Attention: Shivani Sharma <shiva...@chromium.org>
        Gerrit-Comment-Date: Fri, 12 Apr 2024 16:25:49 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        Comment-In-Reply-To: Shivani Sharma <shiva...@chromium.org>
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Garrett Tanzer (Gerrit)

        unread,
        Apr 12, 2024, 12:28:21 PMApr 12
        to Liam Brady, Shivani Sharma, Tricium, Andrew Verge, Chromium LUCI CQ, chromium...@chromium.org, alexmo...@chromium.org, blink-...@chromium.org, creis...@chromium.org, navigation...@chromium.org
        Attention needed from Andrew Verge, Liam Brady and Shivani Sharma

        Garrett Tanzer added 1 comment

        File content/browser/renderer_host/render_frame_host_impl.cc
        Line 9283, Patchset 14 (Latest): // If we are not in a frame tree with a FencedFrameProperties, then network
        // cutoff isn't possible.
        Shivani Sharma . unresolved

        what about urn-iframes. They will have FencedFrameProperties but still network cut-off isn't possible?

        Andrew Verge

        Could we just skip checking the URN iframe properties, and use `GetFencedFrameProperties(kFrameTreeRoot)` unconditionally?

        • If this traversal hits a fenced frame or any of its descendant iframes of any type, the revocation check will be done for the fenced frame root's properties.
        • If a child frame revokes network on behalf of the fenced frame root, all other frames in the tree will hit the clause on line 9291 and continue until we exit the fenced frame
        • If network is not ready to be revoked, then each parent frame will propagate that bit up via `node_ids_with_network_allowed_descendants`, same as right now.
        Garrett Tanzer

        Yup, we should use kFrameTreeRoot, good catch

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Andrew Verge
        • Liam Brady
        • Shivani Sharma
        Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement is not satisfiedCode-Review
        • requirement is not satisfiedNo-Unresolved-Comments
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: I88522ea9d3a7d261124fc740681c27537b056cdb
        Gerrit-Change-Number: 5426603
        Gerrit-PatchSet: 14
        Gerrit-Owner: Liam Brady <lbr...@google.com>
        Gerrit-Reviewer: Andrew Verge <ave...@chromium.org>
        Gerrit-Reviewer: Garrett Tanzer <gta...@chromium.org>
        Gerrit-Reviewer: Liam Brady <lbr...@google.com>
        Gerrit-Reviewer: Nasko Oskov <na...@chromium.org>
        Gerrit-Reviewer: Shivani Sharma <shiva...@chromium.org>
        Gerrit-Attention: Andrew Verge <ave...@chromium.org>
        Gerrit-Attention: Liam Brady <lbr...@google.com>
        Gerrit-Attention: Shivani Sharma <shiva...@chromium.org>
        Gerrit-Comment-Date: Fri, 12 Apr 2024 16:28:04 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Liam Brady (Gerrit)

        unread,
        Apr 12, 2024, 12:47:27 PMApr 12
        to Shivani Sharma, Tricium, Garrett Tanzer, Andrew Verge, Chromium LUCI CQ, chromium...@chromium.org, alexmo...@chromium.org, blink-...@chromium.org, creis...@chromium.org, navigation...@chromium.org
        Attention needed from Andrew Verge, Garrett Tanzer and Shivani Sharma

        Liam Brady added 5 comments

        File content/browser/fenced_frame/fenced_frame_config.h
        Line 545, Patchset 14: void MarkPartitionNonceRevoked() {
        Shivani Sharma . resolved

        For consistency, MarkDisabledNetworkForCurrentFrameTree() and MarkDisabledNetworkForCurrentAndDescendantFrameTrees() for the next function.

        Liam Brady

        Done

        Line 535, Patchset 14: return disable_untrusted_network_status_ !=
        DisableUntrustedNetworkStatus::kNotStarted;
        Shivani Sharma . resolved

        disable_untrusted_network_status_ == DisableUntrustedNetworkStatus::kCurrentFrameTreeComplete

        Liam Brady

        For documentation sake, the reason why this is fine is because `CalculateUntrustedNetworkStatus()` has a check for `HasDisabledNetworkForCurrentAndDescendantFrameTrees` with a `continue;` before we check `HasDisabledNetworkForCurrentFrameTree`. There's no point in this CL where we need to check that either of the 2 states are in place, so it's fine to have `HasDisabledNetworkForCurrentFrameTree` be exclusively checking if the current frame tree is disabled but descendant trees are not.

        File content/browser/renderer_host/render_frame_host_impl.h
        Line 4124, Patchset 14: // revocation can only happen when network access has been disabled for its

        // FencedFrameProperties' partition_nonce_ as well as for all of its
        // descendants. This is calculated for all FrameTreeNodes, including nodes
        Shivani Sharma . resolved

        Since disabling network is not just nonce-based, let's rephrase this to:
        "// Network revocation can only happen when network access has been disabled for this fenced frame tree as well as for all of its descendant fenced frame trees."

        and then the next sentence can be removed since it's redundant.

        Liam Brady

        Done

        File content/browser/renderer_host/render_frame_host_impl.cc
        Line 9283, Patchset 14: // If we are not in a frame tree with a FencedFrameProperties, then network

        // cutoff isn't possible.
        Shivani Sharma . resolved

        what about urn-iframes. They will have FencedFrameProperties but still network cut-off isn't possible?

        Liam Brady

        This is referring to the fact that we don't need to calculate anything since there are no ancestors that could potentially have their network cut off. I'll update the comment to clarify.

        I'll also use `kFrameTreeRoot` for the traversal.

        Line 9297, Patchset 14: fenced_document_data->RunDisabledUntrustedNetworkCallbacks();
        Shivani Sharma . resolved

        shouldn't RunDisabledUntrustedNetworkCallbacks only get called when properties->MarkUntrustedNetworkDisabled() is called?

        Liam Brady

        If you have a fenced frame (A1) that has a child iframe (A2), and both frames call `window.fence.disableUntrustedNetwork()`, the promise for both A1 and A2 need to resolve. Since the promise is saved to the `FencedDocumentData`, and since the A1 and A2 documents will have their own distinct `FencedDocumentData`, we need to call the relevant callbacks for each document associated with the `FencedFrameConfig`.

        This is verified with the last test in `content-shared-storage-get-nested.https.html`.

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Andrew Verge
        • Garrett Tanzer
        • Shivani Sharma
        Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement is not satisfiedCode-Review
        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: I88522ea9d3a7d261124fc740681c27537b056cdb
        Gerrit-Change-Number: 5426603
        Gerrit-PatchSet: 15
        Gerrit-Owner: Liam Brady <lbr...@google.com>
        Gerrit-Reviewer: Andrew Verge <ave...@chromium.org>
        Gerrit-Reviewer: Garrett Tanzer <gta...@chromium.org>
        Gerrit-Reviewer: Liam Brady <lbr...@google.com>
        Gerrit-Reviewer: Nasko Oskov <na...@chromium.org>
        Gerrit-Reviewer: Shivani Sharma <shiva...@chromium.org>
        Gerrit-Attention: Garrett Tanzer <gta...@chromium.org>
        Gerrit-Attention: Andrew Verge <ave...@chromium.org>
        Gerrit-Attention: Shivani Sharma <shiva...@chromium.org>
        Gerrit-Comment-Date: Fri, 12 Apr 2024 16:47:13 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        Comment-In-Reply-To: Shivani Sharma <shiva...@chromium.org>
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Andrew Verge (Gerrit)

        unread,
        Apr 16, 2024, 10:54:19 AMApr 16
        to Liam Brady, Shivani Sharma, Tricium, Garrett Tanzer, Chromium LUCI CQ, chromium...@chromium.org, alexmo...@chromium.org, blink-...@chromium.org, creis...@chromium.org, navigation...@chromium.org
        Attention needed from Garrett Tanzer, Liam Brady and Shivani Sharma

        Andrew Verge voted and added 1 comment

        Votes added by Andrew Verge

        Code-Review+1

        1 comment

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

        Giving my LGTM for WPTs, CalculateUntrustedNetworkStatus, and shared_storage_browsertest, since those were requested of me in the initial review comment and/or offline discussion. Will defer to the other reviewers for the remaining files.

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Garrett Tanzer
        • Liam Brady
        • Shivani Sharma
        Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement satisfiedCode-Review
        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: I88522ea9d3a7d261124fc740681c27537b056cdb
        Gerrit-Change-Number: 5426603
        Gerrit-PatchSet: 15
        Gerrit-Owner: Liam Brady <lbr...@google.com>
        Gerrit-Reviewer: Andrew Verge <ave...@chromium.org>
        Gerrit-Reviewer: Garrett Tanzer <gta...@chromium.org>
        Gerrit-Reviewer: Liam Brady <lbr...@google.com>
        Gerrit-Reviewer: Nasko Oskov <na...@chromium.org>
        Gerrit-Reviewer: Shivani Sharma <shiva...@chromium.org>
        Gerrit-Attention: Garrett Tanzer <gta...@chromium.org>
        Gerrit-Attention: Liam Brady <lbr...@google.com>
        Gerrit-Attention: Shivani Sharma <shiva...@chromium.org>
        Gerrit-Comment-Date: Tue, 16 Apr 2024 14:53:57 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: Yes
        satisfied_requirement
        open
        diffy

        Garrett Tanzer (Gerrit)

        unread,
        Apr 18, 2024, 11:16:03 AMApr 18
        to Liam Brady, Andrew Verge, Shivani Sharma, Tricium, Chromium LUCI CQ, chromium...@chromium.org, alexmo...@chromium.org, blink-...@chromium.org, creis...@chromium.org, navigation...@chromium.org
        Attention needed from Liam Brady and Shivani Sharma

        Garrett Tanzer added 2 comments

        Patchset-level comments
        Garrett Tanzer . resolved

        will lgtm once the WPT comment is addressed

        File third_party/blink/web_tests/wpt_internal/fenced_frame/content-shared-storage-get.https.html
        Line 123, Patchset 15 (Parent): let disable_network_promise = window.fence.disableUntrustedNetwork();
        Garrett Tanzer . unresolved

        As the TODO says, this test should still exist. It should just use a timeout to check that disableUntrustedNetwork doesn't resolve, then attempt to access shared storage get (which should fail, even though network for the current frame tree is disabled).

        You might also want to do a fetch here and in the nested fenced frame to confirm that network is disabled in the parent but not the child.

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Liam Brady
        • Shivani Sharma
        Submit Requirements:
          • requirement satisfiedCode-Coverage
          • requirement satisfiedCode-Review
          • requirement is not satisfiedNo-Unresolved-Comments
          Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
          Gerrit-MessageType: comment
          Gerrit-Project: chromium/src
          Gerrit-Branch: main
          Gerrit-Change-Id: I88522ea9d3a7d261124fc740681c27537b056cdb
          Gerrit-Change-Number: 5426603
          Gerrit-PatchSet: 15
          Gerrit-Owner: Liam Brady <lbr...@google.com>
          Gerrit-Reviewer: Andrew Verge <ave...@chromium.org>
          Gerrit-Reviewer: Garrett Tanzer <gta...@chromium.org>
          Gerrit-Reviewer: Liam Brady <lbr...@google.com>
          Gerrit-Reviewer: Nasko Oskov <na...@chromium.org>
          Gerrit-Reviewer: Shivani Sharma <shiva...@chromium.org>
          Gerrit-Attention: Liam Brady <lbr...@google.com>
          Gerrit-Attention: Shivani Sharma <shiva...@chromium.org>
          Gerrit-Comment-Date: Thu, 18 Apr 2024 15:15:53 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: No
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Liam Brady (Gerrit)

          unread,
          Apr 18, 2024, 1:17:38 PMApr 18
          to Andrew Verge, Shivani Sharma, Tricium, Garrett Tanzer, Chromium LUCI CQ, chromium...@chromium.org, alexmo...@chromium.org, blink-...@chromium.org, creis...@chromium.org, navigation...@chromium.org
          Attention needed from Garrett Tanzer and Shivani Sharma

          Liam Brady added 1 comment

          File third_party/blink/web_tests/wpt_internal/fenced_frame/content-shared-storage-get.https.html
          Line 123, Patchset 15 (Parent): let disable_network_promise = window.fence.disableUntrustedNetwork();
          Garrett Tanzer . resolved

          As the TODO says, this test should still exist. It should just use a timeout to check that disableUntrustedNetwork doesn't resolve, then attempt to access shared storage get (which should fail, even though network for the current frame tree is disabled).

          You might also want to do a fetch here and in the nested fenced frame to confirm that network is disabled in the parent but not the child.

          Liam Brady

          Done

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Garrett Tanzer
          • Shivani Sharma
          Submit Requirements:
          • requirement satisfiedCode-Coverage
          • requirement satisfiedCode-Review
          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: I88522ea9d3a7d261124fc740681c27537b056cdb
          Gerrit-Change-Number: 5426603
          Gerrit-PatchSet: 17
          Gerrit-Owner: Liam Brady <lbr...@google.com>
          Gerrit-Reviewer: Andrew Verge <ave...@chromium.org>
          Gerrit-Reviewer: Garrett Tanzer <gta...@chromium.org>
          Gerrit-Reviewer: Liam Brady <lbr...@google.com>
          Gerrit-Reviewer: Nasko Oskov <na...@chromium.org>
          Gerrit-Reviewer: Shivani Sharma <shiva...@chromium.org>
          Gerrit-Attention: Garrett Tanzer <gta...@chromium.org>
          Gerrit-Attention: Shivani Sharma <shiva...@chromium.org>
          Gerrit-Comment-Date: Thu, 18 Apr 2024 17:17:24 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: No
          Comment-In-Reply-To: Garrett Tanzer <gta...@chromium.org>
          satisfied_requirement
          open
          diffy

          Garrett Tanzer (Gerrit)

          unread,
          Apr 18, 2024, 1:54:40 PMApr 18
          to Liam Brady, Andrew Verge, Shivani Sharma, Tricium, Chromium LUCI CQ, chromium...@chromium.org, alexmo...@chromium.org, blink-...@chromium.org, creis...@chromium.org, navigation...@chromium.org
          Attention needed from Liam Brady and Shivani Sharma

          Garrett Tanzer voted Code-Review+1

          Code-Review+1
          Open in Gerrit

          Related details

          Attention is currently required from:
          • Liam Brady
          • Shivani Sharma
          Submit Requirements:
          • requirement satisfiedCode-Coverage
          • requirement satisfiedCode-Review
          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: I88522ea9d3a7d261124fc740681c27537b056cdb
          Gerrit-Change-Number: 5426603
          Gerrit-PatchSet: 17
          Gerrit-Owner: Liam Brady <lbr...@google.com>
          Gerrit-Reviewer: Andrew Verge <ave...@chromium.org>
          Gerrit-Reviewer: Garrett Tanzer <gta...@chromium.org>
          Gerrit-Reviewer: Liam Brady <lbr...@google.com>
          Gerrit-Reviewer: Nasko Oskov <na...@chromium.org>
          Gerrit-Reviewer: Shivani Sharma <shiva...@chromium.org>
          Gerrit-Attention: Liam Brady <lbr...@google.com>
          Gerrit-Attention: Shivani Sharma <shiva...@chromium.org>
          Gerrit-Comment-Date: Thu, 18 Apr 2024 17:54:30 +0000
          Gerrit-HasComments: No
          Gerrit-Has-Labels: Yes
          satisfied_requirement
          open
          diffy

          Liam Brady (Gerrit)

          unread,
          Apr 18, 2024, 2:08:19 PMApr 18
          to Alex Moshchuk, Garrett Tanzer, Andrew Verge, Shivani Sharma, Tricium, Chromium LUCI CQ, chromium...@chromium.org, alexmo...@chromium.org, blink-...@chromium.org, creis...@chromium.org, navigation...@chromium.org
          Attention needed from Alex Moshchuk and Shivani Sharma

          Liam Brady added 1 comment

          Patchset-level comments
          File-level comment, Patchset 17 (Latest):
          Liam Brady . resolved

          Removing nasko@ from the reviewers list since he's OOO.

          alexmos@: PTAL at the following files:

          • render_frame_host_impl.h
          • render_frame_host_impl.cc
          • shared_storage_browsertest.cc

          Thanks!

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Alex Moshchuk
          • Shivani Sharma
          Submit Requirements:
          • requirement satisfiedCode-Coverage
          • requirement satisfiedCode-Review
          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: I88522ea9d3a7d261124fc740681c27537b056cdb
          Gerrit-Change-Number: 5426603
          Gerrit-PatchSet: 17
          Gerrit-Owner: Liam Brady <lbr...@google.com>
          Gerrit-Reviewer: Alex Moshchuk <ale...@chromium.org>
          Gerrit-Reviewer: Andrew Verge <ave...@chromium.org>
          Gerrit-Reviewer: Garrett Tanzer <gta...@chromium.org>
          Gerrit-Reviewer: Liam Brady <lbr...@google.com>
          Gerrit-Reviewer: Shivani Sharma <shiva...@chromium.org>
          Gerrit-Attention: Alex Moshchuk <ale...@chromium.org>
          Gerrit-Attention: Shivani Sharma <shiva...@chromium.org>
          Gerrit-Comment-Date: Thu, 18 Apr 2024 18:08:08 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: No
          satisfied_requirement
          open
          diffy

          Alex Moshchuk (Gerrit)

          unread,
          Apr 18, 2024, 7:29:28 PMApr 18
          to Liam Brady, Garrett Tanzer, Andrew Verge, Shivani Sharma, Tricium, Chromium LUCI CQ, chromium...@chromium.org, alexmo...@chromium.org, blink-...@chromium.org, creis...@chromium.org, navigation...@chromium.org
          Attention needed from Liam Brady and Shivani Sharma

          Alex Moshchuk added 5 comments

          File content/browser/fenced_frame/fenced_document_data.h
          Line 76, Patchset 17 (Latest): // vector to account for the web platform having multiple calls to
          Alex Moshchuk . unresolved

          nit: "supporting"?

          File content/browser/fenced_frame/fenced_frame_config.h
          Line 616, Patchset 17 (Latest): // tree has had its network cutoff via disableUntrustedNetwork().
          Alex Moshchuk . unresolved

          nit: "cut off"

          Line 546, Patchset 17 (Latest): CHECK(can_disable_untrusted_network_);
          Alex Moshchuk . unresolved

          Can we check that disable_untrusted_network_status_ isn't kCurrentAndDescendantFrameTreesComplete at this point, i.e. that we aren't relaxing it by accident?

          File content/browser/renderer_host/render_frame_host_impl.cc
          Line 1091, Patchset 17 (Latest): ->HasDisabledNetworkForCurrentAndDescendantFrameTrees()) {
          Alex Moshchuk . unresolved

          Why wouldn't cases like this use HasDisabledNetworkForCurrentFrameTree(), since on first glance, no new navigations should happen in the current FF once it has disabled network, regardless of descendants, and also the error message only talks about the current fenced frame's network? Is this because for HasDisabledNetworkForCurrentFrameTree(), unpartitioned storage hasn't been granted to the current FF yet (due to descendants still having network), and may never be granted if a descendant FF never disables its network, so you don't want to block navigations out of the current FF forever? Seems worth explaining in a comment somewhere, basically when you would use HasDisabledNetworkForCurrentFrameTree() vs HasDisabledNetworkForCurrentAndDescendantFrameTrees() to gate access to features that require network access. (similarly below)

          Line 9312, Patchset 17 (Latest): properties->MarkDisabledNetworkForCurrentAndDescendantFrameTrees();
          Alex Moshchuk . unresolved

          I'm having trouble following this logic for more complex hierarchies. Consider the following case: A(FF1(B(C)),FF2). So, A embeds a fenced frame, which embeds an iframe B and a nested FF2, and B further embeds C. The list of nodes would be {A,FF1,B,FF2,C} (breadth-first, per https://source.chromium.org/chromium/chromium/src/+/main:content/browser/renderer_host/frame_tree.cc;l=84;drc=a009c99eedf0ee26bfbf0dd0cfef48c7db4cc679), and when reversed it would be {C,FF2,B,FF1,A}. Suppose FF1 disables network and we get here and start with C. Wouldn't we immediately reach this line and mark FF1 as MarkDisabledNetworkForCurrentAndDescendantFrameTrees(), even though we haven't heard anything from FF2?

          Could we add a browser or unit test for exercising how CalculateUntrustedNetworkStatus() handles some complicated hierarchies like this?

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Liam Brady
          • Shivani Sharma
          Submit Requirements:
            • requirement satisfiedCode-Coverage
            • requirement satisfiedCode-Review
            • requirement is not satisfiedNo-Unresolved-Comments
            Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
            Gerrit-MessageType: comment
            Gerrit-Project: chromium/src
            Gerrit-Branch: main
            Gerrit-Change-Id: I88522ea9d3a7d261124fc740681c27537b056cdb
            Gerrit-Change-Number: 5426603
            Gerrit-PatchSet: 17
            Gerrit-Owner: Liam Brady <lbr...@google.com>
            Gerrit-Reviewer: Alex Moshchuk <ale...@chromium.org>
            Gerrit-Reviewer: Andrew Verge <ave...@chromium.org>
            Gerrit-Reviewer: Garrett Tanzer <gta...@chromium.org>
            Gerrit-Reviewer: Liam Brady <lbr...@google.com>
            Gerrit-Reviewer: Shivani Sharma <shiva...@chromium.org>
            Gerrit-Attention: Liam Brady <lbr...@google.com>
            Gerrit-Attention: Shivani Sharma <shiva...@chromium.org>
            Gerrit-Comment-Date: Thu, 18 Apr 2024 23:29:17 +0000
            Gerrit-HasComments: Yes
            Gerrit-Has-Labels: No
            satisfied_requirement
            unsatisfied_requirement
            open
            diffy

            Liam Brady (Gerrit)

            unread,
            Apr 19, 2024, 4:31:12 PMApr 19
            to Alex Moshchuk, Garrett Tanzer, Andrew Verge, Shivani Sharma, Tricium, Chromium LUCI CQ, chromium...@chromium.org, alexmo...@chromium.org, blink-...@chromium.org, creis...@chromium.org, navigation...@chromium.org
            Attention needed from Alex Moshchuk, Andrew Verge, Garrett Tanzer and Shivani Sharma

            Liam Brady added 5 comments

            File content/browser/fenced_frame/fenced_document_data.h
            Line 76, Patchset 17: // vector to account for the web platform having multiple calls to
            Alex Moshchuk . resolved

            nit: "supporting"?

            Liam Brady

            Done

            File content/browser/fenced_frame/fenced_frame_config.h
            Line 616, Patchset 17: // tree has had its network cutoff via disableUntrustedNetwork().
            Alex Moshchuk . resolved

            nit: "cut off"

            Liam Brady

            Done

            Line 546, Patchset 17: CHECK(can_disable_untrusted_network_);
            Alex Moshchuk . resolved

            Can we check that disable_untrusted_network_status_ isn't kCurrentAndDescendantFrameTreesComplete at this point, i.e. that we aren't relaxing it by accident?

            Liam Brady

            There's currently nothing that checks this, but I agree that this should be in place. I'll add an early return to `RenderFrameHostImpl::RevokeNetworkForNonceCallback` (doing it in the callback to prevent race conditions) and the `CHECK` here.

            File content/browser/renderer_host/render_frame_host_impl.cc
            Line 1091, Patchset 17: ->HasDisabledNetworkForCurrentAndDescendantFrameTrees()) {
            Alex Moshchuk . resolved

            Why wouldn't cases like this use HasDisabledNetworkForCurrentFrameTree(), since on first glance, no new navigations should happen in the current FF once it has disabled network, regardless of descendants, and also the error message only talks about the current fenced frame's network? Is this because for HasDisabledNetworkForCurrentFrameTree(), unpartitioned storage hasn't been granted to the current FF yet (due to descendants still having network), and may never be granted if a descendant FF never disables its network, so you don't want to block navigations out of the current FF forever? Seems worth explaining in a comment somewhere, basically when you would use HasDisabledNetworkForCurrentFrameTree() vs HasDisabledNetworkForCurrentAndDescendantFrameTrees() to gate access to features that require network access. (similarly below)

            Liam Brady

            This should definitely be disabled as soon as `disableUntrustedNetwork()` is called for the fenced frame, regardless of the status of its children. This also matches what's in the design doc (as well as the current impl behavior):

            (Preferred) Network is disabled immediately, and all requests in progress are canceled.
            Network is disabled immediately, and requests in progress may complete, but no further packets will be sent out from the device.

            https://docs.google.com/document/d/1EXmjSTje26inf1BkVVLZdhMNTQClHmBzzcoo_sMsSa4/edit?usp=sharing&resourcekey=0-7HXN4Y3Fro4b6Si3GwxpxQ

            Good catch.

            I've also updated some WPTs to check this case.

            Line 9312, Patchset 17: properties->MarkDisabledNetworkForCurrentAndDescendantFrameTrees();
            Alex Moshchuk . resolved

            I'm having trouble following this logic for more complex hierarchies. Consider the following case: A(FF1(B(C)),FF2). So, A embeds a fenced frame, which embeds an iframe B and a nested FF2, and B further embeds C. The list of nodes would be {A,FF1,B,FF2,C} (breadth-first, per https://source.chromium.org/chromium/chromium/src/+/main:content/browser/renderer_host/frame_tree.cc;l=84;drc=a009c99eedf0ee26bfbf0dd0cfef48c7db4cc679), and when reversed it would be {C,FF2,B,FF1,A}. Suppose FF1 disables network and we get here and start with C. Wouldn't we immediately reach this line and mark FF1 as MarkDisabledNetworkForCurrentAndDescendantFrameTrees(), even though we haven't heard anything from FF2?

            Could we add a browser or unit test for exercising how CalculateUntrustedNetworkStatus() handles some complicated hierarchies like this?

            Liam Brady

            Wouldn't we immediately reach this line and mark FF1 as MarkDisabledNetworkForCurrentAndDescendantFrameTrees(), even though we haven't heard anything from FF2?

            Yes. I think what we need to do instead is only set the bit and run the callbacks on the fenced frame root, once we've had a chance to look at all its descendants.

            So this means that the loop will continue for `C` and `B`, and will run for `FF2` and `FF1`. If either `C` or `B` were the ones that called `disableUntrustedNetwork()`, their callbacks will now get put into the `FencedDocumentData` of `FF1`.

            Open in Gerrit

            Related details

            Attention is currently required from:
            • Alex Moshchuk
            • Andrew Verge
            • Garrett Tanzer
            • Shivani Sharma
            Submit Requirements:
            • requirement satisfiedCode-Coverage
            • requirement is not satisfiedCode-Review
            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: I88522ea9d3a7d261124fc740681c27537b056cdb
            Gerrit-Change-Number: 5426603
            Gerrit-PatchSet: 18
            Gerrit-Owner: Liam Brady <lbr...@google.com>
            Gerrit-Reviewer: Alex Moshchuk <ale...@chromium.org>
            Gerrit-Reviewer: Andrew Verge <ave...@chromium.org>
            Gerrit-Reviewer: Garrett Tanzer <gta...@chromium.org>
            Gerrit-Reviewer: Liam Brady <lbr...@google.com>
            Gerrit-Reviewer: Shivani Sharma <shiva...@chromium.org>
            Gerrit-Attention: Garrett Tanzer <gta...@chromium.org>
            Gerrit-Attention: Andrew Verge <ave...@chromium.org>
            Gerrit-Attention: Alex Moshchuk <ale...@chromium.org>
            Gerrit-Attention: Shivani Sharma <shiva...@chromium.org>
            Gerrit-Comment-Date: Fri, 19 Apr 2024 20:31:02 +0000
            Gerrit-HasComments: Yes
            Gerrit-Has-Labels: No
            Comment-In-Reply-To: Alex Moshchuk <ale...@chromium.org>
            satisfied_requirement
            unsatisfied_requirement
            open
            diffy

            Alex Moshchuk (Gerrit)

            unread,
            Apr 22, 2024, 9:42:00 PMApr 22
            to Liam Brady, Garrett Tanzer, Andrew Verge, Shivani Sharma, Tricium, Chromium LUCI CQ, chromium...@chromium.org, alexmo...@chromium.org, blink-...@chromium.org, creis...@chromium.org, navigation...@chromium.org
            Attention needed from Andrew Verge, Garrett Tanzer, Liam Brady and Shivani Sharma

            Alex Moshchuk added 7 comments

            Patchset-level comments
            File-level comment, Patchset 18 (Latest):
            Alex Moshchuk . resolved

            Thanks, a couple more comments about tests and adding/removing fenced frames in the middle of all this.

            File content/browser/fenced_frame/fenced_frame_browsertest.cc
            Line 5142, Patchset 18 (Latest):}
            Alex Moshchuk . unresolved

            Thanks for adding this test. Can you also check the state on the second FF, which should also have both HasDisabledNetworkForCurrentFrameTree and HasDisabledNetworkForCurrentAndDescendantFrameTrees as true at this point?

            File content/browser/renderer_host/render_frame_host_impl.cc
            Line 9268, Patchset 18 (Latest): // the frame tree, as an ancestor's revocation status could've changed as a
            Alex Moshchuk . unresolved

            There may be some unnecessary work here for sibling FFs, e.g. with A(FF1(FF2),FF3,FF4), disabling network in FF2 only needs to recalculate FF2 and FF1, not FF3 or FF4. But it's probably easiest to just recalculate the whole tree?

            Line 9276, Patchset 18 (Latest):void RenderFrameHostImpl::CalculateUntrustedNetworkStatus() {
            Alex Moshchuk . resolved

            FWIW, this reminds me of what we do for collecting beforeunload/unload ACKs before proceeding with navigation or frame detach (things like PendingDeletionCheckCompletedOnSubtree(), etc). No need to change your approach, just wanted to provide context about how we've dealt with this kind of problem in the past in slightly different ways if you haven't seen it.

            Line 9300, Patchset 18 (Latest): // FrameTreeNode.
            Alex Moshchuk . unresolved

            Is it allowed to add a nested FF (without necessarily navigating it) after the network has already been disabled, such that the value of HasDisabledNetworkForCurrentAndDescendantFrameTrees() may change due to the extra new descendant appearing?

            Similarly, what about A(FF1(FF2)), FF1 disables network access, and then removes FF2. That seems like it should also trigger running this function, since FF1 should now MarkDisabledNetworkForCurrentAndDescendantFrameTrees()?

            Probably would be good to cover these in tests too.

            Line 9312, Patchset 17: properties->MarkDisabledNetworkForCurrentAndDescendantFrameTrees();
            Alex Moshchuk . unresolved

            I'm having trouble following this logic for more complex hierarchies. Consider the following case: A(FF1(B(C)),FF2). So, A embeds a fenced frame, which embeds an iframe B and a nested FF2, and B further embeds C. The list of nodes would be {A,FF1,B,FF2,C} (breadth-first, per https://source.chromium.org/chromium/chromium/src/+/main:content/browser/renderer_host/frame_tree.cc;l=84;drc=a009c99eedf0ee26bfbf0dd0cfef48c7db4cc679), and when reversed it would be {C,FF2,B,FF1,A}. Suppose FF1 disables network and we get here and start with C. Wouldn't we immediately reach this line and mark FF1 as MarkDisabledNetworkForCurrentAndDescendantFrameTrees(), even though we haven't heard anything from FF2?

            Could we add a browser or unit test for exercising how CalculateUntrustedNetworkStatus() handles some complicated hierarchies like this?

            Liam Brady

            Wouldn't we immediately reach this line and mark FF1 as MarkDisabledNetworkForCurrentAndDescendantFrameTrees(), even though we haven't heard anything from FF2?

            Yes. I think what we need to do instead is only set the bit and run the callbacks on the fenced frame root, once we've had a chance to look at all its descendants.

            So this means that the loop will continue for `C` and `B`, and will run for `FF2` and `FF1`. If either `C` or `B` were the ones that called `disableUntrustedNetwork()`, their callbacks will now get put into the `FencedDocumentData` of `FF1`.

            Alex Moshchuk

            Thanks for fixing this and adding a test for it. The new version seems like it should work.

            Can you please also add a test to validate the ordering and DisabledForCurrent/DisabledForCurrentAndDescendant for a similar scenario but with two independent chains of FFs that are disabling network, which are possible IIUC? For example:

            • A(FF1(FF2),FF3(FF4))
            • FF1 disables network, no callbacks run
            • FF4 disables network, FF4 callbacks run
            • FF3 disables network, FF3 callbacks run
            • FF2 disables network, FF2 and FF1 callbacks run
            Line 9323, Patchset 18 (Latest): // ancestor fenced frames will be ready for network cutoff either.
            Alex Moshchuk . unresolved

            The code doesn't actually check that GetParentOrOuterDocument()->GetMainFrame() is a fenced frame; it could be a regular frame (e.g., top frame). Is that ok, since we'll probably just not use it?

            Open in Gerrit

            Related details

            Attention is currently required from:
            • Andrew Verge
            • Garrett Tanzer
            • Liam Brady
            • Shivani Sharma
            Submit Requirements:
              • requirement satisfiedCode-Coverage
              • requirement is not satisfiedCode-Review
              • requirement is not satisfiedNo-Unresolved-Comments
              Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
              Gerrit-MessageType: comment
              Gerrit-Project: chromium/src
              Gerrit-Branch: main
              Gerrit-Change-Id: I88522ea9d3a7d261124fc740681c27537b056cdb
              Gerrit-Change-Number: 5426603
              Gerrit-PatchSet: 18
              Gerrit-Owner: Liam Brady <lbr...@google.com>
              Gerrit-Reviewer: Alex Moshchuk <ale...@chromium.org>
              Gerrit-Reviewer: Andrew Verge <ave...@chromium.org>
              Gerrit-Reviewer: Garrett Tanzer <gta...@chromium.org>
              Gerrit-Reviewer: Liam Brady <lbr...@google.com>
              Gerrit-Reviewer: Shivani Sharma <shiva...@chromium.org>
              Gerrit-Attention: Garrett Tanzer <gta...@chromium.org>
              Gerrit-Attention: Andrew Verge <ave...@chromium.org>
              Gerrit-Attention: Liam Brady <lbr...@google.com>
              Gerrit-Attention: Shivani Sharma <shiva...@chromium.org>
              Gerrit-Comment-Date: Tue, 23 Apr 2024 01:41:49 +0000
              Gerrit-HasComments: Yes
              Gerrit-Has-Labels: No
              Comment-In-Reply-To: Liam Brady <lbr...@google.com>
              Comment-In-Reply-To: Alex Moshchuk <ale...@chromium.org>
              satisfied_requirement
              unsatisfied_requirement
              open
              diffy

              Liam Brady (Gerrit)

              unread,
              Apr 23, 2024, 12:44:08 PMApr 23
              to Alex Moshchuk, Garrett Tanzer, Andrew Verge, Shivani Sharma, Tricium, Chromium LUCI CQ, chromium...@chromium.org, alexmo...@chromium.org, blink-...@chromium.org, creis...@chromium.org, navigation...@chromium.org
              Attention needed from Alex Moshchuk, Andrew Verge, Garrett Tanzer and Shivani Sharma

              Liam Brady added 5 comments

              File content/browser/fenced_frame/fenced_frame_browsertest.cc
              Line 5142, Patchset 18:}
              Alex Moshchuk . resolved

              Thanks for adding this test. Can you also check the state on the second FF, which should also have both HasDisabledNetworkForCurrentFrameTree and HasDisabledNetworkForCurrentAndDescendantFrameTrees as true at this point?

              Liam Brady

              Done

              File content/browser/renderer_host/render_frame_host_impl.cc
              Line 9268, Patchset 18: // the frame tree, as an ancestor's revocation status could've changed as a
              Alex Moshchuk . resolved

              There may be some unnecessary work here for sibling FFs, e.g. with A(FF1(FF2),FF3,FF4), disabling network in FF2 only needs to recalculate FF2 and FF1, not FF3 or FF4. But it's probably easiest to just recalculate the whole tree?

              Liam Brady

              If `A` were instead a fenced frame, giving us `FF0(FF1(FF2),FF3,FF4)`, we would still need to look at `FF3` and `FF4` to check if their network has been cut off to determine if `FF0` can have network cutoff as well. I think the extra work to figure out what frames actually need to be looked at isn't worth the small reduction in unnecessary checks.

              Line 9300, Patchset 18: // FrameTreeNode.
              Alex Moshchuk . resolved

              Is it allowed to add a nested FF (without necessarily navigating it) after the network has already been disabled, such that the value of HasDisabledNetworkForCurrentAndDescendantFrameTrees() may change due to the extra new descendant appearing?

              Similarly, what about A(FF1(FF2)), FF1 disables network access, and then removes FF2. That seems like it should also trigger running this function, since FF1 should now MarkDisabledNetworkForCurrentAndDescendantFrameTrees()?

              Probably would be good to cover these in tests too.

              Liam Brady

              Is it allowed to add a nested FF (without necessarily navigating it) after the network has already been disabled, such that the value of HasDisabledNetworkForCurrentAndDescendantFrameTrees() may change due to the extra new descendant appearing?

              Embedder-initiated navigations of fenced frames after network cutoff is explicitly disallowed. So while you can add as many `<fencedframe>`s as you want, none of those fenced frames will be able to be navigated to anything, so they will for all intents and purposes not have network access.

              Similarly, what about A(FF1(FF2)), FF1 disables network access, and then removes FF2. That seems like it should also trigger running this function, since FF1 should now MarkDisabledNetworkForCurrentAndDescendantFrameTrees()?

              This should trigger that function. I've added that to `RenderFrameHostImpl::DestroyFencedFrame()` and added a WPT to verify.

              Line 9312, Patchset 17: properties->MarkDisabledNetworkForCurrentAndDescendantFrameTrees();
              Alex Moshchuk . resolved

              I'm having trouble following this logic for more complex hierarchies. Consider the following case: A(FF1(B(C)),FF2). So, A embeds a fenced frame, which embeds an iframe B and a nested FF2, and B further embeds C. The list of nodes would be {A,FF1,B,FF2,C} (breadth-first, per https://source.chromium.org/chromium/chromium/src/+/main:content/browser/renderer_host/frame_tree.cc;l=84;drc=a009c99eedf0ee26bfbf0dd0cfef48c7db4cc679), and when reversed it would be {C,FF2,B,FF1,A}. Suppose FF1 disables network and we get here and start with C. Wouldn't we immediately reach this line and mark FF1 as MarkDisabledNetworkForCurrentAndDescendantFrameTrees(), even though we haven't heard anything from FF2?

              Could we add a browser or unit test for exercising how CalculateUntrustedNetworkStatus() handles some complicated hierarchies like this?

              Liam Brady

              Wouldn't we immediately reach this line and mark FF1 as MarkDisabledNetworkForCurrentAndDescendantFrameTrees(), even though we haven't heard anything from FF2?

              Yes. I think what we need to do instead is only set the bit and run the callbacks on the fenced frame root, once we've had a chance to look at all its descendants.

              So this means that the loop will continue for `C` and `B`, and will run for `FF2` and `FF1`. If either `C` or `B` were the ones that called `disableUntrustedNetwork()`, their callbacks will now get put into the `FencedDocumentData` of `FF1`.

              Alex Moshchuk

              Thanks for fixing this and adding a test for it. The new version seems like it should work.

              Can you please also add a test to validate the ordering and DisabledForCurrent/DisabledForCurrentAndDescendant for a similar scenario but with two independent chains of FFs that are disabling network, which are possible IIUC? For example:

              • A(FF1(FF2),FF3(FF4))
              • FF1 disables network, no callbacks run
              • FF4 disables network, FF4 callbacks run
              • FF3 disables network, FF3 callbacks run
              • FF2 disables network, FF2 and FF1 callbacks run
              Liam Brady

              Done

              Line 9323, Patchset 18: // ancestor fenced frames will be ready for network cutoff either.
              Alex Moshchuk . resolved

              The code doesn't actually check that GetParentOrOuterDocument()->GetMainFrame() is a fenced frame; it could be a regular frame (e.g., top frame). Is that ok, since we'll probably just not use it?

              Liam Brady

              I can add a `IsNestedWithinFencedFrame()` check just to make it more clear that we don't need to check this for non-fenced frames.

              Open in Gerrit

              Related details

              Attention is currently required from:
              • Alex Moshchuk
              • Andrew Verge
              • Garrett Tanzer
              • Shivani Sharma
              Submit Requirements:
              • requirement satisfiedCode-Coverage
              • requirement is not satisfiedCode-Review
              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: I88522ea9d3a7d261124fc740681c27537b056cdb
              Gerrit-Change-Number: 5426603
              Gerrit-PatchSet: 19
              Gerrit-Owner: Liam Brady <lbr...@google.com>
              Gerrit-Reviewer: Alex Moshchuk <ale...@chromium.org>
              Gerrit-Reviewer: Andrew Verge <ave...@chromium.org>
              Gerrit-Reviewer: Garrett Tanzer <gta...@chromium.org>
              Gerrit-Reviewer: Liam Brady <lbr...@google.com>
              Gerrit-Reviewer: Shivani Sharma <shiva...@chromium.org>
              Gerrit-Attention: Garrett Tanzer <gta...@chromium.org>
              Gerrit-Attention: Andrew Verge <ave...@chromium.org>
              Gerrit-Attention: Alex Moshchuk <ale...@chromium.org>
              Gerrit-Attention: Shivani Sharma <shiva...@chromium.org>
              Gerrit-Comment-Date: Tue, 23 Apr 2024 16:43:54 +0000
              satisfied_requirement
              unsatisfied_requirement
              open
              diffy

              Alex Moshchuk (Gerrit)

              unread,
              Apr 23, 2024, 1:27:48 PMApr 23
              to Liam Brady, Garrett Tanzer, Andrew Verge, Shivani Sharma, Tricium, Chromium LUCI CQ, chromium...@chromium.org, alexmo...@chromium.org, blink-...@chromium.org, creis...@chromium.org, navigation...@chromium.org
              Attention needed from Andrew Verge, Garrett Tanzer, Liam Brady and Shivani Sharma

              Alex Moshchuk voted and added 3 comments

              Votes added by Alex Moshchuk

              Code-Review+1

              3 comments

              Patchset-level comments
              File-level comment, Patchset 19 (Latest):
              Alex Moshchuk . resolved

              LGTM, thanks for your patience here!

              File content/browser/renderer_host/render_frame_host_impl.cc
              Line 9268, Patchset 18: // the frame tree, as an ancestor's revocation status could've changed as a
              Alex Moshchuk . resolved

              There may be some unnecessary work here for sibling FFs, e.g. with A(FF1(FF2),FF3,FF4), disabling network in FF2 only needs to recalculate FF2 and FF1, not FF3 or FF4. But it's probably easiest to just recalculate the whole tree?

              Liam Brady

              If `A` were instead a fenced frame, giving us `FF0(FF1(FF2),FF3,FF4)`, we would still need to look at `FF3` and `FF4` to check if their network has been cut off to determine if `FF0` can have network cutoff as well. I think the extra work to figure out what frames actually need to be looked at isn't worth the small reduction in unnecessary checks.

              Alex Moshchuk

              Agreed

              Line 9300, Patchset 18: // FrameTreeNode.
              Alex Moshchuk . unresolved

              Is it allowed to add a nested FF (without necessarily navigating it) after the network has already been disabled, such that the value of HasDisabledNetworkForCurrentAndDescendantFrameTrees() may change due to the extra new descendant appearing?

              Similarly, what about A(FF1(FF2)), FF1 disables network access, and then removes FF2. That seems like it should also trigger running this function, since FF1 should now MarkDisabledNetworkForCurrentAndDescendantFrameTrees()?

              Probably would be good to cover these in tests too.

              Liam Brady

              Is it allowed to add a nested FF (without necessarily navigating it) after the network has already been disabled, such that the value of HasDisabledNetworkForCurrentAndDescendantFrameTrees() may change due to the extra new descendant appearing?

              Embedder-initiated navigations of fenced frames after network cutoff is explicitly disallowed. So while you can add as many `<fencedframe>`s as you want, none of those fenced frames will be able to be navigated to anything, so they will for all intents and purposes not have network access.

              Similarly, what about A(FF1(FF2)), FF1 disables network access, and then removes FF2. That seems like it should also trigger running this function, since FF1 should now MarkDisabledNetworkForCurrentAndDescendantFrameTrees()?

              This should trigger that function. I've added that to `RenderFrameHostImpl::DestroyFencedFrame()` and added a WPT to verify.

              Alex Moshchuk

              Is it allowed to add a nested FF (without necessarily navigating it) after the network has already been disabled, such that the value of HasDisabledNetworkForCurrentAndDescendantFrameTrees() may change due to the extra new descendant appearing?

              Embedder-initiated navigations of fenced frames after network cutoff is explicitly disallowed. So while you can add as many `<fencedframe>`s as you want, none of those fenced frames will be able to be navigated to anything, so they will for all intents and purposes not have network access.

              But is the new empty <fencedframe> going to set its disable_untrusted_network_status_ to DisableUntrustedNetworkStatus::kCurrentAndDescendantFrameTreesComplete, if it's added from a FF that's already had its network access revoked? I understand that it's not going to have network access, but wanted to check if its presence could break CalculateUntrustedNetworkStatus(). E.g., FF1(FF2), FF1 disables network, FF1 adds an empty FF3, FF2 disables network - that'll leave FF1 hanging without resolving its promise. Maybe that's ok since FF1 is kind of shooting itself in the foot by adding FF3. Or maybe RFHI::CreateFencedFrame() could account for it - leaving that up to you all to decide. :)


              > Similarly, what about A(FF1(FF2)), FF1 disables network access, and then removes FF2. That seems like it should also trigger running this function, since FF1 should now MarkDisabledNetworkForCurrentAndDescendantFrameTrees()?

              This should trigger that function. I've added that to `RenderFrameHostImpl::DestroyFencedFrame()` and added a WPT to verify.

              Thanks!

              Open in Gerrit

              Related details

              Attention is currently required from:
              • Andrew Verge
              • Garrett Tanzer
              • Liam Brady
              • Shivani Sharma
              Submit Requirements:
              • requirement satisfiedCode-Coverage
              • requirement satisfiedCode-Review
              • requirement is not satisfiedNo-Unresolved-Comments
              Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
              Gerrit-MessageType: comment
              Gerrit-Project: chromium/src
              Gerrit-Branch: main
              Gerrit-Change-Id: I88522ea9d3a7d261124fc740681c27537b056cdb
              Gerrit-Change-Number: 5426603
              Gerrit-PatchSet: 19
              Gerrit-Owner: Liam Brady <lbr...@google.com>
              Gerrit-Reviewer: Alex Moshchuk <ale...@chromium.org>
              Gerrit-Reviewer: Andrew Verge <ave...@chromium.org>
              Gerrit-Reviewer: Garrett Tanzer <gta...@chromium.org>
              Gerrit-Reviewer: Liam Brady <lbr...@google.com>
              Gerrit-Reviewer: Shivani Sharma <shiva...@chromium.org>
              Gerrit-Attention: Garrett Tanzer <gta...@chromium.org>
              Gerrit-Attention: Andrew Verge <ave...@chromium.org>
              Gerrit-Attention: Liam Brady <lbr...@google.com>
              Gerrit-Attention: Shivani Sharma <shiva...@chromium.org>
              Gerrit-Comment-Date: Tue, 23 Apr 2024 17:27:32 +0000
              Gerrit-HasComments: Yes
              Gerrit-Has-Labels: Yes
              satisfied_requirement
              unsatisfied_requirement
              open
              diffy

              Garrett Tanzer (Gerrit)

              unread,
              Apr 23, 2024, 1:46:58 PMApr 23
              to Liam Brady, Alex Moshchuk, Andrew Verge, Shivani Sharma, Tricium, Chromium LUCI CQ, chromium...@chromium.org, alexmo...@chromium.org, blink-...@chromium.org, creis...@chromium.org, navigation...@chromium.org
              Attention needed from Andrew Verge, Liam Brady and Shivani Sharma

              Garrett Tanzer voted Code-Review+1

              Code-Review+1
              Open in Gerrit

              Related details

              Attention is currently required from:
              • Andrew Verge
              • Liam Brady
              • Shivani Sharma
              Submit Requirements:
              • requirement satisfiedCode-Coverage
              • requirement satisfiedCode-Review
              • requirement is not satisfiedNo-Unresolved-Comments
              Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
              Gerrit-MessageType: comment
              Gerrit-Project: chromium/src
              Gerrit-Branch: main
              Gerrit-Change-Id: I88522ea9d3a7d261124fc740681c27537b056cdb
              Gerrit-Change-Number: 5426603
              Gerrit-PatchSet: 19
              Gerrit-Owner: Liam Brady <lbr...@google.com>
              Gerrit-Reviewer: Alex Moshchuk <ale...@chromium.org>
              Gerrit-Reviewer: Andrew Verge <ave...@chromium.org>
              Gerrit-Reviewer: Garrett Tanzer <gta...@chromium.org>
              Gerrit-Reviewer: Liam Brady <lbr...@google.com>
              Gerrit-Reviewer: Shivani Sharma <shiva...@chromium.org>
              Gerrit-Attention: Andrew Verge <ave...@chromium.org>
              Gerrit-Attention: Liam Brady <lbr...@google.com>
              Gerrit-Attention: Shivani Sharma <shiva...@chromium.org>
              Gerrit-Comment-Date: Tue, 23 Apr 2024 17:46:40 +0000
              Gerrit-HasComments: No
              Gerrit-Has-Labels: Yes
              satisfied_requirement
              unsatisfied_requirement
              open
              diffy

              Andrew Verge (Gerrit)

              unread,
              Apr 23, 2024, 2:31:24 PMApr 23
              to Liam Brady, Garrett Tanzer, Alex Moshchuk, Shivani Sharma, Tricium, Chromium LUCI CQ, chromium...@chromium.org, alexmo...@chromium.org, blink-...@chromium.org, creis...@chromium.org, navigation...@chromium.org
              Attention needed from Liam Brady and Shivani Sharma

              Andrew Verge voted and added 1 comment

              Votes added by Andrew Verge

              Code-Review+1

              1 comment

              Patchset-level comments
              File-level comment, Patchset 20 (Latest):
              Andrew Verge . resolved

              New traversal algorithm looks great!

              Open in Gerrit

              Related details

              Attention is currently required from:
              • Liam Brady
              • Shivani Sharma
              Submit Requirements:
              • requirement satisfiedCode-Coverage
              • requirement satisfiedCode-Review
              • requirement is not satisfiedNo-Unresolved-Comments
              Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
              Gerrit-MessageType: comment
              Gerrit-Project: chromium/src
              Gerrit-Branch: main
              Gerrit-Change-Id: I88522ea9d3a7d261124fc740681c27537b056cdb
              Gerrit-Change-Number: 5426603
              Gerrit-PatchSet: 20
              Gerrit-Owner: Liam Brady <lbr...@google.com>
              Gerrit-Reviewer: Alex Moshchuk <ale...@chromium.org>
              Gerrit-Reviewer: Andrew Verge <ave...@chromium.org>
              Gerrit-Reviewer: Garrett Tanzer <gta...@chromium.org>
              Gerrit-Reviewer: Liam Brady <lbr...@google.com>
              Gerrit-Reviewer: Shivani Sharma <shiva...@chromium.org>
              Gerrit-Attention: Liam Brady <lbr...@google.com>
              Gerrit-Attention: Shivani Sharma <shiva...@chromium.org>
              Gerrit-Comment-Date: Tue, 23 Apr 2024 18:31:11 +0000
              Gerrit-HasComments: Yes
              Gerrit-Has-Labels: Yes
              satisfied_requirement
              unsatisfied_requirement
              open
              diffy

              Liam Brady (Gerrit)

              unread,
              Apr 23, 2024, 2:32:47 PMApr 23
              to Andrew Verge, Garrett Tanzer, Alex Moshchuk, Shivani Sharma, Tricium, Chromium LUCI CQ, chromium...@chromium.org, alexmo...@chromium.org, blink-...@chromium.org, creis...@chromium.org, navigation...@chromium.org
              Attention needed from Shivani Sharma

              Liam Brady added 1 comment

              File content/browser/renderer_host/render_frame_host_impl.cc
              Line 9300, Patchset 18: // FrameTreeNode.
              Alex Moshchuk . resolved

              Is it allowed to add a nested FF (without necessarily navigating it) after the network has already been disabled, such that the value of HasDisabledNetworkForCurrentAndDescendantFrameTrees() may change due to the extra new descendant appearing?

              Similarly, what about A(FF1(FF2)), FF1 disables network access, and then removes FF2. That seems like it should also trigger running this function, since FF1 should now MarkDisabledNetworkForCurrentAndDescendantFrameTrees()?

              Probably would be good to cover these in tests too.

              Liam Brady

              Is it allowed to add a nested FF (without necessarily navigating it) after the network has already been disabled, such that the value of HasDisabledNetworkForCurrentAndDescendantFrameTrees() may change due to the extra new descendant appearing?

              Embedder-initiated navigations of fenced frames after network cutoff is explicitly disallowed. So while you can add as many `<fencedframe>`s as you want, none of those fenced frames will be able to be navigated to anything, so they will for all intents and purposes not have network access.

              Similarly, what about A(FF1(FF2)), FF1 disables network access, and then removes FF2. That seems like it should also trigger running this function, since FF1 should now MarkDisabledNetworkForCurrentAndDescendantFrameTrees()?

              This should trigger that function. I've added that to `RenderFrameHostImpl::DestroyFencedFrame()` and added a WPT to verify.

              Alex Moshchuk

              Is it allowed to add a nested FF (without necessarily navigating it) after the network has already been disabled, such that the value of HasDisabledNetworkForCurrentAndDescendantFrameTrees() may change due to the extra new descendant appearing?

              Embedder-initiated navigations of fenced frames after network cutoff is explicitly disallowed. So while you can add as many `<fencedframe>`s as you want, none of those fenced frames will be able to be navigated to anything, so they will for all intents and purposes not have network access.

              But is the new empty <fencedframe> going to set its disable_untrusted_network_status_ to DisableUntrustedNetworkStatus::kCurrentAndDescendantFrameTreesComplete, if it's added from a FF that's already had its network access revoked? I understand that it's not going to have network access, but wanted to check if its presence could break CalculateUntrustedNetworkStatus(). E.g., FF1(FF2), FF1 disables network, FF1 adds an empty FF3, FF2 disables network - that'll leave FF1 hanging without resolving its promise. Maybe that's ok since FF1 is kind of shooting itself in the foot by adding FF3. Or maybe RFHI::CreateFencedFrame() could account for it - leaving that up to you all to decide. :)


              > Similarly, what about A(FF1(FF2)), FF1 disables network access, and then removes FF2. That seems like it should also trigger running this function, since FF1 should now MarkDisabledNetworkForCurrentAndDescendantFrameTrees()?

              This should trigger that function. I've added that to `RenderFrameHostImpl::DestroyFencedFrame()` and added a WPT to verify.

              Thanks!

              Liam Brady

              It won't because once a fenced frame is marked as being `DisableUntrustedNetworkStatus::kCurrentAndDescendantFrameTreesComplete`, the invariant is that it can never be walked back. Because of that, we don't touch the network revocation status if we see that it's already set to `kCurrentAndDescendantFrameTreesComplete`. So even if a fenced frame is created whose network status is `kNotStarted`, it won't ever be able to navigate so it's safe to ignore that when doing the calculation.

              I've added a browsertest to verify this behavior.

              Open in Gerrit

              Related details

              Attention is currently required from:
              • Shivani Sharma
              Submit Requirements:
              • requirement satisfiedCode-Coverage
              • requirement satisfiedCode-Review
              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: I88522ea9d3a7d261124fc740681c27537b056cdb
              Gerrit-Change-Number: 5426603
              Gerrit-PatchSet: 20
              Gerrit-Owner: Liam Brady <lbr...@google.com>
              Gerrit-Reviewer: Alex Moshchuk <ale...@chromium.org>
              Gerrit-Reviewer: Andrew Verge <ave...@chromium.org>
              Gerrit-Reviewer: Garrett Tanzer <gta...@chromium.org>
              Gerrit-Reviewer: Liam Brady <lbr...@google.com>
              Gerrit-Reviewer: Shivani Sharma <shiva...@chromium.org>
              Gerrit-Attention: Shivani Sharma <shiva...@chromium.org>
              Gerrit-Comment-Date: Tue, 23 Apr 2024 18:32:35 +0000
              Gerrit-HasComments: Yes
              Gerrit-Has-Labels: No
              satisfied_requirement
              open
              diffy

              Alex Moshchuk (Gerrit)

              unread,
              Apr 24, 2024, 12:13:35 PMApr 24
              to Liam Brady, Andrew Verge, Garrett Tanzer, Shivani Sharma, Tricium, Chromium LUCI CQ, chromium...@chromium.org, alexmo...@chromium.org, blink-...@chromium.org, creis...@chromium.org, navigation...@chromium.org
              Attention needed from Liam Brady and Shivani Sharma

              Alex Moshchuk voted and added 1 comment

              Votes added by Alex Moshchuk

              Code-Review+1

              1 comment

              File content/browser/renderer_host/render_frame_host_impl.cc
              Line 9300, Patchset 18: // FrameTreeNode.
              Alex Moshchuk . resolved

              Is it allowed to add a nested FF (without necessarily navigating it) after the network has already been disabled, such that the value of HasDisabledNetworkForCurrentAndDescendantFrameTrees() may change due to the extra new descendant appearing?

              Similarly, what about A(FF1(FF2)), FF1 disables network access, and then removes FF2. That seems like it should also trigger running this function, since FF1 should now MarkDisabledNetworkForCurrentAndDescendantFrameTrees()?

              Probably would be good to cover these in tests too.

              Liam Brady

              Is it allowed to add a nested FF (without necessarily navigating it) after the network has already been disabled, such that the value of HasDisabledNetworkForCurrentAndDescendantFrameTrees() may change due to the extra new descendant appearing?

              Embedder-initiated navigations of fenced frames after network cutoff is explicitly disallowed. So while you can add as many `<fencedframe>`s as you want, none of those fenced frames will be able to be navigated to anything, so they will for all intents and purposes not have network access.

              Similarly, what about A(FF1(FF2)), FF1 disables network access, and then removes FF2. That seems like it should also trigger running this function, since FF1 should now MarkDisabledNetworkForCurrentAndDescendantFrameTrees()?

              This should trigger that function. I've added that to `RenderFrameHostImpl::DestroyFencedFrame()` and added a WPT to verify.

              Alex Moshchuk

              Is it allowed to add a nested FF (without necessarily navigating it) after the network has already been disabled, such that the value of HasDisabledNetworkForCurrentAndDescendantFrameTrees() may change due to the extra new descendant appearing?

              Embedder-initiated navigations of fenced frames after network cutoff is explicitly disallowed. So while you can add as many `<fencedframe>`s as you want, none of those fenced frames will be able to be navigated to anything, so they will for all intents and purposes not have network access.

              But is the new empty <fencedframe> going to set its disable_untrusted_network_status_ to DisableUntrustedNetworkStatus::kCurrentAndDescendantFrameTreesComplete, if it's added from a FF that's already had its network access revoked? I understand that it's not going to have network access, but wanted to check if its presence could break CalculateUntrustedNetworkStatus(). E.g., FF1(FF2), FF1 disables network, FF1 adds an empty FF3, FF2 disables network - that'll leave FF1 hanging without resolving its promise. Maybe that's ok since FF1 is kind of shooting itself in the foot by adding FF3. Or maybe RFHI::CreateFencedFrame() could account for it - leaving that up to you all to decide. :)


              > Similarly, what about A(FF1(FF2)), FF1 disables network access, and then removes FF2. That seems like it should also trigger running this function, since FF1 should now MarkDisabledNetworkForCurrentAndDescendantFrameTrees()?

              This should trigger that function. I've added that to `RenderFrameHostImpl::DestroyFencedFrame()` and added a WPT to verify.

              Thanks!

              Liam Brady

              It won't because once a fenced frame is marked as being `DisableUntrustedNetworkStatus::kCurrentAndDescendantFrameTreesComplete`, the invariant is that it can never be walked back. Because of that, we don't touch the network revocation status if we see that it's already set to `kCurrentAndDescendantFrameTreesComplete`. So even if a fenced frame is created whose network status is `kNotStarted`, it won't ever be able to navigate so it's safe to ignore that when doing the calculation.

              I've added a browsertest to verify this behavior.

              Alex Moshchuk

              Thanks for adding that test, and also adding handling for the case where the parent FF is at kCurrent rather than kCurrentAndDescendant when it adds a blank FF per our offline discussion. New changes LGTM!

              Open in Gerrit

              Related details

              Attention is currently required from:
              • Liam Brady
              • Shivani Sharma
              Submit Requirements:
              • requirement satisfiedCode-Coverage
              • requirement satisfiedCode-Review
              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: I88522ea9d3a7d261124fc740681c27537b056cdb
              Gerrit-Change-Number: 5426603
              Gerrit-PatchSet: 21
              Gerrit-Owner: Liam Brady <lbr...@google.com>
              Gerrit-Reviewer: Alex Moshchuk <ale...@chromium.org>
              Gerrit-Reviewer: Andrew Verge <ave...@chromium.org>
              Gerrit-Reviewer: Garrett Tanzer <gta...@chromium.org>
              Gerrit-Reviewer: Liam Brady <lbr...@google.com>
              Gerrit-Reviewer: Shivani Sharma <shiva...@chromium.org>
              Gerrit-Attention: Liam Brady <lbr...@google.com>
              Gerrit-Attention: Shivani Sharma <shiva...@chromium.org>
              Gerrit-Comment-Date: Wed, 24 Apr 2024 16:13:17 +0000
              Gerrit-HasComments: Yes
              Gerrit-Has-Labels: Yes
              satisfied_requirement
              open
              diffy

              Liam Brady (Gerrit)

              unread,
              Apr 24, 2024, 12:16:29 PMApr 24
              to Andrew Verge, Garrett Tanzer, Alex Moshchuk, Shivani Sharma, Tricium, Chromium LUCI CQ, chromium...@chromium.org, alexmo...@chromium.org, blink-...@chromium.org, creis...@chromium.org, navigation...@chromium.org
              Attention needed from Shivani Sharma

              Liam Brady voted Commit-Queue+2

              Commit-Queue+2
              Open in Gerrit

              Related details

              Attention is currently required from:
              • Shivani Sharma
              Submit Requirements:
              • requirement satisfiedCode-Coverage
              • requirement satisfiedCode-Review
              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: I88522ea9d3a7d261124fc740681c27537b056cdb
              Gerrit-Change-Number: 5426603
              Gerrit-PatchSet: 21
              Gerrit-Owner: Liam Brady <lbr...@google.com>
              Gerrit-Reviewer: Alex Moshchuk <ale...@chromium.org>
              Gerrit-Reviewer: Andrew Verge <ave...@chromium.org>
              Gerrit-Reviewer: Garrett Tanzer <gta...@chromium.org>
              Gerrit-Reviewer: Liam Brady <lbr...@google.com>
              Gerrit-Reviewer: Shivani Sharma <shiva...@chromium.org>
              Gerrit-Attention: Shivani Sharma <shiva...@chromium.org>
              Gerrit-Comment-Date: Wed, 24 Apr 2024 16:16:12 +0000
              Gerrit-HasComments: No
              Gerrit-Has-Labels: Yes
              satisfied_requirement
              open
              diffy

              Chromium LUCI CQ (Gerrit)

              unread,
              Apr 24, 2024, 12:24:07 PMApr 24
              to Liam Brady, Andrew Verge, Garrett Tanzer, Alex Moshchuk, Shivani Sharma, Tricium, chromium...@chromium.org, alexmo...@chromium.org, blink-...@chromium.org, creis...@chromium.org, navigation...@chromium.org

              Chromium LUCI CQ submitted the change

              Change information

              Commit message:
              Fenced frame: Network cutoff callback waits for sub-fenced frames.

              The `window.fence.disableUntrustedNetwork()` promise currently resolves
              as soon as the frame's config's partition nonce is added to the network
              cutoff list. However, the features gated behind network cutoff
              (currently just `sharedStorage.get()`) still aren't allowed to be
              accessed until all sub-fenced frames have also cut off their own
              network. Sub-fenced frames still need to turn off their own network by
              calling `disableUntrustedNetwork()`. To enforce that, we check every
              sub-fenced frame for network cutoff whenever we call
              `sharedStorage.get()`.

              This CL modifies the behavior to not have the promise resolve until
              network cutoff has truly kicked in. In other words, once all sub-fenced
              frame trees have had their network cut off, only then will
              `window.fence.disableUntrustedNetwork()` resolve.

              Because it's possible for a sub-fenced frame's network cutoff call to resolve a
              promise, the callback for the promise is stored in the fenced document
              data if it's not resolved during the course of its
              `disableUntrustedNetwork()` call. During each
              `disableUntrustedNetwork()` call, each fenced frame properties' network
              cutoff value is recalculated, taking child properties' network cutoff
              values into account. If it is determined that this frame is ready for
              network cutoff, the bit is flipped in its properties and the frame's
              document's original `window.fence.disableUntrustedNetwork()` function
              call is resolved.

              The function that determines the network cutoff status involves a full
              traversal of the entire frame tree (including crossing fenced frame
              boundaries) to determine what frames have been affected by a
              `disableUntrustedNetwork()` call, starting with the most deeply nested
              frames and working up the frame tree.

              See explainer: https://github.com/WICG/fenced-frame/blob/master/explainer/fenced_frames_with_local_unpartitioned_data_access.md#revoking-network-access
              See overall design document: https://docs.google.com/document/d/1JnwuFl84P5jR_9PkpM68WdCD63UerKxWm-v4XXj2sRc/edit?usp=sharing
              Change-Id: I88522ea9d3a7d261124fc740681c27537b056cdb
              Bug: 41488151
              Commit-Queue: Liam Brady <lbr...@google.com>
              Reviewed-by: Alex Moshchuk <ale...@chromium.org>
              Reviewed-by: Garrett Tanzer <gta...@chromium.org>
              Reviewed-by: Andrew Verge <ave...@chromium.org>
              Cr-Commit-Position: refs/heads/main@{#1291915}
              Files:
              • M content/browser/fenced_frame/fenced_document_data.cc
              • M content/browser/fenced_frame/fenced_document_data.h
              • M content/browser/fenced_frame/fenced_frame.cc
              • M content/browser/fenced_frame/fenced_frame_browsertest.cc
              • M content/browser/fenced_frame/fenced_frame_config.h
              • M content/browser/renderer_host/render_frame_host_impl.cc
              • M content/browser/renderer_host/render_frame_host_impl.h
              • M content/browser/shared_storage/shared_storage_browsertest.cc
              • A third_party/blink/web_tests/wpt_internal/fenced_frame/content-shared-storage-get-nested.https.html
              • M third_party/blink/web_tests/wpt_internal/fenced_frame/content-shared-storage-get.https.html
              • A third_party/blink/web_tests/wpt_internal/fenced_frame/disable-untrusted-network-remove-frame.https.html
              • M third_party/blink/web_tests/wpt_internal/fenced_frame/revoke-manual-report-event-beacons.https.html
              • M third_party/blink/web_tests/wpt_internal/fenced_frame/revoke-popup.https.html
              • M third_party/blink/web_tests/wpt_internal/fenced_frame/revoke-unfenced-top-navigation.https.html
              Change size: L
              Delta: 14 files changed, 756 insertions(+), 85 deletions(-)
              Branch: refs/heads/main
              Submit Requirements:
              • requirement satisfiedCode-Review: +1 by Alex Moshchuk, +1 by Garrett Tanzer, +1 by Andrew Verge
              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: I88522ea9d3a7d261124fc740681c27537b056cdb
              Gerrit-Change-Number: 5426603
              Gerrit-PatchSet: 22
              Gerrit-Owner: Liam Brady <lbr...@google.com>
              Gerrit-Reviewer: Alex Moshchuk <ale...@chromium.org>
              Gerrit-Reviewer: Andrew Verge <ave...@chromium.org>
              Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
              Gerrit-Reviewer: Garrett Tanzer <gta...@chromium.org>
              Gerrit-Reviewer: Liam Brady <lbr...@google.com>
              Gerrit-Reviewer: Shivani Sharma <shiva...@chromium.org>
              open
              diffy
              satisfied_requirement
              Reply all
              Reply to author
              Forward
              0 new messages