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

Side by Side Diff: content/renderer/categorized_worker_pool.cc

Issue 2804393002: Revert of [reland] Do not block in SimpleThread::Start(). (Closed)
Patch Set: Created 3 years, 8 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
« no previous file with comments | « content/renderer/categorized_worker_pool.h ('k') | content/renderer/render_thread_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "content/renderer/categorized_worker_pool.h" 5 #include "content/renderer/categorized_worker_pool.h"
6 6
7 #include <string> 7 #include <string>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 while (!work_queue_.HasFinishedRunningTasksInAllNamespaces()) { 250 while (!work_queue_.HasFinishedRunningTasksInAllNamespaces()) {
251 has_namespaces_with_finished_running_tasks_cv_.Wait(); 251 has_namespaces_with_finished_running_tasks_cv_.Wait();
252 } 252 }
253 } 253 }
254 254
255 scoped_refptr<base::SequencedTaskRunner> 255 scoped_refptr<base::SequencedTaskRunner>
256 CategorizedWorkerPool::CreateSequencedTaskRunner() { 256 CategorizedWorkerPool::CreateSequencedTaskRunner() {
257 return new CategorizedWorkerPoolSequencedTaskRunner(this); 257 return new CategorizedWorkerPoolSequencedTaskRunner(this);
258 } 258 }
259 259
260 base::PlatformThreadId CategorizedWorkerPool::GetBackgroundWorkerThreadId()
261 const {
262 return threads_.back()->GetTid();
263 }
264
265 CategorizedWorkerPool::~CategorizedWorkerPool() {} 260 CategorizedWorkerPool::~CategorizedWorkerPool() {}
266 261
267 cc::NamespaceToken CategorizedWorkerPool::GenerateNamespaceToken() { 262 cc::NamespaceToken CategorizedWorkerPool::GenerateNamespaceToken() {
268 base::AutoLock lock(lock_); 263 base::AutoLock lock(lock_);
269 return work_queue_.GenerateNamespaceToken(); 264 return work_queue_.GenerateNamespaceToken();
270 } 265 }
271 266
272 void CategorizedWorkerPool::ScheduleTasks(cc::NamespaceToken token, 267 void CategorizedWorkerPool::ScheduleTasks(cc::NamespaceToken token,
273 cc::TaskGraph* graph) { 268 cc::TaskGraph* graph) {
274 TRACE_EVENT2("disabled-by-default-cc.debug", 269 TRACE_EVENT2("disabled-by-default-cc.debug",
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 : closure_(std::move(closure)) {} 419 : closure_(std::move(closure)) {}
425 420
426 // Overridden from cc::Task: 421 // Overridden from cc::Task:
427 void CategorizedWorkerPool::ClosureTask::RunOnWorkerThread() { 422 void CategorizedWorkerPool::ClosureTask::RunOnWorkerThread() {
428 std::move(closure_).Run(); 423 std::move(closure_).Run();
429 } 424 }
430 425
431 CategorizedWorkerPool::ClosureTask::~ClosureTask() {} 426 CategorizedWorkerPool::ClosureTask::~ClosureTask() {}
432 427
433 } // namespace content 428 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/categorized_worker_pool.h ('k') | content/renderer/render_thread_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698