| 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 #include "config.h" | 5 #include "config.h" |
| 6 #include "modules/compositorworker/CompositorWorkerManager.h" | 6 #include "modules/compositorworker/CompositorWorkerManager.h" |
| 7 | 7 |
| 8 #include "bindings/core/v8/V8Binding.h" | 8 #include "bindings/core/v8/V8Binding.h" |
| 9 #include "bindings/core/v8/V8GCController.h" | 9 #include "bindings/core/v8/V8GCController.h" |
| 10 #include "bindings/core/v8/V8Initializer.h" | 10 #include "bindings/core/v8/V8Initializer.h" |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 WebThreadSupportingGC& CompositorWorkerManager::compositorWorkerThread() | 66 WebThreadSupportingGC& CompositorWorkerManager::compositorWorkerThread() |
| 67 { | 67 { |
| 68 MutexLocker lock(m_mutex); | 68 MutexLocker lock(m_mutex); |
| 69 if (!m_thread) { | 69 if (!m_thread) { |
| 70 ASSERT(isMainThread()); | 70 ASSERT(isMainThread()); |
| 71 ASSERT(!m_workerCount); | 71 ASSERT(!m_workerCount); |
| 72 // TODO(sadrul): Instead of creating a new thread, retrieve the thread f
rom | 72 // TODO(sadrul): Instead of creating a new thread, retrieve the thread f
rom |
| 73 // Platform using a more specialized function | 73 // Platform using a more specialized function |
| 74 // (e.g. Platform::compositorWorkerThread()). | 74 // (e.g. Platform::compositorWorkerThread()). |
| 75 m_platformThread = adoptPtr(Platform::current()->createThread("Composito
rWorker Thread")); | 75 m_platformThread = adoptPtr(Platform::current()->createThread("Composito
rWorker Thread")); |
| 76 m_thread = WebThreadSupportingGC::createForThread(m_platformThread.get()
); | 76 m_thread = WebThreadSupportingGC::createForThread(m_platformThread.get()
, true); |
| 77 } | 77 } |
| 78 return *m_thread.get(); | 78 return *m_thread.get(); |
| 79 } | 79 } |
| 80 | 80 |
| 81 void CompositorWorkerManager::initializeBackingThread() | 81 void CompositorWorkerManager::initializeBackingThread() |
| 82 { | 82 { |
| 83 ASSERT(m_thread->isCurrentThread()); | 83 ASSERT(m_thread->isCurrentThread()); |
| 84 MutexLocker lock(m_mutex); | 84 MutexLocker lock(m_mutex); |
| 85 ++m_workerCount; | 85 ++m_workerCount; |
| 86 if (m_workerCount > 1) | 86 if (m_workerCount > 1) |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 { | 143 { |
| 144 MutexLocker lock(m_mutex); | 144 MutexLocker lock(m_mutex); |
| 145 ASSERT(isMainThread()); | 145 ASSERT(isMainThread()); |
| 146 if (m_workerCount > 1) | 146 if (m_workerCount > 1) |
| 147 return; | 147 return; |
| 148 | 148 |
| 149 v8::V8::TerminateExecution(m_isolate); | 149 v8::V8::TerminateExecution(m_isolate); |
| 150 } | 150 } |
| 151 | 151 |
| 152 } // namespace blink | 152 } // namespace blink |
| OLD | NEW |