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/CompositorProxyClient.h" | |
8 #include "core/dom/FrameRequestCallbackCollection.h" | 9 #include "core/dom/FrameRequestCallbackCollection.h" |
9 #include "core/dom/MessagePort.h" | 10 #include "core/dom/MessagePort.h" |
10 #include "core/workers/WorkerGlobalScope.h" | 11 #include "core/workers/WorkerGlobalScope.h" |
12 #include "modules/ModulesExport.h" | |
11 | 13 |
12 namespace blink { | 14 namespace blink { |
13 | 15 |
14 class CompositorWorkerThread; | 16 class CompositorWorkerThread; |
15 class WorkerThreadStartupData; | 17 class WorkerThreadStartupData; |
16 | 18 |
17 class CompositorWorkerGlobalScope final : public WorkerGlobalScope { | 19 class MODULES_EXPORT CompositorWorkerGlobalScope final : public WorkerGlobalScop e { |
18 DEFINE_WRAPPERTYPEINFO(); | 20 DEFINE_WRAPPERTYPEINFO(); |
21 USING_PRE_FINALIZER(CompositorWorkerGlobalScope, dispose); | |
22 | |
19 public: | 23 public: |
20 static CompositorWorkerGlobalScope* create(CompositorWorkerThread*, PassOwnP tr<WorkerThreadStartupData>, double timeOrigin); | 24 static CompositorWorkerGlobalScope* create(CompositorWorkerThread*, PassOwnP tr<WorkerThreadStartupData>, double timeOrigin); |
21 ~CompositorWorkerGlobalScope() override; | 25 ~CompositorWorkerGlobalScope() override; |
26 void dispose(); | |
22 | 27 |
23 // EventTarget | 28 // EventTarget |
24 const AtomicString& interfaceName() const override; | 29 const AtomicString& interfaceName() const override; |
25 | 30 |
26 void postMessage(ExecutionContext*, PassRefPtr<SerializedScriptValue>, const MessagePortArray&, ExceptionState&); | 31 void postMessage(ExecutionContext*, PassRefPtr<SerializedScriptValue>, const MessagePortArray&, ExceptionState&); |
27 DEFINE_ATTRIBUTE_EVENT_LISTENER(message); | 32 DEFINE_ATTRIBUTE_EVENT_LISTENER(message); |
28 | 33 |
29 int requestAnimationFrame(FrameRequestCallback*); | 34 int requestAnimationFrame(FrameRequestCallback*); |
30 void cancelAnimationFrame(int id); | 35 void cancelAnimationFrame(int id); |
31 void executeAnimationFrameCallbacks(double highResTimeNow); | 36 bool executeAnimationFrameCallbacks(double highResTimeNow); |
jbroman
2016/04/29 19:42:22
Please also change this parameter name to indicate
flackr
2016/05/03 22:24:54
Done.
| |
32 | 37 |
33 // ExecutionContext: | 38 // ExecutionContext: |
34 bool isCompositorWorkerGlobalScope() const override { return true; } | 39 bool isCompositorWorkerGlobalScope() const override { return true; } |
35 | 40 |
36 DECLARE_VIRTUAL_TRACE(); | 41 DECLARE_VIRTUAL_TRACE(); |
37 | 42 |
38 private: | 43 private: |
39 CompositorWorkerGlobalScope(const KURL&, const String& userAgent, Compositor WorkerThread*, double timeOrigin, PassOwnPtr<SecurityOrigin::PrivilegeData>, Wor kerClients*); | 44 CompositorWorkerGlobalScope(const KURL&, const String& userAgent, Compositor WorkerThread*, double timeOrigin, PassOwnPtr<SecurityOrigin::PrivilegeData>, Wor kerClients*); |
40 CompositorWorkerThread* thread() const; | 45 CompositorWorkerThread* thread() const; |
41 | 46 |
47 bool m_executingAnimationFrameCallbacks; | |
42 FrameRequestCallbackCollection m_callbackCollection; | 48 FrameRequestCallbackCollection m_callbackCollection; |
43 }; | 49 }; |
44 | 50 |
45 } // namespace blink | 51 } // namespace blink |
46 | 52 |
47 #endif // CompositorWorkerGlobalScope_h | 53 #endif // CompositorWorkerGlobalScope_h |
OLD | NEW |