| 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);
|
| }
|
|
|