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

Unified Diff: third_party/WebKit/Source/core/loader/ThreadableLoader.cpp

Issue 2880733002: Partially implement WorkerFetchContext and WorkerThreadableLoadingContext and add virtual tests (Closed)
Patch Set: incorporated kinuko's comment Created 3 years, 7 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/core/loader/ThreadableLoader.cpp
diff --git a/third_party/WebKit/Source/core/loader/ThreadableLoader.cpp b/third_party/WebKit/Source/core/loader/ThreadableLoader.cpp
index bf836d3d8de9c0974f9523e72bb32f0c5922450c..cb4ce9a72dc23205fd9b71d9a1fff03830a5c478 100644
--- a/third_party/WebKit/Source/core/loader/ThreadableLoader.cpp
+++ b/third_party/WebKit/Source/core/loader/ThreadableLoader.cpp
@@ -34,8 +34,10 @@
#include "core/dom/ExecutionContext.h"
#include "core/loader/DocumentThreadableLoader.h"
#include "core/loader/ThreadableLoadingContext.h"
+#include "core/loader/WorkerFetchContext.h"
#include "core/loader/WorkerThreadableLoader.h"
#include "core/workers/WorkerGlobalScope.h"
+#include "platform/RuntimeEnabledFeatures.h"
namespace blink {
@@ -47,6 +49,14 @@ ThreadableLoader* ThreadableLoader::Create(
DCHECK(client);
if (context.IsWorkerGlobalScope()) {
+ if (RuntimeEnabledFeatures::offMainThreadFetchEnabled()) {
+ DCHECK(ToWorkerGlobalScope(&context)->GetFetchContext());
+ // TODO(horo): Rename DocumentThreadableLoader. We will use it on the
+ // worker thread when off-main-thread-fetch is enabled.
+ return DocumentThreadableLoader::Create(
+ *ThreadableLoadingContext::Create(*ToWorkerGlobalScope(&context)),
+ client, options, resource_loader_options);
+ }
return WorkerThreadableLoader::Create(ToWorkerGlobalScope(context), client,
options, resource_loader_options);
}

Powered by Google App Engine
This is Rietveld 408576698