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

Side by Side Diff: third_party/WebKit/Source/web/CompositorWorkerProxyClientImpl.h

Issue 2515363002: Introduce AnimationWorkletProxyClient and necessary plumbing to get it in worklet messaging proxy. (Closed)
Patch Set: Remove unnecessary PLATFORM_EXPORT Created 3 years, 10 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #ifndef CompositorProxyClientImpl_h 5 #ifndef CompositorWorkerProxyClientImpl_h
6 #define CompositorProxyClientImpl_h 6 #define CompositorWorkerProxyClientImpl_h
7 7
8 #include "core/dom/CompositorProxyClient.h" 8 #include "core/dom/CompositorWorkerProxyClient.h"
9 #include "platform/heap/Handle.h" 9 #include "platform/heap/Handle.h"
10 #include "web/CompositorAnimator.h"
10 #include "wtf/Noncopyable.h" 11 #include "wtf/Noncopyable.h"
11 12
12 namespace blink { 13 namespace blink {
13 14
14 class CompositorMutableStateProvider; 15 class CompositorMutableStateProvider;
15 class CompositorMutatorImpl; 16 class CompositorMutatorImpl;
16 class CompositorWorkerGlobalScope; 17 class CompositorWorkerGlobalScope;
17 class WorkerGlobalScope; 18 class WorkerGlobalScope;
18 19
19 // Mediates between one CompositorWorkerGlobalScope and the associated 20 // Mediates between one CompositorWorkerGlobalScope and the associated
20 // CompositorMutatorImpl. There is one CompositorProxyClientImpl per worker 21 // CompositorMutatorImpl. There is one CompositorWorkerProxyClientImpl per
21 // but there may be multiple for a given mutator, e.g. if a single document 22 // worker but there may be multiple for a given mutator, e.g. if a single
22 // creates multiple CompositorWorker objects. 23 // document creates multiple CompositorWorker objects.
23 // 24 //
24 // Should be accessed only on the compositor thread. 25 // Should be accessed only on the compositor thread.
25 class CompositorProxyClientImpl final 26 class CompositorWorkerProxyClientImpl final
26 : public GarbageCollectedFinalized<CompositorProxyClientImpl>, 27 : public CompositorWorkerProxyClient,
27 public CompositorProxyClient { 28 public CompositorAnimator {
28 USING_GARBAGE_COLLECTED_MIXIN(CompositorProxyClientImpl); 29 WTF_MAKE_NONCOPYABLE(CompositorWorkerProxyClientImpl);
29 WTF_MAKE_NONCOPYABLE(CompositorProxyClientImpl); 30 USING_GARBAGE_COLLECTED_MIXIN(CompositorWorkerProxyClientImpl);
30 31
31 public: 32 public:
32 CompositorProxyClientImpl(CompositorMutatorImpl*); 33 explicit CompositorWorkerProxyClientImpl(CompositorMutatorImpl*);
33 DECLARE_VIRTUAL_TRACE(); 34 DECLARE_TRACE();
34 35
35 // Runs the animation frame callback for the frame starting at the given time. 36 // CompositorAnimator:
36 // Returns true if another animation frame was requested (i.e. should be 37 bool mutate(double monotonicTimeNow,
37 // reinvoked next frame). 38 CompositorMutableStateProvider*) override;
38 bool mutate(double monotonicTimeNow, CompositorMutableStateProvider*);
39 39
40 // CompositorProxyClient: 40 // CompositorWorkerProxyClient:
41 void dispose() override; 41 void dispose() override;
42 void setGlobalScope(WorkerGlobalScope*) override; 42 void setGlobalScope(WorkerGlobalScope*) override;
43 void requestAnimationFrame() override; 43 void requestAnimationFrame() override;
44 void registerCompositorProxy(CompositorProxy*) override; 44 void registerCompositorProxy(CompositorProxy*) override;
45 void unregisterCompositorProxy(CompositorProxy*) override; 45 void unregisterCompositorProxy(CompositorProxy*) override;
46 46
47 private: 47 private:
48 bool executeAnimationFrameCallbacks(double monotonicTimeNow); 48 bool executeAnimationFrameCallbacks(double monotonicTimeNow);
49 49
50 CrossThreadPersistent<CompositorMutatorImpl> m_mutator; 50 CrossThreadPersistent<CompositorMutatorImpl> m_mutator;
51 51
52 CrossThreadPersistent<CompositorWorkerGlobalScope> m_globalScope; 52 CrossThreadPersistent<CompositorWorkerGlobalScope> m_globalScope;
53 bool m_requestedAnimationFrameCallbacks; 53 bool m_requestedAnimationFrameCallbacks;
54 54
55 // TODO(majidvp): move this out to a separate class that can be composed in.
55 HeapHashSet<WeakMember<CompositorProxy>> m_proxies; 56 HeapHashSet<WeakMember<CompositorProxy>> m_proxies;
56 }; 57 };
57 58
58 } // namespace blink 59 } // namespace blink
59 60
60 #endif // CompositorProxyClientImpl_h 61 #endif // CompositorWorkerProxyClientImpl_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698