| 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 CompositorWorkerThread_h | 5 #ifndef CompositorWorkerThread_h |
| 6 #define CompositorWorkerThread_h | 6 #define CompositorWorkerThread_h |
| 7 | 7 |
| 8 #include "core/workers/WorkerThread.h" | |
| 9 #include "modules/ModulesExport.h" | 8 #include "modules/ModulesExport.h" |
| 9 #include "modules/compositorworker/AbstractAnimationWorkletThread.h" |
| 10 #include <memory> | 10 #include <memory> |
| 11 | 11 |
| 12 namespace blink { | 12 namespace blink { |
| 13 | 13 |
| 14 class InProcessWorkerObjectProxy; | 14 class InProcessWorkerObjectProxy; |
| 15 | 15 |
| 16 class MODULES_EXPORT CompositorWorkerThread final : public WorkerThread { | 16 class MODULES_EXPORT CompositorWorkerThread final : public AbstractAnimationWork
letThread { |
| 17 public: | 17 public: |
| 18 static std::unique_ptr<CompositorWorkerThread> create(PassRefPtr<WorkerLoade
rProxy>, InProcessWorkerObjectProxy&, double timeOrigin); | 18 static std::unique_ptr<CompositorWorkerThread> create(PassRefPtr<WorkerLoade
rProxy>, InProcessWorkerObjectProxy&, double timeOrigin); |
| 19 ~CompositorWorkerThread() override; | 19 ~CompositorWorkerThread() override; |
| 20 | 20 |
| 21 InProcessWorkerObjectProxy& workerObjectProxy() const { return m_workerObjec
tProxy; } | 21 InProcessWorkerObjectProxy& workerObjectProxy() const { return m_workerObjec
tProxy; } |
| 22 WorkerBackingThread& workerBackingThread() override; | |
| 23 bool shouldAttachThreadDebugger() const override { return false; } | |
| 24 | |
| 25 static void ensureSharedBackingThread(); | |
| 26 static void createSharedBackingThreadForTest(); | |
| 27 | |
| 28 static void clearSharedBackingThread(); | |
| 29 | 22 |
| 30 protected: | 23 protected: |
| 24 WorkerOrWorkletGlobalScope* createWorkerGlobalScope(std::unique_ptr<WorkerTh
readStartupData>) override; |
| 25 |
| 26 private: |
| 31 CompositorWorkerThread(PassRefPtr<WorkerLoaderProxy>, InProcessWorkerObjectP
roxy&, double timeOrigin); | 27 CompositorWorkerThread(PassRefPtr<WorkerLoaderProxy>, InProcessWorkerObjectP
roxy&, double timeOrigin); |
| 32 | 28 |
| 33 WorkerOrWorkletGlobalScope* createWorkerGlobalScope(std::unique_ptr<WorkerTh
readStartupData>) override; | |
| 34 bool isOwningBackingThread() const override { return false; } | |
| 35 | |
| 36 private: | |
| 37 InProcessWorkerObjectProxy& m_workerObjectProxy; | 29 InProcessWorkerObjectProxy& m_workerObjectProxy; |
| 38 double m_timeOrigin; | 30 double m_timeOrigin; |
| 39 }; | 31 }; |
| 40 | 32 |
| 41 } // namespace blink | 33 } // namespace blink |
| 42 | 34 |
| 43 #endif // CompositorWorkerThread_h | 35 #endif // CompositorWorkerThread_h |
| OLD | NEW |