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 389e4556f5f5dc08c82d98876ed2912805fd17b7..2a4bc33677d2524485056028401358a83cca8d29 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" |
@@ -703,10 +704,6 @@ LocalDOMWindow* callingDOMWindow(v8::Isolate* isolate) |
return toLocalDOMWindow(toDOMWindow(context)); |
} |
-namespace { |
-ExecutionContext* (*s_toExecutionContextForModules)(v8::Local<v8::Context>) = nullptr; |
-} |
- |
ExecutionContext* toExecutionContext(v8::Local<v8::Context> context) |
{ |
if (context.IsEmpty()) |
@@ -718,13 +715,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 V8WorkerGlobalScope::toImpl(workletWrapper)->getExecutionContext(); |
yhirano
2016/06/02 08:14:42
Shouldn't this be V8WorkletGlobalScope?
ikilpatrick
2016/06/02 18:26:00
Yup, done.
|
+ // FIXME: Is this line of code reachable? |
+ return nullptr; |
} |
ExecutionContext* currentExecutionContext(v8::Isolate* isolate) |