| 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 | 10 |
| 11 namespace blink { | 11 namespace blink { |
| 12 | 12 |
| 13 class WorkerObjectProxy; | 13 class WorkerObjectProxy; |
| 14 | 14 |
| 15 // This class is overridden in unit-tests. | 15 // This class is overridden in unit-tests. |
| 16 class MODULES_EXPORT CompositorWorkerThread : public WorkerThread { | 16 class MODULES_EXPORT CompositorWorkerThread : public WorkerThread { |
| 17 public: | 17 public: |
| 18 static PassRefPtr<CompositorWorkerThread> create(PassRefPtr<WorkerLoaderProx
y>, WorkerObjectProxy&, double timeOrigin); | 18 static PassRefPtr<CompositorWorkerThread> create(PassRefPtr<WorkerLoaderProx
y>, WorkerObjectProxy&, double timeOrigin); |
| 19 ~CompositorWorkerThread() override; | 19 ~CompositorWorkerThread() override; |
| 20 | 20 |
| 21 WorkerObjectProxy& workerObjectProxy() const { return m_workerObjectProxy; } | 21 WorkerObjectProxy& workerObjectProxy() const { return m_workerObjectProxy; } |
| 22 | 22 |
| 23 // Returns the shared backing thread for all CompositorWorkers. | 23 static void resetSharedBackingThreadForTest(); |
| 24 static WebThreadSupportingGC* sharedBackingThread(); | |
| 25 | |
| 26 static bool hasThreadForTest(); | |
| 27 static bool hasIsolateForTest(); | |
| 28 | 24 |
| 29 protected: | 25 protected: |
| 30 CompositorWorkerThread(PassRefPtr<WorkerLoaderProxy>, WorkerObjectProxy&, do
uble timeOrigin); | 26 CompositorWorkerThread(PassRefPtr<WorkerLoaderProxy>, WorkerObjectProxy&, do
uble timeOrigin); |
| 31 | 27 |
| 32 // WorkerThread: | 28 // WorkerThread: |
| 33 PassRefPtrWillBeRawPtr<WorkerGlobalScope> createWorkerGlobalScope(PassOwnPtr
<WorkerThreadStartupData>) override; | 29 PassRefPtrWillBeRawPtr<WorkerGlobalScope> createWorkerGlobalScope(PassOwnPtr
<WorkerThreadStartupData>) override; |
| 34 WebThreadSupportingGC& backingThread() override; | |
| 35 void didStartWorkerThread() override { } | |
| 36 void willStopWorkerThread() override { } | |
| 37 void initializeBackingThread() override; | |
| 38 void shutdownBackingThread() override; | |
| 39 v8::Isolate* initializeIsolate() override; | |
| 40 void willDestroyIsolate() override; | |
| 41 void destroyIsolate() override; | |
| 42 void terminateV8Execution() override; | |
| 43 | 30 |
| 44 private: | 31 private: |
| 45 WorkerObjectProxy& m_workerObjectProxy; | 32 WorkerObjectProxy& m_workerObjectProxy; |
| 46 double m_timeOrigin; | 33 double m_timeOrigin; |
| 47 }; | 34 }; |
| 48 | 35 |
| 49 } // namespace blink | 36 } // namespace blink |
| 50 | 37 |
| 51 #endif // CompositorWorkerThread_h | 38 #endif // CompositorWorkerThread_h |
| OLD | NEW |