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

Unified Diff: cc/test/ordered_simple_task_runner.h

Issue 2434783002: Use OnceClosure in TestPendingTask (Closed)
Patch Set: +comment Created 3 years, 11 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..a33fd4065211a754520b889a283c000361e000cf 100644
--- a/cc/test/ordered_simple_task_runner.h
+++ b/cc/test/ordered_simple_task_runner.h
@@ -32,8 +32,11 @@ class TestOrderablePendingTask : public base::TestPendingTask {
base::TimeTicks post_time,
base::TimeDelta delay,
TestNestability nestability);
+ TestOrderablePendingTask(TestOrderablePendingTask&&);
~TestOrderablePendingTask();
+ TestOrderablePendingTask& operator=(TestOrderablePendingTask&&);
+
// operators needed by std::set and comparison
bool operator==(const TestOrderablePendingTask& other) const;
bool operator<(const TestOrderablePendingTask& other) const;
@@ -42,9 +45,13 @@ 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_;
+ size_t task_id_;
+
+ DISALLOW_COPY_AND_ASSIGN(TestOrderablePendingTask);
};
// This runs pending tasks based on task's post_time + delay.
@@ -132,8 +139,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