Chromium Code Reviews| 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..b0470ae4056e5975d1a7bb97e081f4a87b3954e0 100644 |
| --- a/third_party/WebKit/Source/modules/compositorworker/AnimationWorklet.cpp |
| +++ b/third_party/WebKit/Source/modules/compositorworker/AnimationWorklet.cpp |
| @@ -5,14 +5,17 @@ |
| #include "modules/compositorworker/AnimationWorklet.h" |
| #include "bindings/core/v8/V8Binding.h" |
| +#include "core/dom/Document.h" |
| #include "core/frame/LocalFrame.h" |
| -#include "core/workers/ThreadedWorkletGlobalScopeProxy.h" |
| +#include "modules/compositorworker/AnimationWorkletMessagingProxy.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 +23,20 @@ AnimationWorklet* AnimationWorklet::create(LocalFrame* frame) |
| AnimationWorklet::AnimationWorklet(LocalFrame* frame) |
| : Worklet(frame) |
| - , m_workletGlobalScopeProxy(new ThreadedWorkletGlobalScopeProxy()) |
| + , m_workletMessagingProxy(new AnimationWorkletMessagingProxy(frame->document())) |
| { |
| + m_workletMessagingProxy->initialize(); |
| } |
| AnimationWorklet::~AnimationWorklet() |
| { |
| + DCHECK(m_workletMessagingProxy); |
|
yhirano
2016/09/12 09:02:58
Is it good to move this check to the constructor a
ikilpatrick
2016/09/12 17:29:07
sgtm, I've just removed the DCHECK now that it's a
|
| + m_workletMessagingProxy->parentObjectDestroyed(); |
| } |
| WorkletGlobalScopeProxy* AnimationWorklet::workletGlobalScopeProxy() const |
| { |
| - return m_workletGlobalScopeProxy.get(); |
| + return m_workletMessagingProxy; |
| } |
| DEFINE_TRACE(AnimationWorklet) |