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

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

Issue 2804843005: Implement the infrastructure of creating WorkerFetchContext in worker global scope. (Closed)
Patch Set: rebase 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/WebEmbeddedWorkerImpl.cpp
diff --git a/third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.cpp b/third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.cpp
index 6acd6833d14aa1989cea9188bbb255a3c6f07ea9..1882bf9fc7a0318e5d9773b06b68e9d51f676039 100644
--- a/third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.cpp
+++ b/third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.cpp
@@ -38,6 +38,7 @@
#include "core/inspector/ConsoleMessage.h"
#include "core/loader/FrameLoadRequest.h"
#include "core/loader/ThreadableLoadingContext.h"
+#include "core/loader/WorkerFetchContext.h"
#include "core/probe/CoreProbes.h"
#include "core/workers/ParentFrameTaskRunners.h"
#include "core/workers/WorkerClients.h"
@@ -433,6 +434,17 @@ void WebEmbeddedWorkerImpl::StartWorkerThread() {
worker_clients,
WTF::WrapUnique(worker_context_client_->CreateServiceWorkerProvider()));
+ std::unique_ptr<WebWorkerFetchContext> web_worker_fetch_context =
nhiroki 2017/04/18 07:56:41 ditto.
horo 2017/04/18 12:53:34 Done.
+ WTF::WrapUnique(
+ worker_context_client_->CreateServiceWorkerFetchContext());
+ // |web_worker_fetch_context| is null if off-main-thread-fetch is disabled.
+ if (web_worker_fetch_context) {
+ // TODO(horo): Set more information about the context (ex: DataSaverEnabled)
+ // to |web_worker_fetch_context|.
+ ProvideWorkerFetchContextToWorker(worker_clients,
+ std::move(web_worker_fetch_context));
+ }
+
// We need to set the CSP to both the shadow page's document and the
// ServiceWorkerGlobalScope.
document->InitContentSecurityPolicy(

Powered by Google App Engine
This is Rietveld 408576698