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

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

Issue 2637843002: Migrate base::TaskRunner from Closure to OnceClosure (Closed)
Patch Set: rebase Created 3 years, 8 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/test_pending_task.cc ('k') | base/test/test_simple_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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_SIMPLE_TASK_RUNNER_H_ 5 #ifndef BASE_TEST_TEST_SIMPLE_TASK_RUNNER_H_
6 #define BASE_TEST_TEST_SIMPLE_TASK_RUNNER_H_ 6 #define BASE_TEST_TEST_SIMPLE_TASK_RUNNER_H_
7 7
8 #include <deque> 8 #include <deque>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 26 matching lines...) Expand all
37 // (e.g., to post more tasks). 37 // (e.g., to post more tasks).
38 // 38 //
39 // Note that, like any TaskRunner, TestSimpleTaskRunner is 39 // Note that, like any TaskRunner, TestSimpleTaskRunner is
40 // ref-counted. 40 // ref-counted.
41 class TestSimpleTaskRunner : public SingleThreadTaskRunner { 41 class TestSimpleTaskRunner : public SingleThreadTaskRunner {
42 public: 42 public:
43 TestSimpleTaskRunner(); 43 TestSimpleTaskRunner();
44 44
45 // SingleThreadTaskRunner implementation. 45 // SingleThreadTaskRunner implementation.
46 bool PostDelayedTask(const tracked_objects::Location& from_here, 46 bool PostDelayedTask(const tracked_objects::Location& from_here,
47 Closure task, 47 OnceClosure task,
48 TimeDelta delay) override; 48 TimeDelta delay) override;
49 bool PostNonNestableDelayedTask(const tracked_objects::Location& from_here, 49 bool PostNonNestableDelayedTask(const tracked_objects::Location& from_here,
50 Closure task, 50 OnceClosure task,
51 TimeDelta delay) override; 51 TimeDelta delay) override;
52 52
53 bool RunsTasksOnCurrentThread() const override; 53 bool RunsTasksOnCurrentThread() const override;
54 54
55 std::deque<TestPendingTask> TakePendingTasks(); 55 std::deque<TestPendingTask> TakePendingTasks();
56 size_t NumPendingTasks() const; 56 size_t NumPendingTasks() const;
57 bool HasPendingTask() const; 57 bool HasPendingTask() const;
58 base::TimeDelta NextPendingTaskDelay() const; 58 base::TimeDelta NextPendingTaskDelay() const;
59 base::TimeDelta FinalPendingTaskDelay() const; 59 base::TimeDelta FinalPendingTaskDelay() const;
60 60
(...skipping 20 matching lines...) Expand all
81 mutable Lock lock_; 81 mutable Lock lock_;
82 82
83 std::deque<TestPendingTask> pending_tasks_; 83 std::deque<TestPendingTask> pending_tasks_;
84 84
85 DISALLOW_COPY_AND_ASSIGN(TestSimpleTaskRunner); 85 DISALLOW_COPY_AND_ASSIGN(TestSimpleTaskRunner);
86 }; 86 };
87 87
88 } // namespace base 88 } // namespace base
89 89
90 #endif // BASE_TEST_TEST_SIMPLE_TASK_RUNNER_H_ 90 #endif // BASE_TEST_TEST_SIMPLE_TASK_RUNNER_H_
OLDNEW
« no previous file with comments | « base/test/test_pending_task.cc ('k') | base/test/test_simple_task_runner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698