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) |