| Index: third_party/WebKit/Source/web/AnimationWorkletProxyClientImpl.cpp
|
| diff --git a/third_party/WebKit/Source/web/AnimationWorkletProxyClientImpl.cpp b/third_party/WebKit/Source/web/AnimationWorkletProxyClientImpl.cpp
|
| index f5095fe81c02fa0c11e849b15e3f8c2276a00fb8..15004ad94602c4c5568f8ef34012950a6eea92e4 100644
|
| --- a/third_party/WebKit/Source/web/AnimationWorkletProxyClientImpl.cpp
|
| +++ b/third_party/WebKit/Source/web/AnimationWorkletProxyClientImpl.cpp
|
| @@ -21,12 +21,30 @@ DEFINE_TRACE(AnimationWorkletProxyClientImpl) {
|
| CompositorAnimator::Trace(visitor);
|
| }
|
|
|
| +void AnimationWorkletProxyClientImpl::SetGlobalScope(
|
| + WorkletGlobalScope* scope) {
|
| + DCHECK(!IsMainThread());
|
| + DCHECK(scope);
|
| + global_scope_ = static_cast<AnimationWorkletGlobalScope*>(scope);
|
| + mutator_->RegisterCompositorAnimator(this);
|
| +}
|
| +
|
| +void AnimationWorkletProxyClientImpl::Dispose() {
|
| + // At worklet scope termination break the reference cycle between
|
| + // CompositorMutatorImpl and AnimationProxyClientImpl and also the cycle
|
| + // between AnimationWorkletGlobalScope and AnimationWorkletProxyClientImpl.
|
| + mutator_->UnregisterCompositorAnimator(this);
|
| + global_scope_ = nullptr;
|
| +}
|
| +
|
| bool AnimationWorkletProxyClientImpl::Mutate(
|
| double monotonic_time_now,
|
| CompositorMutableStateProvider* provider) {
|
| DCHECK(!IsMainThread());
|
| // TODO(majidvp): actually call JS |animate| callbacks.
|
|
|
| + if (global_scope_)
|
| + global_scope_->Mutate();
|
| // Always request another rAF for now.
|
| return true;
|
| }
|
|
|