Index: third_party/WebKit/Source/core/workers/WorkerGlobalScope.cpp |
diff --git a/third_party/WebKit/Source/core/workers/WorkerGlobalScope.cpp b/third_party/WebKit/Source/core/workers/WorkerGlobalScope.cpp |
index 15c1f33920f1d6ea47ae5009b9877e0679c52c79..5b8030ab99b853facaa83123afdaa7120b319090 100644 |
--- a/third_party/WebKit/Source/core/workers/WorkerGlobalScope.cpp |
+++ b/third_party/WebKit/Source/core/workers/WorkerGlobalScope.cpp |
@@ -40,6 +40,7 @@ |
#include "core/inspector/ConsoleMessage.h" |
#include "core/inspector/ConsoleMessageStorage.h" |
#include "core/inspector/WorkerThreadDebugger.h" |
+#include "core/loader/WorkerFetchContext.h" |
#include "core/loader/WorkerThreadableLoader.h" |
#include "core/probe/CoreProbes.h" |
#include "core/workers/WorkerClients.h" |
@@ -51,6 +52,7 @@ |
#include "core/workers/WorkerThread.h" |
#include "platform/CrossThreadFunctional.h" |
#include "platform/InstanceCounters.h" |
+#include "platform/RuntimeEnabledFeatures.h" |
#include "platform/loader/fetch/MemoryCache.h" |
#include "platform/network/ContentSecurityPolicyParsers.h" |
#include "platform/weborigin/KURL.h" |
@@ -300,6 +302,14 @@ ExecutionContext* WorkerGlobalScope::GetExecutionContext() const { |
return const_cast<WorkerGlobalScope*>(this); |
} |
+WorkerFetchContext* WorkerGlobalScope::FetchContext() { |
+ DCHECK(RuntimeEnabledFeatures::offMainThreadFetchEnabled()); |
+ if (fetch_context_) |
+ return fetch_context_; |
+ fetch_context_ = WorkerFetchContext::Create(*this); |
+ return fetch_context_; |
+} |
+ |
WorkerGlobalScope::WorkerGlobalScope( |
const KURL& url, |
const String& user_agent, |
@@ -376,6 +386,7 @@ DEFINE_TRACE(WorkerGlobalScope) { |
visitor->Trace(timers_); |
visitor->Trace(event_listeners_); |
visitor->Trace(pending_error_events_); |
+ visitor->Trace(fetch_context_); |
ExecutionContext::Trace(visitor); |
EventTargetWithInlineData::Trace(visitor); |
SecurityContext::Trace(visitor); |