Index: third_party/WebKit/Source/bindings/core/v8/V8Binding.cpp |
diff --git a/third_party/WebKit/Source/bindings/core/v8/V8Binding.cpp b/third_party/WebKit/Source/bindings/core/v8/V8Binding.cpp |
index 12feb930c7ca789b80742e3420301170537ef721..5cee46d29e4ca1ad93bb61e631b53988a2bbf303 100644 |
--- a/third_party/WebKit/Source/bindings/core/v8/V8Binding.cpp |
+++ b/third_party/WebKit/Source/bindings/core/v8/V8Binding.cpp |
@@ -41,6 +41,7 @@ |
#include "bindings/core/v8/V8ObjectConstructor.h" |
#include "bindings/core/v8/V8Window.h" |
#include "bindings/core/v8/V8WorkerGlobalScope.h" |
+#include "bindings/core/v8/V8WorkletGlobalScope.h" |
#include "bindings/core/v8/V8XPathNSResolver.h" |
#include "bindings/core/v8/WindowProxy.h" |
#include "bindings/core/v8/WorkerOrWorkletScriptController.h" |
@@ -57,6 +58,7 @@ |
#include "core/loader/FrameLoader.h" |
#include "core/loader/FrameLoaderClient.h" |
#include "core/workers/WorkerGlobalScope.h" |
+#include "core/workers/WorkletGlobalScope.h" |
#include "core/xml/XPathNSResolver.h" |
#include "platform/TracedValue.h" |
#include "wtf/MathExtras.h" |
@@ -691,10 +693,6 @@ LocalDOMWindow* currentDOMWindow(v8::Isolate* isolate) |
return toLocalDOMWindow(toDOMWindow(isolate->GetCurrentContext())); |
} |
-namespace { |
-ExecutionContext* (*s_toExecutionContextForModules)(v8::Local<v8::Context>) = nullptr; |
-} |
- |
ExecutionContext* toExecutionContext(v8::Local<v8::Context> context) |
{ |
if (context.IsEmpty()) |
@@ -706,13 +704,11 @@ ExecutionContext* toExecutionContext(v8::Local<v8::Context> context) |
v8::Local<v8::Object> workerWrapper = V8WorkerGlobalScope::findInstanceInPrototypeChain(global, context->GetIsolate()); |
if (!workerWrapper.IsEmpty()) |
return V8WorkerGlobalScope::toImpl(workerWrapper)->getExecutionContext(); |
- ASSERT(s_toExecutionContextForModules); |
- return (*s_toExecutionContextForModules)(context); |
-} |
- |
-void registerToExecutionContextForModules(ExecutionContext* (*toExecutionContextForModules)(v8::Local<v8::Context>)) |
-{ |
- s_toExecutionContextForModules = toExecutionContextForModules; |
+ v8::Local<v8::Object> workletWrapper = V8WorkletGlobalScope::findInstanceInPrototypeChain(global, context->GetIsolate()); |
+ if (!workletWrapper.IsEmpty()) |
+ return V8WorkletGlobalScope::toImpl(workletWrapper); |
+ // FIXME: Is this line of code reachable? |
+ return nullptr; |
} |
ExecutionContext* currentExecutionContext(v8::Isolate* isolate) |