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