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

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

Issue 2801073005: [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
260 CategorizedWorkerPool::~CategorizedWorkerPool() {} 265 CategorizedWorkerPool::~CategorizedWorkerPool() {}
261 266
262 cc::NamespaceToken CategorizedWorkerPool::GenerateNamespaceToken() { 267 cc::NamespaceToken CategorizedWorkerPool::GenerateNamespaceToken() {
263 base::AutoLock lock(lock_); 268 base::AutoLock lock(lock_);
264 return work_queue_.GenerateNamespaceToken(); 269 return work_queue_.GenerateNamespaceToken();
265 } 270 }
266 271
267 void CategorizedWorkerPool::ScheduleTasks(cc::NamespaceToken token, 272 void CategorizedWorkerPool::ScheduleTasks(cc::NamespaceToken token,
268 cc::TaskGraph* graph) { 273 cc::TaskGraph* graph) {
269 TRACE_EVENT2("disabled-by-default-cc.debug", 274 TRACE_EVENT2("disabled-by-default-cc.debug",
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
419 : closure_(std::move(closure)) {} 424 : closure_(std::move(closure)) {}
420 425
421 // Overridden from cc::Task: 426 // Overridden from cc::Task:
422 void CategorizedWorkerPool::ClosureTask::RunOnWorkerThread() { 427 void CategorizedWorkerPool::ClosureTask::RunOnWorkerThread() {
423 std::move(closure_).Run(); 428 std::move(closure_).Run();
424 } 429 }
425 430
426 CategorizedWorkerPool::ClosureTask::~ClosureTask() {} 431 CategorizedWorkerPool::ClosureTask::~ClosureTask() {}
427 432
428 } // namespace content 433 } // 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