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

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

Issue 2029163002: Worklets - Change inheritance heirarchy of WorkletGlobalScope (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase. Created 4 years, 6 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/modules/v8/ModuleBindingsInitializer.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/modules/v8/ModuleBindingsInitializer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698