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

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

Issue 2816403002: test all
Patch Set: fix sharedworker 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 cf0153e0110d1db11f297b6e16b069a7c93852cc..caac43314358102f8ba8ff6c2c99cb25b733d1e8 100644
--- a/third_party/WebKit/Source/web/DedicatedWorkerMessagingProxyProviderImpl.cpp
+++ b/third_party/WebKit/Source/web/DedicatedWorkerMessagingProxyProviderImpl.cpp
@@ -31,12 +31,18 @@
#include "web/DedicatedWorkerMessagingProxyProviderImpl.h"
#include "core/dom/Document.h"
+#include "core/frame/Settings.h"
+#include "core/loader/WorkerFetchContext.h"
#include "core/workers/DedicatedWorkerMessagingProxy.h"
#include "core/workers/Worker.h"
#include "core/workers/WorkerClients.h"
+#include "platform/RuntimeEnabledFeatures.h"
+#include "platform/loader/fetch/ResourceFetcher.h"
#include "platform/wtf/PtrUtil.h"
+#include "public/platform/Platform.h"
#include "public/platform/WebContentSettingsClient.h"
#include "public/platform/WebString.h"
+#include "public/platform/WebWorkerFetchContext.h"
#include "public/web/WebFrameClient.h"
#include "public/web/WebWorkerContentSettingsClientProxy.h"
#include "web/IndexedDBClientImpl.h"
@@ -67,6 +73,21 @@ DedicatedWorkerMessagingProxyProviderImpl::CreateWorkerMessagingProxy(
worker_clients,
WTF::WrapUnique(
web_frame->Client()->CreateWorkerContentSettingsClientProxy()));
+ if (RuntimeEnabledFeatures::offMainThreadFetchEnabled()) {
+ std::unique_ptr<WebWorkerFetchContext> web_worker_fetch_context =
+ WTF::WrapUnique(web_frame->Client()->CreateWorkerFetchContext());
+ DCHECK(web_worker_fetch_context);
+
+ web_worker_fetch_context->SetAppCacheHostID(
+ document->Fetcher()->Context().ApplicationCacheHostID());
+
+ web_worker_fetch_context->SetDataSaverEnabled(
+ document->GetFrame()->GetSettings()->GetDataSaverEnabled());
+ web_worker_fetch_context->SetStrictMixedContentCheckingEnabled(
+ document->GetFrame()->GetSettings()->GetStrictMixedContentChecking());
+ ProvideWorkerFetchContextToWorker(worker_clients,
+ std::move(web_worker_fetch_context));
+ }
// FIXME: call provideServiceWorkerContainerClientToWorker here when we
// support ServiceWorker in dedicated workers (http://crbug.com/371690)
return new DedicatedWorkerMessagingProxy(worker, worker_clients);

Powered by Google App Engine
This is Rietveld 408576698