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

Side by Side Diff: cc/base/worker_pool.cc

Issue 15984016: Call scoped_refptr<T>::get() rather than relying on implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 7 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « base/task_runner_util_unittest.cc ('k') | cc/resources/image_raster_worker_pool.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "cc/base/worker_pool.h" 5 #include "cc/base/worker_pool.h"
6 6
7 #if defined(OS_ANDROID) 7 #if defined(OS_ANDROID)
8 // TODO(epenner): Move thread priorities to base. (crbug.com/170549) 8 // TODO(epenner): Move thread priorities to base. (crbug.com/170549)
9 #include <sys/resource.h> 9 #include <sys/resource.h>
10 #endif 10 #endif
(...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after
486 DispatchCompletionCallbacks(&completed_tasks); 486 DispatchCompletionCallbacks(&completed_tasks);
487 } 487 }
488 488
489 void WorkerPool::DispatchCompletionCallbacks(TaskDeque* completed_tasks) { 489 void WorkerPool::DispatchCompletionCallbacks(TaskDeque* completed_tasks) {
490 TRACE_EVENT0("cc", "WorkerPool::DispatchCompletionCallbacks"); 490 TRACE_EVENT0("cc", "WorkerPool::DispatchCompletionCallbacks");
491 491
492 // Worker pool instance is not reentrant while processing completed tasks. 492 // Worker pool instance is not reentrant while processing completed tasks.
493 in_dispatch_completion_callbacks_ = true; 493 in_dispatch_completion_callbacks_ = true;
494 494
495 while (!completed_tasks->empty()) { 495 while (!completed_tasks->empty()) {
496 internal::WorkerPoolTask* task = completed_tasks->front(); 496 internal::WorkerPoolTask* task = completed_tasks->front().get();
497 497
498 task->DidComplete(); 498 task->DidComplete();
499 task->DispatchCompletionCallback(); 499 task->DispatchCompletionCallback();
500 500
501 completed_tasks->pop_front(); 501 completed_tasks->pop_front();
502 } 502 }
503 503
504 in_dispatch_completion_callbacks_ = false; 504 in_dispatch_completion_callbacks_ = false;
505 } 505 }
506 506
507 void WorkerPool::ScheduleTasks(internal::WorkerPoolTask* root) { 507 void WorkerPool::ScheduleTasks(internal::WorkerPoolTask* root) {
508 TRACE_EVENT0("cc", "WorkerPool::ScheduleTasks"); 508 TRACE_EVENT0("cc", "WorkerPool::ScheduleTasks");
509 509
510 DCHECK(!in_dispatch_completion_callbacks_); 510 DCHECK(!in_dispatch_completion_callbacks_);
511 511
512 inner_->ScheduleTasks(root); 512 inner_->ScheduleTasks(root);
513 } 513 }
514 514
515 } // namespace cc 515 } // namespace cc
OLDNEW
« no previous file with comments | « base/task_runner_util_unittest.cc ('k') | cc/resources/image_raster_worker_pool.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698