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