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...) 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 153 matching lines...) Loading... |
226 RunExecuteTasksTest("2_10", 2, 10); | 226 RunExecuteTasksTest("2_10", 2, 10); |
227 RunExecuteTasksTest("5_5", 5, 5); | 227 RunExecuteTasksTest("5_5", 5, 5); |
228 RunExecuteTasksTest("10_2", 10, 2); | 228 RunExecuteTasksTest("10_2", 10, 2); |
229 RunExecuteTasksTest("1000_1", 1000, 1); | 229 RunExecuteTasksTest("1000_1", 1000, 1); |
230 RunExecuteTasksTest("10_1", 10, 1); | 230 RunExecuteTasksTest("10_1", 10, 1); |
231 } | 231 } |
232 | 232 |
233 } // namespace | 233 } // namespace |
234 | 234 |
235 } // namespace cc | 235 } // namespace cc |
OLD | NEW |