| 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/resources/worker_pool.h" | 5 #include "cc/resources/worker_pool.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "cc/base/completion_event.h" | 9 #include "cc/base/completion_event.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 | 109 |
| 110 scheduled_tasks_completion_.reset(new CompletionEvent); | 110 scheduled_tasks_completion_.reset(new CompletionEvent); |
| 111 | 111 |
| 112 SetTaskGraph(&new_graph); | 112 SetTaskGraph(&new_graph); |
| 113 | 113 |
| 114 dependents_.swap(new_dependents); | 114 dependents_.swap(new_dependents); |
| 115 completion_task_.swap(new_completion_task); | 115 completion_task_.swap(new_completion_task); |
| 116 tasks_.swap(new_tasks); | 116 tasks_.swap(new_tasks); |
| 117 } | 117 } |
| 118 | 118 |
| 119 void CheckForCompletedTasks() { |
| 120 CheckForCompletedWorkerTasks(); |
| 121 } |
| 122 |
| 119 void WaitForTasksToComplete() { | 123 void WaitForTasksToComplete() { |
| 120 DCHECK(scheduled_tasks_completion_); | 124 DCHECK(scheduled_tasks_completion_); |
| 121 scheduled_tasks_completion_->Wait(); | 125 scheduled_tasks_completion_->Wait(); |
| 122 } | 126 } |
| 123 | 127 |
| 124 private: | 128 private: |
| 125 typedef std::vector<scoped_refptr<internal::WorkerPoolTask> > TaskVector; | 129 typedef std::vector<scoped_refptr<internal::WorkerPoolTask> > TaskVector; |
| 126 | 130 |
| 127 void OnTasksCompleted() { | 131 void OnTasksCompleted() { |
| 128 DCHECK(scheduled_tasks_completion_); | 132 DCHECK(scheduled_tasks_completion_); |
| (...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 385 EXPECT_EQ(1u, run_task_ids()[2]); | 389 EXPECT_EQ(1u, run_task_ids()[2]); |
| 386 ASSERT_EQ(3u, on_task_completed_ids().size()); | 390 ASSERT_EQ(3u, on_task_completed_ids().size()); |
| 387 EXPECT_EQ(2u, on_task_completed_ids()[0]); | 391 EXPECT_EQ(2u, on_task_completed_ids()[0]); |
| 388 EXPECT_EQ(1u, on_task_completed_ids()[1]); | 392 EXPECT_EQ(1u, on_task_completed_ids()[1]); |
| 389 EXPECT_EQ(0u, on_task_completed_ids()[2]); | 393 EXPECT_EQ(0u, on_task_completed_ids()[2]); |
| 390 } | 394 } |
| 391 | 395 |
| 392 } // namespace | 396 } // namespace |
| 393 | 397 |
| 394 } // namespace cc | 398 } // namespace cc |
| OLD | NEW |