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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 virtual ~PerfControlWorkerPoolTaskImpl() {} | 52 virtual ~PerfControlWorkerPoolTaskImpl() {} |
53 | 53 |
54 scoped_ptr<CompletionEvent> did_start_; | 54 scoped_ptr<CompletionEvent> did_start_; |
55 scoped_ptr<CompletionEvent> can_finish_; | 55 scoped_ptr<CompletionEvent> can_finish_; |
56 | 56 |
57 DISALLOW_COPY_AND_ASSIGN(PerfControlWorkerPoolTaskImpl); | 57 DISALLOW_COPY_AND_ASSIGN(PerfControlWorkerPoolTaskImpl); |
58 }; | 58 }; |
59 | 59 |
60 class PerfWorkerPool : public WorkerPool { | 60 class PerfWorkerPool : public WorkerPool { |
61 public: | 61 public: |
62 PerfWorkerPool() : WorkerPool(1, "test") {} | 62 PerfWorkerPool() : WorkerPool() {} |
63 virtual ~PerfWorkerPool() {} | 63 virtual ~PerfWorkerPool() {} |
64 | 64 |
65 static scoped_ptr<PerfWorkerPool> Create() { | 65 static scoped_ptr<PerfWorkerPool> Create() { |
66 return make_scoped_ptr(new PerfWorkerPool); | 66 return make_scoped_ptr(new PerfWorkerPool); |
67 } | 67 } |
68 | 68 |
69 void ScheduleTasks(internal::WorkerPoolTask* root_task, | 69 void ScheduleTasks(internal::WorkerPoolTask* root_task, |
70 internal::WorkerPoolTask* leaf_task, | 70 internal::WorkerPoolTask* leaf_task, |
71 unsigned max_depth, | 71 unsigned max_depth, |
72 unsigned num_children_per_node) { | 72 unsigned num_children_per_node) { |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 RunExecuteTasksTest("2_10", 2, 10); | 230 RunExecuteTasksTest("2_10", 2, 10); |
231 RunExecuteTasksTest("5_5", 5, 5); | 231 RunExecuteTasksTest("5_5", 5, 5); |
232 RunExecuteTasksTest("10_2", 10, 2); | 232 RunExecuteTasksTest("10_2", 10, 2); |
233 RunExecuteTasksTest("1000_1", 1000, 1); | 233 RunExecuteTasksTest("1000_1", 1000, 1); |
234 RunExecuteTasksTest("10_1", 10, 1); | 234 RunExecuteTasksTest("10_1", 10, 1); |
235 } | 235 } |
236 | 236 |
237 } // namespace | 237 } // namespace |
238 | 238 |
239 } // namespace cc | 239 } // namespace cc |
OLD | NEW |