| 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" | 8 #include "core/workers/WorkerThread.h" |
| 9 #include "modules/ModulesExport.h" | 9 #include "modules/ModulesExport.h" |
| 10 #include <memory> |
| 10 | 11 |
| 11 namespace blink { | 12 namespace blink { |
| 12 | 13 |
| 13 class InProcessWorkerObjectProxy; | 14 class InProcessWorkerObjectProxy; |
| 14 | 15 |
| 15 // This class is overridden in unit-tests. | 16 // This class is overridden in unit-tests. |
| 16 class MODULES_EXPORT CompositorWorkerThread final : public WorkerThread { | 17 class MODULES_EXPORT CompositorWorkerThread final : public WorkerThread { |
| 17 public: | 18 public: |
| 18 static PassOwnPtr<CompositorWorkerThread> create(PassRefPtr<WorkerLoaderProx
y>, InProcessWorkerObjectProxy&, double timeOrigin); | 19 static std::unique_ptr<CompositorWorkerThread> create(PassRefPtr<WorkerLoade
rProxy>, InProcessWorkerObjectProxy&, double timeOrigin); |
| 19 ~CompositorWorkerThread() override; | 20 ~CompositorWorkerThread() override; |
| 20 | 21 |
| 21 InProcessWorkerObjectProxy& workerObjectProxy() const { return m_workerObjec
tProxy; } | 22 InProcessWorkerObjectProxy& workerObjectProxy() const { return m_workerObjec
tProxy; } |
| 22 WorkerBackingThread& workerBackingThread() override; | 23 WorkerBackingThread& workerBackingThread() override; |
| 23 bool shouldAttachThreadDebugger() const override { return false; } | 24 bool shouldAttachThreadDebugger() const override { return false; } |
| 24 | 25 |
| 25 static void ensureSharedBackingThread(); | 26 static void ensureSharedBackingThread(); |
| 26 static void createSharedBackingThreadForTest(); | 27 static void createSharedBackingThreadForTest(); |
| 27 | 28 |
| 28 // This is called before CoreInitializer::shutdown as shutdown waits for | 29 // This is called before CoreInitializer::shutdown as shutdown waits for |
| 29 // worker threads that can be blocked by scripts. | 30 // worker threads that can be blocked by scripts. |
| 30 static void terminateExecution(); | 31 static void terminateExecution(); |
| 31 static void clearSharedBackingThread(); | 32 static void clearSharedBackingThread(); |
| 32 | 33 |
| 33 protected: | 34 protected: |
| 34 CompositorWorkerThread(PassRefPtr<WorkerLoaderProxy>, InProcessWorkerObjectP
roxy&, double timeOrigin); | 35 CompositorWorkerThread(PassRefPtr<WorkerLoaderProxy>, InProcessWorkerObjectP
roxy&, double timeOrigin); |
| 35 | 36 |
| 36 WorkerGlobalScope* createWorkerGlobalScope(PassOwnPtr<WorkerThreadStartupDat
a>) override; | 37 WorkerGlobalScope* createWorkerGlobalScope(std::unique_ptr<WorkerThreadStart
upData>) override; |
| 37 | 38 |
| 38 private: | 39 private: |
| 39 InProcessWorkerObjectProxy& m_workerObjectProxy; | 40 InProcessWorkerObjectProxy& m_workerObjectProxy; |
| 40 double m_timeOrigin; | 41 double m_timeOrigin; |
| 41 }; | 42 }; |
| 42 | 43 |
| 43 } // namespace blink | 44 } // namespace blink |
| 44 | 45 |
| 45 #endif // CompositorWorkerThread_h | 46 #endif // CompositorWorkerThread_h |
| OLD | NEW |