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