diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2018-08-24 12:15:48 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2018-08-28 13:30:04 +0000 |
commit | b014812705fc80bff0a5c120dfcef88f349816dc (patch) | |
tree | 25a2e2d9fa285f1add86aa333389a839f81a39ae /chromium/third_party/blink/renderer/modules/animationworklet/animation_worklet_proxy_client_impl.cc | |
parent | 9f4560b1027ae06fdb497023cdcaf91b8511fa74 (diff) | |
download | qtwebengine-chromium-b014812705fc80bff0a5c120dfcef88f349816dc.tar.gz |
BASELINE: Update Chromium to 68.0.3440.125
Change-Id: I23f19369e01f688e496f5bf179abb521ad73874f
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/third_party/blink/renderer/modules/animationworklet/animation_worklet_proxy_client_impl.cc')
-rw-r--r-- | chromium/third_party/blink/renderer/modules/animationworklet/animation_worklet_proxy_client_impl.cc | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/chromium/third_party/blink/renderer/modules/animationworklet/animation_worklet_proxy_client_impl.cc b/chromium/third_party/blink/renderer/modules/animationworklet/animation_worklet_proxy_client_impl.cc index 6b1ef2666c6..d72889046d3 100644 --- a/chromium/third_party/blink/renderer/modules/animationworklet/animation_worklet_proxy_client_impl.cc +++ b/chromium/third_party/blink/renderer/modules/animationworklet/animation_worklet_proxy_client_impl.cc @@ -49,23 +49,26 @@ void AnimationWorkletProxyClientImpl::SetGlobalScope( } void AnimationWorkletProxyClientImpl::Dispose() { - // At worklet scope termination break the reference to theClient from - // the comositor if it is still alive. - DCHECK(mutator_runner_); - PostCrossThreadTask( - *mutator_runner_, FROM_HERE, - CrossThreadBind(&CompositorMutatorImpl::UnregisterCompositorAnimator, - mutator_, WrapCrossThreadPersistent(this))); + if (state_ == RunState::kWorking) { + // At worklet scope termination break the reference to the Client from + // the compositor if it is still alive. + DCHECK(mutator_runner_); + PostCrossThreadTask( + *mutator_runner_, FROM_HERE, + CrossThreadBind(&CompositorMutatorImpl::UnregisterCompositorAnimator, + mutator_, WrapCrossThreadPersistent(this))); + + DCHECK(global_scope_); + DCHECK(global_scope_->IsContextThread()); + + // At worklet scope termination break the reference cycle between + // AnimationWorkletGlobalScope and AnimationWorkletProxyClientImpl. + global_scope_ = nullptr; + } + mutator_runner_ = nullptr; DCHECK(state_ != RunState::kDisposed); state_ = RunState::kDisposed; - - DCHECK(global_scope_); - DCHECK(global_scope_->IsContextThread()); - - // At worklet scope termination break the reference cycle between - // AnimationWorkletGlobalScope and AnimationWorkletProxyClientImpl. - global_scope_ = nullptr; } std::unique_ptr<CompositorMutatorOutputState> |