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

Unified Diff: cc/test/ordered_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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/base/delayed_unique_notifier_unittest.cc ('k') | cc/test/ordered_simple_task_runner.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/test/ordered_simple_task_runner.h
diff --git a/cc/test/ordered_simple_task_runner.h b/cc/test/ordered_simple_task_runner.h
index 9620a96058df422e00c841a5512bca675422d9f0..21d1b5cde1bc79c097c85d6e1b9370e6ffacf7ba 100644
--- a/cc/test/ordered_simple_task_runner.h
+++ b/cc/test/ordered_simple_task_runner.h
@@ -27,8 +27,9 @@ namespace cc {
class TestOrderablePendingTask : public base::TestPendingTask {
public:
TestOrderablePendingTask();
+ TestOrderablePendingTask(TestOrderablePendingTask&&);
TestOrderablePendingTask(const tracked_objects::Location& location,
- const base::Closure& task,
+ base::OnceClosure task,
base::TimeTicks post_time,
base::TimeDelta delay,
TestNestability nestability);
@@ -42,6 +43,8 @@ class TestOrderablePendingTask : public base::TestPendingTask {
std::unique_ptr<base::trace_event::ConvertableToTraceFormat> AsValue() const;
void AsValueInto(base::trace_event::TracedValue* state) const;
+ size_t task_id() const { return task_id_; }
+
private:
static size_t task_id_counter;
const size_t task_id_;
@@ -56,10 +59,10 @@ class OrderedSimpleTaskRunner : public base::SingleThreadTaskRunner {
// base::TestSimpleTaskRunner implementation:
bool PostDelayedTask(const tracked_objects::Location& from_here,
- const base::Closure& task,
+ base::OnceClosure task,
base::TimeDelta delay) override;
bool PostNonNestableDelayedTask(const tracked_objects::Location& from_here,
- const base::Closure& task,
+ base::OnceClosure task,
base::TimeDelta delay) override;
bool RunsTasksOnCurrentThread() const override;
@@ -132,8 +135,7 @@ class OrderedSimpleTaskRunner : public base::SingleThreadTaskRunner {
protected:
static bool TaskRunCountBelowCallback(size_t max_tasks, size_t* task_run);
- bool TaskExistedInitiallyCallback(
- const std::set<TestOrderablePendingTask>& existing_tasks);
+ bool TaskExistedInitiallyCallback(const std::set<size_t>& existing_tasks);
bool NowBeforeCallback(base::TimeTicks stop_at);
bool AdvanceNowCallback();
« no previous file with comments | « cc/base/delayed_unique_notifier_unittest.cc ('k') | cc/test/ordered_simple_task_runner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698