| 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 "modules/compositorworker/CompositorWorkerThread.h" | 5 #include "modules/compositorworker/CompositorWorkerThread.h" |
| 6 | 6 |
| 7 #include "bindings/core/v8/V8GCController.h" | 7 #include "bindings/core/v8/V8GCController.h" |
| 8 #include "bindings/core/v8/V8Initializer.h" | 8 #include "bindings/core/v8/V8Initializer.h" |
| 9 #include "core/workers/WorkerObjectProxy.h" | 9 #include "core/workers/WorkerObjectProxy.h" |
| 10 #include "core/workers/WorkerThreadStartupData.h" | 10 #include "core/workers/WorkerThreadStartupData.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 DEFINE_THREAD_SAFE_STATIC_LOCAL(CompositorWorkerSharedState, compositorW
orkerSharedState, (new CompositorWorkerSharedState())); | 32 DEFINE_THREAD_SAFE_STATIC_LOCAL(CompositorWorkerSharedState, compositorW
orkerSharedState, (new CompositorWorkerSharedState())); |
| 33 return compositorWorkerSharedState; | 33 return compositorWorkerSharedState; |
| 34 } | 34 } |
| 35 | 35 |
| 36 WebThreadSupportingGC* compositorWorkerThread() | 36 WebThreadSupportingGC* compositorWorkerThread() |
| 37 { | 37 { |
| 38 MutexLocker lock(m_mutex); | 38 MutexLocker lock(m_mutex); |
| 39 if (!m_thread && isMainThread()) { | 39 if (!m_thread && isMainThread()) { |
| 40 ASSERT(!m_workerCount); | 40 ASSERT(!m_workerCount); |
| 41 WebThread* platformThread = Platform::current()->compositorThread(); | 41 WebThread* platformThread = Platform::current()->compositorThread(); |
| 42 m_thread = WebThreadSupportingGC::createForThread(platformThread); | 42 m_thread = WebThreadSupportingGC::createForThread(platformThread, Th
readState::PerThreadHeapDisabled); |
| 43 } | 43 } |
| 44 return m_thread.get(); | 44 return m_thread.get(); |
| 45 } | 45 } |
| 46 | 46 |
| 47 void initializeBackingThread() | 47 void initializeBackingThread() |
| 48 { | 48 { |
| 49 MutexLocker lock(m_mutex); | 49 MutexLocker lock(m_mutex); |
| 50 ASSERT(m_thread->isCurrentThread()); | 50 ASSERT(m_thread->isCurrentThread()); |
| 51 ++m_workerCount; | 51 ++m_workerCount; |
| 52 if (m_workerCount > 1) | 52 if (m_workerCount > 1) |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 { | 210 { |
| 211 return CompositorWorkerSharedState::instance().hasThreadForTest(); | 211 return CompositorWorkerSharedState::instance().hasThreadForTest(); |
| 212 } | 212 } |
| 213 | 213 |
| 214 bool CompositorWorkerThread::hasIsolateForTest() | 214 bool CompositorWorkerThread::hasIsolateForTest() |
| 215 { | 215 { |
| 216 return CompositorWorkerSharedState::instance().hasIsolateForTest(); | 216 return CompositorWorkerSharedState::instance().hasIsolateForTest(); |
| 217 } | 217 } |
| 218 | 218 |
| 219 } // namespace blink | 219 } // namespace blink |
| OLD | NEW |