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 class CompositorWorkerThread final : public WorkerThread { | 14 // This class is overridden in unit-tests. |
15 class CompositorWorkerThread : public WorkerThread { | |
15 public: | 16 public: |
16 static PassRefPtr<CompositorWorkerThread> create(PassRefPtr<WorkerLoaderProx y>, WorkerObjectProxy&, double timeOrigin); | 17 static PassRefPtr<CompositorWorkerThread> create(PassRefPtr<WorkerLoaderProx y>, WorkerObjectProxy&, double timeOrigin); |
17 virtual ~CompositorWorkerThread(); | 18 virtual ~CompositorWorkerThread(); |
18 | 19 |
19 WorkerObjectProxy& workerObjectProxy() const { return m_workerObjectProxy; } | 20 WorkerObjectProxy& workerObjectProxy() const { return m_workerObjectProxy; } |
20 | 21 |
21 private: | 22 protected: |
22 CompositorWorkerThread(PassRefPtr<WorkerLoaderProxy>, WorkerObjectProxy&, do uble timeOrigin); | 23 CompositorWorkerThread(PassRefPtr<WorkerLoaderProxy>, WorkerObjectProxy&, do uble timeOrigin); |
23 | 24 |
25 private: | |
24 // WorkerThread: | 26 // WorkerThread: |
25 PassRefPtrWillBeRawPtr<WorkerGlobalScope> createWorkerGlobalScope(PassOwnPtr <WorkerThreadStartupData>) override; | 27 PassRefPtrWillBeRawPtr<WorkerGlobalScope> createWorkerGlobalScope(PassOwnPtr <WorkerThreadStartupData>) override; |
26 WebThreadSupportingGC& backingThread() override; | 28 WebThreadSupportingGC& backingThread() override; |
29 PassOwnPtr<WorkerIsolateWrapper> createIsolateWrapper() override; | |
30 void didStartRunLoop() override { } | |
31 void didStopRunLoop() override { } | |
32 void initializeBackingThread() override; | |
33 void shutdownBackingThread() override; | |
34 | |
35 WebThreadSupportingGC* m_thread = nullptr; | |
haraken
2015/06/02 02:14:49
It looks nasty to keep a raw pointer to the WebThr
sadrul
2015/06/02 02:48:28
Done.
| |
27 | 36 |
28 WorkerObjectProxy& m_workerObjectProxy; | 37 WorkerObjectProxy& m_workerObjectProxy; |
29 double m_timeOrigin; | 38 double m_timeOrigin; |
30 OwnPtr<WebThreadSupportingGC> m_thread; | |
31 }; | 39 }; |
32 | 40 |
33 } // namespace blink | 41 } // namespace blink |
34 | 42 |
35 #endif // CompositorWorkerThread_h | 43 #endif // CompositorWorkerThread_h |
OLD | NEW |