-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Shared Storage: Add iframe attribute for response header writes
We include the previously added mixin interface `HTMLSharedStorageWritableElementUtils` with boolean attribute `sharedStorageWritable` in `HTMLIFrameElement`. The value of the IDL attribute is plumbed to the new field `blink::mojom::IframeAttributes::shared_storage_writable`, and then `blink::mojom::LocalFrameHost::DidChangeIframeAttributes()` notifies `FrameTreeNode` the attribute value is parsed or changes. We add infra to `NavigationRequest` and `NavigationRequestInfo` to check PermissionsPolicy and plumb the writable value to `network::ResourceRequest`. Since the `URLLoaderNetworkContext::Type` for iframe navigations is `URLLoaderNetworkContext::Type::kServiceWorkerContext` (https://source.chromium.org/chromium/chromium/src/+/refs/heads/main:content/browser/storage_partition_impl.cc;drc=b27071598a6b291a7319d99ce7aa4af81ebc060f;l=3329), we have to use a workaround to send a `RenderFrameHost` to `SharedStorageHeaderObserver::HeaderReceived()`. Hence we add `network::ResourceRequest::TrustedParams::shared_storage_writable_id`, which in the case of (eligible) iframe navigations will be the existing `NavigationRequest::navigation_id_`, and otherwise -1. This long integer is sent over mojom and can thus be sent back again via `URLLoaderNetworkServiceObserver::OnSharedStorageHeaderReceived()` in order to identify and defer a header's operations, which will then be looked up by id and invoked on iframe commit. This is part of a project to add support to writing to shared storage from response headers. See WICG/shared-storage#70 for more information and https://crrev.com/c/4691573 for a prototype for adding image and iframe attributes. Browser tests are added in https://crrev.com/c/4718688. Bug: 1434529,1218540 Change-Id: I290a8e06cf4824845e12421bbd34906f9399b25f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4717613 Reviewed-by: Eric Orth <ericorth@chromium.org> Reviewed-by: Nasko Oskov <nasko@chromium.org> Reviewed-by: Yao Xiao <yaoxia@chromium.org> Commit-Queue: Cammie Smith Barnes <cammie@chromium.org> Cr-Commit-Position: refs/heads/main@{#1187498}
- Loading branch information
1 parent
65a4334
commit 6d2966c
Showing
33 changed files
with
502 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.