Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(346)

Side by Side Diff: third_party/WebKit/Source/modules/compositorworker/CompositorWorkerManager.cpp

Issue 1477023003: Refactor the Heap into ThreadHeap to prepare for per thread heaps Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698