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