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