Index: third_party/WebKit/Source/modules/worklet/Worklet.cpp |
diff --git a/third_party/WebKit/Source/modules/worklet/Worklet.cpp b/third_party/WebKit/Source/modules/worklet/Worklet.cpp |
index 1b9d032c59a8c260ce6c3000647ce9c5cf81ae3a..5c04f405ee9fd07f30fff827f2eb20bc3e8a9958 100644 |
--- a/third_party/WebKit/Source/modules/worklet/Worklet.cpp |
+++ b/third_party/WebKit/Source/modules/worklet/Worklet.cpp |
@@ -15,17 +15,8 @@ |
namespace blink { |
-// static |
-Worklet* Worklet::create(LocalFrame* frame, ExecutionContext* executionContext) |
-{ |
- Worklet* worklet = new Worklet(frame, executionContext); |
- worklet->suspendIfNeeded(); |
- return worklet; |
-} |
- |
-Worklet::Worklet(LocalFrame* frame, ExecutionContext* executionContext) |
+Worklet::Worklet(ExecutionContext* executionContext) |
: ActiveDOMObject(executionContext) |
- , m_workletGlobalScope(WorkletGlobalScope::create(frame, executionContext->url(), executionContext->userAgent(), executionContext->getSecurityOrigin(), toIsolate(executionContext))) |
{ |
} |
@@ -72,8 +63,8 @@ void Worklet::onFinished(WorkerScriptLoader* scriptLoader, ScriptPromiseResolver |
// TODO(ikilpatrick): Worklets don't have the same error behaviour |
// as workers, etc. For a SyntaxError we should reject, however if |
// the script throws a normal error, resolve. For now just resolve. |
- m_workletGlobalScope->scriptController()->evaluate(ScriptSourceCode(scriptLoader->script(), scriptLoader->url())); |
- InspectorInstrumentation::scriptImported(m_workletGlobalScope.get(), scriptLoader->identifier(), scriptLoader->script()); |
+ workletGlobalScope()->scriptController()->evaluate(ScriptSourceCode(scriptLoader->script(), scriptLoader->url())); |
+ InspectorInstrumentation::scriptImported(workletGlobalScope(), scriptLoader->identifier(), scriptLoader->script()); |
resolver->resolve(); |
} |
@@ -88,7 +79,7 @@ void Worklet::onFinished(WorkerScriptLoader* scriptLoader, ScriptPromiseResolver |
void Worklet::stop() |
{ |
- m_workletGlobalScope->scriptController()->willScheduleExecutionTermination(); |
+ workletGlobalScope()->scriptController()->willScheduleExecutionTermination(); |
for (auto scriptLoader : m_scriptLoaders) { |
scriptLoader->cancel(); |
@@ -98,7 +89,6 @@ void Worklet::stop() |
DEFINE_TRACE(Worklet) |
{ |
visitor->trace(m_resolvers); |
- visitor->trace(m_workletGlobalScope); |
ActiveDOMObject::trace(visitor); |
} |