Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(365)

Unified Diff: third_party/WebKit/Source/web/DedicatedWorkerMessagingProxyProviderImpl.cpp

Issue 2701753003: [WIP] off-main-thread loading
Patch Set: small fix Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);

Powered by Google App Engine
This is Rietveld 408576698