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

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

Issue 1303153005: Introduce WebTaskRunner Patch 3/5 (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add missing #include Created 5 years, 3 months 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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 100
101 void CompositorWorkerManager::shutdownBackingThread() 101 void CompositorWorkerManager::shutdownBackingThread()
102 { 102 {
103 MutexLocker lock(m_mutex); 103 MutexLocker lock(m_mutex);
104 ASSERT(m_thread->isCurrentThread()); 104 ASSERT(m_thread->isCurrentThread());
105 ASSERT(m_workerCount > 0); 105 ASSERT(m_workerCount > 0);
106 --m_workerCount; 106 --m_workerCount;
107 if (m_workerCount == 0) { 107 if (m_workerCount == 0) {
108 m_thread->shutdown(); 108 m_thread->shutdown();
109 m_thread = nullptr; 109 m_thread = nullptr;
110 Platform::current()->mainThread()->postTask(FROM_HERE, threadSafeBind(de stroyThread, AllowCrossThreadAccess(m_platformThread.leakPtr()))); 110 Platform::current()->mainThread()->taskRunner()->postTask(FROM_HERE, thr eadSafeBind(destroyThread, AllowCrossThreadAccess(m_platformThread.leakPtr())));
111 } 111 }
112 } 112 }
113 113
114 v8::Isolate* CompositorWorkerManager::initializeIsolate() 114 v8::Isolate* CompositorWorkerManager::initializeIsolate()
115 { 115 {
116 MutexLocker lock(m_mutex); 116 MutexLocker lock(m_mutex);
117 ASSERT(m_thread->isCurrentThread()); 117 ASSERT(m_thread->isCurrentThread());
118 ASSERT(m_isolate); 118 ASSERT(m_isolate);
119 // It is safe to use the existing isolate even if TerminateExecution() has b een 119 // It is safe to use the existing isolate even if TerminateExecution() has b een
120 // called on it, without calling CancelTerminateExecution(). 120 // called on it, without calling CancelTerminateExecution().
(...skipping 22 matching lines...) Expand all
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
« no previous file with comments | « Source/core/workers/WorkerThreadTest.cpp ('k') | Source/modules/compositorworker/CompositorWorkerManagerTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698