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

Unified Diff: third_party/WebKit/Source/modules/worklet/Worklet.cpp

Issue 1818223002: Introduce PaintWorkletGlobalScope, rename renderWorklet attribute to paintWorklet. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix interface listing order. Created 4 years, 9 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/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);
}
« no previous file with comments | « third_party/WebKit/Source/modules/worklet/Worklet.h ('k') | third_party/WebKit/Source/modules/worklet/WorkletGlobalScope.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698