| 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 | 9 |
| 10 namespace blink { | 10 namespace blink { |
| 11 | 11 |
| 12 class WorkerObjectProxy; | 12 class WorkerObjectProxy; |
| 13 | 13 |
| 14 // This class is overridden in unit-tests. | 14 class CompositorWorkerThread final : public WorkerThread { |
| 15 class CompositorWorkerThread : public WorkerThread { | |
| 16 public: | 15 public: |
| 17 static PassRefPtr<CompositorWorkerThread> create(PassRefPtr<WorkerLoaderProx
y>, WorkerObjectProxy&, double timeOrigin); | 16 static PassRefPtr<CompositorWorkerThread> create(PassRefPtr<WorkerLoaderProx
y>, WorkerObjectProxy&, double timeOrigin); |
| 18 virtual ~CompositorWorkerThread(); | 17 virtual ~CompositorWorkerThread(); |
| 19 | 18 |
| 20 WorkerObjectProxy& workerObjectProxy() const { return m_workerObjectProxy; } | 19 WorkerObjectProxy& workerObjectProxy() const { return m_workerObjectProxy; } |
| 21 | 20 |
| 22 protected: | 21 private: |
| 23 CompositorWorkerThread(PassRefPtr<WorkerLoaderProxy>, WorkerObjectProxy&, do
uble timeOrigin); | 22 CompositorWorkerThread(PassRefPtr<WorkerLoaderProxy>, WorkerObjectProxy&, do
uble timeOrigin); |
| 24 | 23 |
| 25 // WorkerThread: | 24 // WorkerThread: |
| 26 PassRefPtrWillBeRawPtr<WorkerGlobalScope> createWorkerGlobalScope(PassOwnPtr
<WorkerThreadStartupData>) override; | 25 PassRefPtrWillBeRawPtr<WorkerGlobalScope> createWorkerGlobalScope(PassOwnPtr
<WorkerThreadStartupData>) override; |
| 27 WebThreadSupportingGC& backingThread() override; | 26 WebThreadSupportingGC& backingThread() override; |
| 28 void didStartRunLoop() override { } | |
| 29 void didStopRunLoop() override { } | |
| 30 void initializeBackingThread() override; | |
| 31 void shutdownBackingThread() override; | |
| 32 v8::Isolate* initializeIsolate() override; | |
| 33 void willDestroyIsolate() override; | |
| 34 void destroyIsolate() override; | |
| 35 void terminateV8Execution() override; | |
| 36 | 27 |
| 37 private: | |
| 38 WorkerObjectProxy& m_workerObjectProxy; | 28 WorkerObjectProxy& m_workerObjectProxy; |
| 39 double m_timeOrigin; | 29 double m_timeOrigin; |
| 30 OwnPtr<WebThreadSupportingGC> m_thread; |
| 40 }; | 31 }; |
| 41 | 32 |
| 42 } // namespace blink | 33 } // namespace blink |
| 43 | 34 |
| 44 #endif // CompositorWorkerThread_h | 35 #endif // CompositorWorkerThread_h |
| OLD | NEW |