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

Unified Diff: third_party/WebKit/Source/web/WebSharedWorkerImpl.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
« no previous file with comments | « third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.cpp ('k') | third_party/WebKit/public/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/web/WebSharedWorkerImpl.cpp
diff --git a/third_party/WebKit/Source/web/WebSharedWorkerImpl.cpp b/third_party/WebKit/Source/web/WebSharedWorkerImpl.cpp
index 6726bb88fc5495779932c70d85a6eccc023439c9..ad3bfc9684441ceac65c9485c0451721bbea28ef 100644
--- a/third_party/WebKit/Source/web/WebSharedWorkerImpl.cpp
+++ b/third_party/WebKit/Source/web/WebSharedWorkerImpl.cpp
@@ -37,6 +37,7 @@
#include "core/loader/FrameLoadRequest.h"
#include "core/loader/FrameLoader.h"
#include "core/loader/ThreadableLoadingContext.h"
+#include "core/loader/WorkerFetchContext.h"
#include "core/probe/CoreProbes.h"
#include "core/workers/ParentFrameTaskRunners.h"
#include "core/workers/SharedWorkerGlobalScope.h"
@@ -50,6 +51,7 @@
#include "platform/CrossThreadFunctional.h"
#include "platform/heap/Handle.h"
#include "platform/heap/Persistent.h"
+#include "platform/loader/fetch/ResourceFetcher.h"
#include "platform/loader/fetch/ResourceResponse.h"
#include "platform/network/ContentSecurityPolicyParsers.h"
#include "platform/weborigin/KURL.h"
@@ -339,6 +341,32 @@ void WebSharedWorkerImpl::onScriptLoaderFinished() {
m_client->createWorkerContentSettingsClientProxy(webSecurityOrigin)));
provideIndexedDBClientToWorker(workerClients,
IndexedDBClientImpl::create(*workerClients));
+
+ 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());
+ webWorkerFetchContextInfo->setIsSecureContext(document->isSecureContext());
+ WebLocalFrameImpl* webFrame =
+ WebLocalFrameImpl::fromFrame(document->frame());
+ WebServiceWorkerNetworkProvider* provider =
+ webFrame->dataSource()->getServiceWorkerNetworkProvider();
+ webWorkerFetchContextInfo->setServiceWorkerProviderID(
+ provider->providerID());
+ webWorkerFetchContextInfo->setIsControlledByServiceWorker(
+ provider->isControlledByServiceWorker());
+ provideWorkerFetchContextInfoToWorker(workerClients,
+ std::move(webWorkerFetchContextInfo));
+ WorkerFetchContextInfo* workerFetchContextInfo =
+ WorkerFetchContextInfo::from(*workerClients);
+ workerFetchContextInfo->setDataSaverEnabled(
+ document->frame()->settings()->getDataSaverEnabled());
+ workerFetchContextInfo->setStrictMixedContentCheckingEnabled(
+ document->frame()->settings()->getStrictMixedContentChecking());
+ }
+
ContentSecurityPolicy* contentSecurityPolicy =
m_mainScriptLoader->releaseContentSecurityPolicy();
WorkerThreadStartMode startMode =
« no previous file with comments | « third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.cpp ('k') | third_party/WebKit/public/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698