| OLD | NEW |
| 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/worker_pool.h" | 5 #include "cc/worker_pool.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
| (...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 384 break; | 384 break; |
| 385 } | 385 } |
| 386 } | 386 } |
| 387 | 387 |
| 388 // Defer remaining tasks to worker threads. | 388 // Defer remaining tasks to worker threads. |
| 389 while (pending_cheap_tasks_.size()) { | 389 while (pending_cheap_tasks_.size()) { |
| 390 scoped_ptr<internal::WorkerPoolTask> task = | 390 scoped_ptr<internal::WorkerPoolTask> task = |
| 391 pending_cheap_tasks_.take_front(); | 391 pending_cheap_tasks_.take_front(); |
| 392 PostTask(task.Pass(), false); | 392 PostTask(task.Pass(), false); |
| 393 } | 393 } |
| 394 |
| 394 run_cheap_tasks_pending_ = false; | 395 run_cheap_tasks_pending_ = false; |
| 396 if (base::subtle::Acquire_Load(&pending_task_count_) == 0) |
| 397 OnIdle(); |
| 395 } | 398 } |
| 396 | 399 |
| 397 } // namespace cc | 400 } // namespace cc |
| OLD | NEW |