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

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

Issue 2880733002: Partially implement WorkerFetchContext and WorkerThreadableLoadingContext and add virtual tests (Closed)
Patch Set: add override 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..e7d0ad5027c5157b974f3364cb4a92d56927d4a2 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,15 @@ ThreadableLoader* ThreadableLoader::Create(
DCHECK(client);
if (context.IsWorkerGlobalScope()) {
+ if (RuntimeEnabledFeatures::offMainThreadFetchEnabled()) {
+ WorkerFetchContext* worker_fetch_contrext =
+ ToWorkerGlobalScope(&context)->GetFetchContext();
+ if (worker_fetch_contrext) {
kinuko 2017/05/13 13:26:42 When this could return nullptr?
horo 2017/05/13 17:05:45 Ah, yes. This should be DCHECK().
+ return DocumentThreadableLoader::Create(
kinuko 2017/05/13 13:26:42 Can you add a TODO to DocumentThreadableLoader to
horo 2017/05/13 17:05:45 Done.
+ *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