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

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

Issue 2804843005: Implement the infrastructure of creating WorkerFetchContext in worker global scope. (Closed)
Patch Set: 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/WebSharedWorkerImpl.cpp
diff --git a/third_party/WebKit/Source/web/WebSharedWorkerImpl.cpp b/third_party/WebKit/Source/web/WebSharedWorkerImpl.cpp
index 9f0e0963d6edaa02f0cde45b4c88bd069791d8ba..798288a467d87b772f869643deb7088c8c91e380 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"
@@ -339,6 +340,18 @@ void WebSharedWorkerImpl::OnScriptLoaderFinished() {
web_security_origin)));
ProvideIndexedDBClientToWorker(worker_clients,
IndexedDBClientImpl::Create(*worker_clients));
+
+ std::unique_ptr<WebWorkerFetchContextInfo> web_worker_fetch_context_info =
+ Platform::Current()->CreateWorkerFetchContextInfo();
+ // |web_worker_fetch_context_info| is null if off-main-thread-fetch is
+ // disabled.
+ if (web_worker_fetch_context_info) {
+ // TODO(horo): Set more information about the context (ex: Service Worker
+ // provider ID) to |web_worker_fetch_context_info|.
+ ProvideWorkerFetchContextInfoToWorker(
+ worker_clients, std::move(web_worker_fetch_context_info));
+ }
+
ContentSecurityPolicy* content_security_policy =
main_script_loader_->ReleaseContentSecurityPolicy();
WorkerThreadStartMode start_mode =

Powered by Google App Engine
This is Rietveld 408576698