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

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

Issue 2664953004: Do not block in SimpleThread::Start(). (Closed)
Patch Set: CR gab #26 (comment) Created 3 years, 10 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 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 while (!work_queue_.HasFinishedRunningTasksInAllNamespaces()) { 249 while (!work_queue_.HasFinishedRunningTasksInAllNamespaces()) {
250 has_namespaces_with_finished_running_tasks_cv_.Wait(); 250 has_namespaces_with_finished_running_tasks_cv_.Wait();
251 } 251 }
252 } 252 }
253 253
254 scoped_refptr<base::SequencedTaskRunner> 254 scoped_refptr<base::SequencedTaskRunner>
255 CategorizedWorkerPool::CreateSequencedTaskRunner() { 255 CategorizedWorkerPool::CreateSequencedTaskRunner() {
256 return new CategorizedWorkerPoolSequencedTaskRunner(this); 256 return new CategorizedWorkerPoolSequencedTaskRunner(this);
257 } 257 }
258 258
259 base::PlatformThreadId CategorizedWorkerPool::GetBackgroundWorkerThreadId()
260 const {
261 return threads_.back()->GetTid();
262 }
263
259 CategorizedWorkerPool::~CategorizedWorkerPool() {} 264 CategorizedWorkerPool::~CategorizedWorkerPool() {}
260 265
261 cc::NamespaceToken CategorizedWorkerPool::GenerateNamespaceToken() { 266 cc::NamespaceToken CategorizedWorkerPool::GenerateNamespaceToken() {
262 base::AutoLock lock(lock_); 267 base::AutoLock lock(lock_);
263 return work_queue_.GenerateNamespaceToken(); 268 return work_queue_.GenerateNamespaceToken();
264 } 269 }
265 270
266 void CategorizedWorkerPool::ScheduleTasks(cc::NamespaceToken token, 271 void CategorizedWorkerPool::ScheduleTasks(cc::NamespaceToken token,
267 cc::TaskGraph* graph) { 272 cc::TaskGraph* graph) {
268 TRACE_EVENT2("disabled-by-default-cc.debug", 273 TRACE_EVENT2("disabled-by-default-cc.debug",
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
419 424
420 // Overridden from cc::Task: 425 // Overridden from cc::Task:
421 void CategorizedWorkerPool::ClosureTask::RunOnWorkerThread() { 426 void CategorizedWorkerPool::ClosureTask::RunOnWorkerThread() {
422 closure_.Run(); 427 closure_.Run();
423 closure_.Reset(); 428 closure_.Reset();
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