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 #ifndef BASE_TEST_TEST_MOCK_TIME_TASK_RUNNER_H_ | 5 #ifndef BASE_TEST_TEST_MOCK_TIME_TASK_RUNNER_H_ |
6 #define BASE_TEST_TEST_MOCK_TIME_TASK_RUNNER_H_ | 6 #define BASE_TEST_TEST_MOCK_TIME_TASK_RUNNER_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 TimeDelta NextPendingTaskDelay() const; | 88 TimeDelta NextPendingTaskDelay() const; |
89 | 89 |
90 // SingleThreadTaskRunner: | 90 // SingleThreadTaskRunner: |
91 bool RunsTasksOnCurrentThread() const override; | 91 bool RunsTasksOnCurrentThread() const override; |
92 bool PostDelayedTask(const tracked_objects::Location& from_here, | 92 bool PostDelayedTask(const tracked_objects::Location& from_here, |
93 const Closure& task, | 93 const Closure& task, |
94 TimeDelta delay) override; | 94 TimeDelta delay) override; |
95 bool PostNonNestableDelayedTask(const tracked_objects::Location& from_here, | 95 bool PostNonNestableDelayedTask(const tracked_objects::Location& from_here, |
96 const Closure& task, | 96 const Closure& task, |
97 TimeDelta delay) override; | 97 TimeDelta delay) override; |
| 98 std::string GetThreadName() const override; |
98 | 99 |
99 protected: | 100 protected: |
100 ~TestMockTimeTaskRunner() override; | 101 ~TestMockTimeTaskRunner() override; |
101 | 102 |
102 // Whether the elapsing of virtual time is stopped or not. Subclasses can | 103 // Whether the elapsing of virtual time is stopped or not. Subclasses can |
103 // override this method to perform early exits from a running task runner. | 104 // override this method to perform early exits from a running task runner. |
104 // Defaults to always return false. | 105 // Defaults to always return false. |
105 virtual bool IsElapsingStopped(); | 106 virtual bool IsElapsingStopped(); |
106 | 107 |
107 // Called before the next task to run is selected, so that subclasses have a | 108 // Called before the next task to run is selected, so that subclasses have a |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 size_t next_task_ordinal_; | 162 size_t next_task_ordinal_; |
162 | 163 |
163 Lock tasks_lock_; | 164 Lock tasks_lock_; |
164 | 165 |
165 DISALLOW_COPY_AND_ASSIGN(TestMockTimeTaskRunner); | 166 DISALLOW_COPY_AND_ASSIGN(TestMockTimeTaskRunner); |
166 }; | 167 }; |
167 | 168 |
168 } // namespace base | 169 } // namespace base |
169 | 170 |
170 #endif // BASE_TEST_TEST_MOCK_TIME_TASK_RUNNER_H_ | 171 #endif // BASE_TEST_TEST_MOCK_TIME_TASK_RUNNER_H_ |
OLD | NEW |