Index: third_party/WebKit/Source/web/DedicatedWorkerMessagingProxyProviderImpl.cpp |
diff --git a/third_party/WebKit/Source/web/DedicatedWorkerMessagingProxyProviderImpl.cpp b/third_party/WebKit/Source/web/DedicatedWorkerMessagingProxyProviderImpl.cpp |
index 0a6687d2310bb01064f99ab6a62322c41c10a8a8..4adfd6887703d727371d0ae64120e07f69300989 100644 |
--- a/third_party/WebKit/Source/web/DedicatedWorkerMessagingProxyProviderImpl.cpp |
+++ b/third_party/WebKit/Source/web/DedicatedWorkerMessagingProxyProviderImpl.cpp |
@@ -31,9 +31,12 @@ |
#include "web/DedicatedWorkerMessagingProxyProviderImpl.h" |
#include "core/dom/Document.h" |
+#include "core/loader/WorkerFetchContext.h" |
#include "core/workers/DedicatedWorkerMessagingProxy.h" |
#include "core/workers/Worker.h" |
#include "core/workers/WorkerClients.h" |
+#include "platform/loader/fetch/ResourceFetcher.h" |
+#include "public/platform/Platform.h" |
#include "public/platform/WebContentSettingsClient.h" |
#include "public/platform/WebString.h" |
#include "public/web/WebFrameClient.h" |
@@ -67,6 +70,23 @@ DedicatedWorkerMessagingProxyProviderImpl::createWorkerMessagingProxy( |
workerClients, |
WTF::wrapUnique( |
webFrame->client()->createWorkerContentSettingsClientProxy())); |
+ std::unique_ptr<WebWorkerFetchContextInfo> webWorkerFetchContextInfo = |
+ Platform::current()->createWorkerFetchContextInfo(); |
+ // |webWorkerFetchContextInfo| is null if off-main-thread-fetch is disabled. |
+ if (webWorkerFetchContextInfo) { |
+ webWorkerFetchContextInfo->setAppCacheHostID( |
+ document->fetcher()->context().applicationCacheHostID()); |
+ webFrame->client()->propagateAuxiliaryFetchContext( |
+ webWorkerFetchContextInfo.get()); |
+ provideWorkerFetchContextInfoToWorker( |
+ workerClients, std::move(webWorkerFetchContextInfo)); |
+ WorkerFetchContextInfo* workerFetchContextInfo = |
+ WorkerFetchContextInfo::from(*workerClients); |
+ workerFetchContextInfo->setDataSaverEnabled( |
+ document->frame()->settings()->getDataSaverEnabled()); |
+ workerFetchContextInfo->setStrictMixedContentCheckingEnabled( |
+ document->frame()->settings()->getStrictMixedContentChecking()); |
+ } |
// FIXME: call provideServiceWorkerContainerClientToWorker here when we |
// support ServiceWorker in dedicated workers (http://crbug.com/371690) |
return new DedicatedWorkerMessagingProxy(worker, workerClients); |