Chromium Code Reviews| Index: Source/modules/compositorworker/CompositorWorkerManager.cpp |
| diff --git a/Source/modules/compositorworker/CompositorWorkerManager.cpp b/Source/modules/compositorworker/CompositorWorkerManager.cpp |
| index 62dc23b4c02a2ce82f05a4a82fc2cac2460c447f..21cce23086c7d616b3fed257bbf35ab78eb7e5e9 100644 |
| --- a/Source/modules/compositorworker/CompositorWorkerManager.cpp |
| +++ b/Source/modules/compositorworker/CompositorWorkerManager.cpp |
| @@ -20,13 +20,13 @@ namespace { |
| static CompositorWorkerManager* s_instance = nullptr; |
| -static Mutex& singletonMutex() |
| +Mutex& singletonMutex() |
| { |
| AtomicallyInitializedStaticReference(Mutex, mutex, new Mutex); |
| return mutex; |
| } |
| -static void destroyThread(WebThreadSupportingGC* thread) |
| +void destroyThread(WebThread* thread) |
| { |
| delete thread; |
| } |
| @@ -69,7 +69,11 @@ WebThreadSupportingGC& CompositorWorkerManager::compositorWorkerThread() |
| if (!m_thread) { |
| ASSERT(isMainThread()); |
| ASSERT(!m_workerCount); |
| - m_thread = WebThreadSupportingGC::create("CompositorWorker Thread"); |
| + // TODO(sadrul): Instead of creating a new thread, retrieve the thread from |
| + // Platform using a more specialized function |
| + // (e.g. Platform::compositorWorkerThread()). |
| + m_platformThread = adoptPtr(Platform::current()->createThread("CompositorWorker Thread")); |
| + m_thread = WebThreadSupportingGC::createForThread(m_platformThread.get()); |
| } |
| return *m_thread.get(); |
| } |
| @@ -102,7 +106,7 @@ void CompositorWorkerManager::shutdownBackingThread() |
| --m_workerCount; |
| if (m_workerCount == 0) { |
| m_thread->shutdown(); |
| - Platform::current()->mainThread()->postTask(FROM_HERE, threadSafeBind(destroyThread, AllowCrossThreadAccess(m_thread.leakPtr()))); |
| + Platform::current()->mainThread()->postTask(FROM_HERE, threadSafeBind(destroyThread, AllowCrossThreadAccess(m_platformThread.leakPtr()))); |
| m_thread = nullptr; |
|
haraken
2015/09/01 09:32:37
Nit: We may want to run m_thread=nullptr before po
kinuko
2015/09/01 09:48:56
Done.
|
| } |
| } |