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

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

Issue 2807533003: [WIP2] off-main-thread loading
Patch Set: call set_is_secure_context in EmbeddedSharedWorkerStub::CreateWorkerFetchContext() 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/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) {
+ return DocumentThreadableLoader::Create(
+ *ThreadableLoadingContext::Create(*ToWorkerGlobalScope(&context)),
+ client, options, resource_loader_options);
+ }
+ }
return WorkerThreadableLoader::Create(ToWorkerGlobalScope(context), client,
options, resource_loader_options);
}
« no previous file with comments | « third_party/WebKit/Source/core/loader/PingLoader.cpp ('k') | third_party/WebKit/Source/core/loader/ThreadableLoadingContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698