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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/V8Binding.cpp

Issue 1535943005: Initial implementation of bindings and basic classes for worklets. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: absolute paths for DEPS file. Created 4 years, 11 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/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 2119d8c5eb5f4e80d25678ab689fab996a0f4ca7..a44710a5686b12a41ecf7237f5933ee592d81cb6 100644
--- a/third_party/WebKit/Source/bindings/core/v8/V8Binding.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/V8Binding.cpp
@@ -701,6 +701,10 @@ 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())
@@ -712,8 +716,13 @@ ExecutionContext* toExecutionContext(v8::Local<v8::Context> context)
v8::Local<v8::Object> workerWrapper = V8WorkerGlobalScope::findInstanceInPrototypeChain(global, context->GetIsolate());
if (!workerWrapper.IsEmpty())
return V8WorkerGlobalScope::toImpl(workerWrapper)->executionContext();
- // FIXME: Is this line of code reachable?
- return 0;
+ ASSERT(s_toExecutionContextForModules);
+ return (*s_toExecutionContextForModules)(context);
+}
+
+void registerToExecutionContextForModules(ExecutionContext* (*toExecutionContextForModules)(v8::Local<v8::Context>))
+{
+ s_toExecutionContextForModules = toExecutionContextForModules;
}
ExecutionContext* currentExecutionContext(v8::Isolate* isolate)
@@ -778,7 +787,7 @@ v8::Local<v8::Context> toV8Context(ExecutionContext* context, DOMWrapperWorld& w
if (LocalFrame* frame = toDocument(context)->frame())
return toV8Context(frame, world);
} else if (context->isWorkerGlobalScope()) {
- if (WorkerOrWorkletScriptController* script = toWorkerGlobalScope(context)->script()) {
+ if (WorkerOrWorkletScriptController* script = toWorkerOrWorkletGlobalScope(context)->script()) {
if (script->scriptState()->contextIsValid())
return script->scriptState()->context();
}
« no previous file with comments | « third_party/WebKit/Source/bindings/core/v8/V8Binding.h ('k') | third_party/WebKit/Source/bindings/core/v8/V8DOMWrapper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698