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

Side by Side Diff: base/test/test_simple_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/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/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 25 matching lines...) Expand all
36 // (e.g., to post more tasks). 36 // (e.g., to post more tasks).
37 // 37 //
38 // Note that, like any TaskRunner, TestSimpleTaskRunner is 38 // Note that, like any TaskRunner, TestSimpleTaskRunner is
39 // ref-counted. 39 // ref-counted.
40 class TestSimpleTaskRunner : public SingleThreadTaskRunner { 40 class TestSimpleTaskRunner : public SingleThreadTaskRunner {
41 public: 41 public:
42 TestSimpleTaskRunner(); 42 TestSimpleTaskRunner();
43 43
44 // SingleThreadTaskRunner implementation. 44 // SingleThreadTaskRunner implementation.
45 bool PostDelayedTask(const tracked_objects::Location& from_here, 45 bool PostDelayedTask(const tracked_objects::Location& from_here,
46 const Closure& task, 46 OnceClosure task,
47 TimeDelta delay) override; 47 TimeDelta delay) override;
48 bool PostNonNestableDelayedTask(const tracked_objects::Location& from_here, 48 bool PostNonNestableDelayedTask(const tracked_objects::Location& from_here,
49 const Closure& task, 49 OnceClosure task,
50 TimeDelta delay) override; 50 TimeDelta delay) override;
51 51
52 bool RunsTasksOnCurrentThread() const override; 52 bool RunsTasksOnCurrentThread() const override;
53 53
54 std::deque<TestPendingTask> TakePendingTasks(); 54 std::deque<TestPendingTask> TakePendingTasks();
55 size_t NumPendingTasks() const; 55 size_t NumPendingTasks() const;
56 bool HasPendingTask() const; 56 bool HasPendingTask() const;
57 base::TimeDelta NextPendingTaskDelay() const; 57 base::TimeDelta NextPendingTaskDelay() const;
58 base::TimeDelta FinalPendingTaskDelay() const; 58 base::TimeDelta FinalPendingTaskDelay() const;
59 tracked_objects::Location GetPendingTaskLocationAt(size_t index) const; 59 tracked_objects::Location GetPendingTaskLocationAt(size_t index) const;
(...skipping 21 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