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

Unified Diff: third_party/WebKit/Source/modules/compositorworker/AnimationWorklet.cpp

Issue 2171973002: [WIP][worklets] ThreadedWorkletGlobalScope + AnimationWorkletGlobalScope Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ...... Created 4 years, 4 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/compositorworker/AnimationWorklet.cpp
diff --git a/third_party/WebKit/Source/modules/compositorworker/AnimationWorklet.cpp b/third_party/WebKit/Source/modules/compositorworker/AnimationWorklet.cpp
index 6f36ac9f30688348eb1babd3202dcd3fa5c7d7fa..d88bde6e7464520b36cc9e4ec96112804d38d8e6 100644
--- a/third_party/WebKit/Source/modules/compositorworker/AnimationWorklet.cpp
+++ b/third_party/WebKit/Source/modules/compositorworker/AnimationWorklet.cpp
@@ -6,13 +6,15 @@
#include "bindings/core/v8/V8Binding.h"
#include "core/frame/LocalFrame.h"
-#include "core/workers/ThreadedWorkletGlobalScopeProxy.h"
+#include "modules/compositorworker/AnimationWorkletGlobalScopeProxy.h"
+#include "modules/compositorworker/AnimationWorkletThread.h"
namespace blink {
// static
AnimationWorklet* AnimationWorklet::create(LocalFrame* frame)
{
+ AnimationWorkletThread::ensureSharedBackingThread();
AnimationWorklet* worklet = new AnimationWorklet(frame);
worklet->suspendIfNeeded();
return worklet;
@@ -20,17 +22,20 @@ AnimationWorklet* AnimationWorklet::create(LocalFrame* frame)
AnimationWorklet::AnimationWorklet(LocalFrame* frame)
: Worklet(frame)
- , m_workletGlobalScopeProxy(new ThreadedWorkletGlobalScopeProxy())
+ , m_workletMessagingProxy(new AnimationWorkletGlobalScopeProxy(frame))
{
+ m_workletMessagingProxy->initialize();
}
AnimationWorklet::~AnimationWorklet()
{
+ DCHECK(isMainThread());
+ m_workletMessagingProxy->workletObjectDestroyed();
}
WorkletGlobalScopeProxy* AnimationWorklet::workletGlobalScopeProxy() const
{
- return m_workletGlobalScopeProxy.get();
+ return m_workletMessagingProxy.get();
}
DEFINE_TRACE(AnimationWorklet)

Powered by Google App Engine
This is Rietveld 408576698