OLD | NEW |
---|---|
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 CompositorWorkerGlobalScope_h | 5 #ifndef CompositorWorkerGlobalScope_h |
6 #define CompositorWorkerGlobalScope_h | 6 #define CompositorWorkerGlobalScope_h |
7 | 7 |
8 #include "core/dom/MessagePort.h" | 8 #include "core/dom/MessagePort.h" |
9 #include "core/dom/RequestAnimationFrameCallbackCollection.h" | |
9 #include "core/workers/WorkerGlobalScope.h" | 10 #include "core/workers/WorkerGlobalScope.h" |
10 | 11 |
11 namespace blink { | 12 namespace blink { |
12 | 13 |
13 class CompositorWorkerThread; | 14 class CompositorWorkerThread; |
14 class WorkerThreadStartupData; | 15 class WorkerThreadStartupData; |
15 | 16 |
16 class CompositorWorkerGlobalScope final : public WorkerGlobalScope { | 17 class CompositorWorkerGlobalScope final : public WorkerGlobalScope { |
17 DEFINE_WRAPPERTYPEINFO(); | 18 DEFINE_WRAPPERTYPEINFO(); |
18 public: | 19 public: |
19 static PassRefPtrWillBeRawPtr<CompositorWorkerGlobalScope> create(Compositor WorkerThread*, PassOwnPtrWillBeRawPtr<WorkerThreadStartupData>, double timeOrigi n); | 20 static PassRefPtrWillBeRawPtr<CompositorWorkerGlobalScope> create(Compositor WorkerThread*, PassOwnPtrWillBeRawPtr<WorkerThreadStartupData>, double timeOrigi n); |
20 virtual ~CompositorWorkerGlobalScope(); | 21 virtual ~CompositorWorkerGlobalScope(); |
21 | 22 |
22 // EventTarget | 23 // EventTarget |
23 const AtomicString& interfaceName() const override; | 24 const AtomicString& interfaceName() const override; |
24 | 25 |
25 void postMessage(ExecutionContext*, PassRefPtr<SerializedScriptValue>, const MessagePortArray*, ExceptionState&); | 26 void postMessage(ExecutionContext*, PassRefPtr<SerializedScriptValue>, const MessagePortArray*, ExceptionState&); |
26 DEFINE_ATTRIBUTE_EVENT_LISTENER(message); | 27 DEFINE_ATTRIBUTE_EVENT_LISTENER(message); |
27 | 28 |
28 void executeCompositorFrameCallbacks(double monotonicTimeNow); | 29 int requestCompositorFrame(RequestAnimationFrameCallback*); |
esprehn
2015/03/30 18:43:12
Why not just call this thing requestAnimationFrame
sadrul
2015/03/31 02:45:36
Done.
| |
30 void cancelCompositorFrame(int id); | |
31 void executeCompositorFrameCallbacks(double highResTimeNow); | |
29 | 32 |
30 // ExecutionContext: | 33 // ExecutionContext: |
31 bool isCompositorWorkerGlobalScope() const override { return true; } | 34 bool isCompositorWorkerGlobalScope() const override { return true; } |
32 | 35 |
33 private: | 36 private: |
34 CompositorWorkerGlobalScope(const KURL&, const String& userAgent, Compositor WorkerThread*, double timeOrigin, const SecurityOrigin*, PassOwnPtrWillBeRawPtr< WorkerClients>); | 37 CompositorWorkerGlobalScope(const KURL&, const String& userAgent, Compositor WorkerThread*, double timeOrigin, const SecurityOrigin*, PassOwnPtrWillBeRawPtr< WorkerClients>); |
35 CompositorWorkerThread* thread() const; | 38 CompositorWorkerThread* thread() const; |
39 | |
40 RequestAnimationFrameCallbackCollection m_callbackCollection; | |
36 }; | 41 }; |
37 | 42 |
38 } // namespace blink | 43 } // namespace blink |
39 | 44 |
40 #endif // CompositorWorkerGlobalScope_h | 45 #endif // CompositorWorkerGlobalScope_h |
OLD | NEW |