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

Unified Diff: third_party/WebKit/Source/web/WebSharedWorkerImpl.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
« no previous file with comments | « third_party/WebKit/Source/web/WebSharedWorkerImpl.h ('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 9f0e0963d6edaa02f0cde45b4c88bd069791d8ba..817b1930025847914475d23ab0e205c2f720dc9c 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"
@@ -48,8 +49,10 @@
#include "core/workers/WorkerScriptLoader.h"
#include "core/workers/WorkerThreadStartupData.h"
#include "platform/CrossThreadFunctional.h"
+#include "platform/RuntimeEnabledFeatures.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"
@@ -61,6 +64,7 @@
#include "public/platform/WebString.h"
#include "public/platform/WebURL.h"
#include "public/platform/WebURLRequest.h"
+#include "public/platform/WebWorkerFetchContext.h"
#include "public/platform/modules/serviceworker/WebServiceWorkerNetworkProvider.h"
#include "public/web/WebDevToolsAgent.h"
#include "public/web/WebFrame.h"
@@ -339,6 +343,21 @@ void WebSharedWorkerImpl::OnScriptLoaderFinished() {
web_security_origin)));
ProvideIndexedDBClientToWorker(worker_clients,
IndexedDBClientImpl::Create(*worker_clients));
+
+ if (RuntimeEnabledFeatures::offMainThreadFetchEnabled()) {
+ std::unique_ptr<WebWorkerFetchContext> web_worker_fetch_context =
+ WTF::WrapUnique(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));
+ }
+
ContentSecurityPolicy* content_security_policy =
main_script_loader_->ReleaseContentSecurityPolicy();
WorkerThreadStartMode start_mode =
@@ -423,6 +442,13 @@ void WebSharedWorkerImpl::DispatchDevToolsMessage(int session_id,
message);
}
+WebServiceWorkerNetworkProvider*
+WebSharedWorkerImpl::GetServiceWorkerNetworkProvider() {
+ WebLocalFrameImpl* webFrame =
+ WebLocalFrameImpl::FromFrame(main_frame_->GetFrame());
+ return webFrame->DataSource()->GetServiceWorkerNetworkProvider();
+}
+
WebSharedWorker* WebSharedWorker::Create(WebSharedWorkerClient* client) {
return new WebSharedWorkerImpl(client);
}
« no previous file with comments | « third_party/WebKit/Source/web/WebSharedWorkerImpl.h ('k') | third_party/WebKit/public/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698