Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(121)

Side by Side Diff: base/test/test_mock_time_task_runner.h

Issue 2122543002: Replace Closure in TaskRunner::PostTask with OneShotCallback (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@07_oneshot
Patch Set: fix Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « base/test/null_task_runner.cc ('k') | base/test/test_mock_time_task_runner.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 // source. The returned TickClock will hold a reference to |this|. 83 // source. The returned TickClock will hold a reference to |this|.
84 std::unique_ptr<TickClock> GetMockTickClock() const; 84 std::unique_ptr<TickClock> GetMockTickClock() const;
85 85
86 bool HasPendingTask() const; 86 bool HasPendingTask() const;
87 size_t GetPendingTaskCount() const; 87 size_t GetPendingTaskCount() const;
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 OnceClosure 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 OnceClosure task,
97 TimeDelta delay) override; 97 TimeDelta delay) override;
98 98
99 protected: 99 protected:
100 ~TestMockTimeTaskRunner() override; 100 ~TestMockTimeTaskRunner() override;
101 101
102 // Whether the elapsing of virtual time is stopped or not. Subclasses can 102 // 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. 103 // override this method to perform early exits from a running task runner.
104 // Defaults to always return false. 104 // Defaults to always return false.
105 virtual bool IsElapsingStopped(); 105 virtual bool IsElapsingStopped();
106 106
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 size_t next_task_ordinal_; 161 size_t next_task_ordinal_;
162 162
163 Lock tasks_lock_; 163 Lock tasks_lock_;
164 164
165 DISALLOW_COPY_AND_ASSIGN(TestMockTimeTaskRunner); 165 DISALLOW_COPY_AND_ASSIGN(TestMockTimeTaskRunner);
166 }; 166 };
167 167
168 } // namespace base 168 } // namespace base
169 169
170 #endif // BASE_TEST_TEST_MOCK_TIME_TASK_RUNNER_H_ 170 #endif // BASE_TEST_TEST_MOCK_TIME_TASK_RUNNER_H_
OLDNEW
« no previous file with comments | « base/test/null_task_runner.cc ('k') | base/test/test_mock_time_task_runner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698