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

Side by Side Diff: third_party/WebKit/Source/modules/compositorworker/AnimationWorklet.cpp

Issue 2819153003: Worklet: Separate Worklet into MainThreadWorklet and ThreadedWorklet (Closed)
Patch Set: update comments Created 3 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "modules/compositorworker/AnimationWorklet.h" 5 #include "modules/compositorworker/AnimationWorklet.h"
6 6
7 #include "bindings/core/v8/V8Binding.h" 7 #include "bindings/core/v8/V8Binding.h"
8 #include "core/dom/AnimationWorkletProxyClient.h" 8 #include "core/dom/AnimationWorkletProxyClient.h"
9 #include "core/dom/Document.h" 9 #include "core/dom/Document.h"
10 #include "core/frame/LocalFrame.h" 10 #include "core/frame/LocalFrame.h"
11 #include "core/page/ChromeClient.h" 11 #include "core/page/ChromeClient.h"
12 #include "modules/compositorworker/AnimationWorkletMessagingProxy.h" 12 #include "modules/compositorworker/AnimationWorkletMessagingProxy.h"
13 #include "modules/compositorworker/AnimationWorkletThread.h" 13 #include "modules/compositorworker/AnimationWorkletThread.h"
14 14
15 namespace blink { 15 namespace blink {
16 16
17 // static 17 // static
18 AnimationWorklet* AnimationWorklet::Create(LocalFrame* frame) { 18 AnimationWorklet* AnimationWorklet::Create(LocalFrame* frame) {
19 return new AnimationWorklet(frame); 19 return new AnimationWorklet(frame);
20 } 20 }
21 21
22 AnimationWorklet::AnimationWorklet(LocalFrame* frame) 22 AnimationWorklet::AnimationWorklet(LocalFrame* frame)
23 : Worklet(frame), worklet_messaging_proxy_(nullptr) {} 23 : ThreadedWorklet(frame), worklet_messaging_proxy_(nullptr) {}
24 24
25 AnimationWorklet::~AnimationWorklet() { 25 AnimationWorklet::~AnimationWorklet() {
26 if (worklet_messaging_proxy_) 26 if (worklet_messaging_proxy_)
27 worklet_messaging_proxy_->ParentObjectDestroyed(); 27 worklet_messaging_proxy_->ParentObjectDestroyed();
28 } 28 }
29 29
30 void AnimationWorklet::Initialize() { 30 void AnimationWorklet::Initialize() {
31 AnimationWorkletThread::EnsureSharedBackingThread(); 31 AnimationWorkletThread::EnsureSharedBackingThread();
32 32
33 DCHECK(!worklet_messaging_proxy_); 33 DCHECK(!worklet_messaging_proxy_);
(...skipping 11 matching lines...) Expand all
45 bool AnimationWorklet::IsInitialized() const { 45 bool AnimationWorklet::IsInitialized() const {
46 return worklet_messaging_proxy_; 46 return worklet_messaging_proxy_;
47 } 47 }
48 48
49 WorkletGlobalScopeProxy* AnimationWorklet::GetWorkletGlobalScopeProxy() const { 49 WorkletGlobalScopeProxy* AnimationWorklet::GetWorkletGlobalScopeProxy() const {
50 DCHECK(worklet_messaging_proxy_); 50 DCHECK(worklet_messaging_proxy_);
51 return worklet_messaging_proxy_; 51 return worklet_messaging_proxy_;
52 } 52 }
53 53
54 DEFINE_TRACE(AnimationWorklet) { 54 DEFINE_TRACE(AnimationWorklet) {
55 Worklet::Trace(visitor); 55 ThreadedWorklet::Trace(visitor);
56 } 56 }
57 57
58 } // namespace blink 58 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698