PlzWorker: Create WebWorkerFetchContext with response override supplied from the browser
This CL enables to create WebWorkerFetchContext with response override
suppilied from the browser process when the PlzDedicatedWorker flag is enabled.
The response override is consumed during off-the-main-thread dedicated worker
script fetch.
Noteworthy points of this CL:
- After this change, top-level dedicated worker scripts are considered as the
main resources when PlzDedicatedWorker is enabled. See IsMainResourceType() in
AppCacheRequestHandler and ServiceWorkerUtils.
- DedicatedWorkerHostFactoryClient::CreateWorkerFetchContext() directly creates
ServiceWorkerProviderContext without ServiceWorkerNetworkProviderForWorker.
The provider is not necessary because script loading is done on the worker
thread without (WorkerShadowPage's) documents. See also class level comments
on ServiceWorkerNetworkProviderForWorker.
- This CL adds new virtual functions in (Web)LocalFrameClient to connect
blink::DedicatedWorker to content::RenderFrameImpl.
Remaining issues:
- Nested dedicated workers doesn't use this mechanism yet. See TODO comments in
DedicatedWorker::CreateWebWorkerFetchContext().
- This change fails referrer and credentials tests because some fields on
ResourceRequest constructed in the browser process are not set.
These are fixed by follow-up CLs.
Change-Id: I29f8d9c13f183e5eaeccf69acbec62379aa05b55
Bug: 731604, 906991
Reviewed-on: https://chromium-review.googlesource.com/c/1468852
Reviewed-by: Kinuko Yasuda <[email protected]>
Reviewed-by: Matt Falkenhagen <[email protected]>
Commit-Queue: Hiroki Nakagawa <[email protected]>
Cr-Commit-Position: refs/heads/master@{#635973}
diff --git a/content/renderer/render_frame_impl.h b/content/renderer/render_frame_impl.h
index 66deafa..9eb66d4 100644
--- a/content/renderer/render_frame_impl.h
+++ b/content/renderer/render_frame_impl.h
@@ -641,6 +641,9 @@
CreateWorkerContentSettingsClient() override;
scoped_refptr<blink::WebWorkerFetchContext> CreateWorkerFetchContext()
override;
+ scoped_refptr<blink::WebWorkerFetchContext>
+ CreateWorkerFetchContextForPlzDedicatedWorker(
+ blink::WebDedicatedWorkerHostFactoryClient* factory_client) override;
blink::WebExternalPopupMenu* CreateExternalPopupMenu(
const blink::WebPopupMenuInfo& popup_menu_info,
blink::WebExternalPopupMenuClient* popup_menu_client) override;