| 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 "base/time/time.h" | 7 #include "base/time/time.h" |
| 8 #include "cc/base/completion_event.h" | 8 #include "cc/base/completion_event.h" |
| 9 #include "cc/test/lap_timer.h" | 9 #include "cc/test/lap_timer.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 graph.set(leaf_task, leaf_node.Pass()); | 95 graph.set(leaf_task, leaf_node.Pass()); |
| 96 | 96 |
| 97 if (root_node) | 97 if (root_node) |
| 98 graph.set(root_task, root_node.Pass()); | 98 graph.set(root_task, root_node.Pass()); |
| 99 | 99 |
| 100 SetTaskGraph(&graph); | 100 SetTaskGraph(&graph); |
| 101 | 101 |
| 102 tasks_.swap(tasks); | 102 tasks_.swap(tasks); |
| 103 } | 103 } |
| 104 | 104 |
| 105 void CheckForCompletedTasks() { |
| 106 CheckForCompletedWorkerTasks(); |
| 107 } |
| 108 |
| 105 private: | 109 private: |
| 106 typedef std::vector<scoped_refptr<internal::WorkerPoolTask> > TaskVector; | 110 typedef std::vector<scoped_refptr<internal::WorkerPoolTask> > TaskVector; |
| 107 | 111 |
| 108 void BuildTaskGraph(TaskVector* tasks, | 112 void BuildTaskGraph(TaskVector* tasks, |
| 109 TaskGraph* graph, | 113 TaskGraph* graph, |
| 110 internal::GraphNode* dependent_node, | 114 internal::GraphNode* dependent_node, |
| 111 internal::GraphNode* leaf_node, | 115 internal::GraphNode* leaf_node, |
| 112 unsigned current_depth, | 116 unsigned current_depth, |
| 113 unsigned max_depth, | 117 unsigned max_depth, |
| 114 unsigned num_children_per_node) { | 118 unsigned num_children_per_node) { |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 RunExecuteTasksTest("2_10", 2, 10); | 230 RunExecuteTasksTest("2_10", 2, 10); |
| 227 RunExecuteTasksTest("5_5", 5, 5); | 231 RunExecuteTasksTest("5_5", 5, 5); |
| 228 RunExecuteTasksTest("10_2", 10, 2); | 232 RunExecuteTasksTest("10_2", 10, 2); |
| 229 RunExecuteTasksTest("1000_1", 1000, 1); | 233 RunExecuteTasksTest("1000_1", 1000, 1); |
| 230 RunExecuteTasksTest("10_1", 10, 1); | 234 RunExecuteTasksTest("10_1", 10, 1); |
| 231 } | 235 } |
| 232 | 236 |
| 233 } // namespace | 237 } // namespace |
| 234 | 238 |
| 235 } // namespace cc | 239 } // namespace cc |
| OLD | NEW |