| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "platform/scheduler/base/task_queue_manager.h" | 5 #include "platform/scheduler/base/task_queue_manager.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 void CancelWakeUpAt(base::TimeTicks run_time) override { | 53 void CancelWakeUpAt(base::TimeTicks run_time) override { |
| 54 // We didn't post a delayed task in RequestWakeUpAt so there's no need to do | 54 // We didn't post a delayed task in RequestWakeUpAt so there's no need to do |
| 55 // anything here. | 55 // anything here. |
| 56 } | 56 } |
| 57 | 57 |
| 58 const char* GetName() const override { return "PerfTestTimeDomain"; } | 58 const char* GetName() const override { return "PerfTestTimeDomain"; } |
| 59 | 59 |
| 60 DISALLOW_COPY_AND_ASSIGN(PerfTestTimeDomain); | 60 DISALLOW_COPY_AND_ASSIGN(PerfTestTimeDomain); |
| 61 }; | 61 }; |
| 62 | 62 |
| 63 class TaskQueueManagerPerfTest : public testing::Test { | 63 class TaskQueueManagerPerfTest : public ::testing::Test { |
| 64 public: | 64 public: |
| 65 TaskQueueManagerPerfTest() | 65 TaskQueueManagerPerfTest() |
| 66 : num_queues_(0), | 66 : num_queues_(0), |
| 67 max_tasks_in_flight_(0), | 67 max_tasks_in_flight_(0), |
| 68 num_tasks_in_flight_(0), | 68 num_tasks_in_flight_(0), |
| 69 num_tasks_to_post_(0), | 69 num_tasks_to_post_(0), |
| 70 num_tasks_to_run_(0) {} | 70 num_tasks_to_run_(0) {} |
| 71 | 71 |
| 72 void SetUp() override { | 72 void SetUp() override { |
| 73 if (base::ThreadTicks::IsSupported()) | 73 if (base::ThreadTicks::IsSupported()) |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 Benchmark("run 10000 delayed tasks with eight queues", | 216 Benchmark("run 10000 delayed tasks with eight queues", |
| 217 base::Bind(&TaskQueueManagerPerfTest::ResetAndCallTestDelayedTask, | 217 base::Bind(&TaskQueueManagerPerfTest::ResetAndCallTestDelayedTask, |
| 218 base::Unretained(this), 10000)); | 218 base::Unretained(this), 10000)); |
| 219 } | 219 } |
| 220 | 220 |
| 221 // TODO(alexclarke): Add additional tests with different mixes of non-delayed vs | 221 // TODO(alexclarke): Add additional tests with different mixes of non-delayed vs |
| 222 // delayed tasks. | 222 // delayed tasks. |
| 223 | 223 |
| 224 } // namespace scheduler | 224 } // namespace scheduler |
| 225 } // namespace blink | 225 } // namespace blink |
| OLD | NEW |