-
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.
Implement subresource loading with Web Bundles
- Adds WebBundleLoader class which loads a WebBundle resource using ThreadableLoader, and creates a WebBundleSubresourceLoaderFactory. - LinkWebBundle is registered in ResourceFetcher, and used to forward subresource requests that match the corresponding <link>'s resources= attribute to the WebBundleSubresourceLoaderFactory. This is done via the SubresourceWebBundle interface. Bug: 1082020 Change-Id: I3f26bd6b1fbd5855caa5175cdcb3db0fe103a093 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2291809 Reviewed-by: Kinuko Yasuda <kinuko@chromium.org> Reviewed-by: Tsuyoshi Horo <horo@chromium.org> Reviewed-by: Hayato Ito <hayato@chromium.org> Commit-Queue: Kunihiko Sakamoto <ksakamoto@chromium.org> Cr-Commit-Position: refs/heads/master@{#788842}
- Loading branch information
Showing
26 changed files
with
331 additions
and
8 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
31 changes: 31 additions & 0 deletions
31
third_party/blink/renderer/platform/loader/fetch/subresource_web_bundle.h
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// Copyright 2020 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#ifndef THIRD_PARTY_BLINK_RENDERER_PLATFORM_LOADER_FETCH_SUBRESOURCE_WEB_BUNDLE_H_ | ||
#define THIRD_PARTY_BLINK_RENDERER_PLATFORM_LOADER_FETCH_SUBRESOURCE_WEB_BUNDLE_H_ | ||
|
||
#include "mojo/public/cpp/bindings/pending_remote.h" | ||
#include "services/network/public/mojom/url_loader_factory.mojom-blink-forward.h" | ||
#include "third_party/blink/renderer/platform/heap/garbage_collected.h" | ||
#include "third_party/blink/renderer/platform/platform_export.h" | ||
|
||
namespace blink { | ||
|
||
class KURL; | ||
|
||
// SubresourceWebBundle is attached to ResourceFetcher and used to intercept | ||
// subresource requests for a certain set of URLs and serve responses from a | ||
// WebBundle. This is used for Subresource loading with Web Bundles | ||
// (https://github.com/WICG/webpackage/blob/master/explainers/subresource-loading.md). | ||
class PLATFORM_EXPORT SubresourceWebBundle : public GarbageCollectedMixin { | ||
public: | ||
void Trace(Visitor* visitor) const override {} | ||
virtual bool CanHandleRequest(const KURL& url) const = 0; | ||
virtual mojo::PendingRemote<network::mojom::blink::URLLoaderFactory> | ||
GetURLLoaderFactory() = 0; | ||
}; | ||
|
||
} // namespace blink | ||
|
||
#endif // THIRD_PARTY_BLINK_RENDERER_PLATFORM_LOADER_FETCH_SUBRESOURCE_WEB_BUNDLE_H_ |
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
1 change: 1 addition & 0 deletions
1
third_party/blink/web_tests/external/wpt/web-bundle/resources/dynamic/resource1.js
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export const result = 'resource1 from network'; |
1 change: 1 addition & 0 deletions
1
third_party/blink/web_tests/external/wpt/web-bundle/resources/dynamic/resource2.js
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export const result = 'resource2 from network'; |
1 change: 1 addition & 0 deletions
1
third_party/blink/web_tests/external/wpt/web-bundle/resources/dynamic/resource3.js
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export const result = 'resource3 from network'; |
1 change: 1 addition & 0 deletions
1
third_party/blink/web_tests/external/wpt/web-bundle/resources/dynamic/resource4.js
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export const result = 'resource4 from network'; |
1 change: 1 addition & 0 deletions
1
third_party/blink/web_tests/external/wpt/web-bundle/resources/dynamic1/resource1.js
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export const result = 'resource1 from dynamic1.wbn'; |
1 change: 1 addition & 0 deletions
1
third_party/blink/web_tests/external/wpt/web-bundle/resources/dynamic1/resource2.js
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export const result = 'resource2 from dynamic1.wbn'; |
1 change: 1 addition & 0 deletions
1
third_party/blink/web_tests/external/wpt/web-bundle/resources/dynamic1/resource3.js
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export const result = 'resource3 from dynamic1.wbn'; |
1 change: 1 addition & 0 deletions
1
third_party/blink/web_tests/external/wpt/web-bundle/resources/dynamic1/resource4.js
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export const result = 'resource4 from dynamic1.wbn'; |
1 change: 1 addition & 0 deletions
1
third_party/blink/web_tests/external/wpt/web-bundle/resources/dynamic2/resource1.js
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export const result = 'resource1 from dynamic2.wbn'; |
1 change: 1 addition & 0 deletions
1
third_party/blink/web_tests/external/wpt/web-bundle/resources/dynamic2/resource2.js
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export const result = 'resource2 from dynamic2.wbn'; |
1 change: 1 addition & 0 deletions
1
third_party/blink/web_tests/external/wpt/web-bundle/resources/dynamic2/resource3.js
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export const result = 'resource3 from dynamic2.wbn'; |
1 change: 1 addition & 0 deletions
1
third_party/blink/web_tests/external/wpt/web-bundle/resources/dynamic2/resource4.js
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export const result = 'resource4 from dynamic2.wbn'; |
Oops, something went wrong.