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

Unified Diff: base/pending_task.h

Issue 1886453003: Make PendingTask move-only and pass it by value on retaining params (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
Index: base/pending_task.h
diff --git a/base/pending_task.h b/base/pending_task.h
index fd0b883026eb355dad7c5ccb92017a8e5a45e94b..370dcd39199e557793027897eba87d5006c8af7a 100644
--- a/base/pending_task.h
+++ b/base/pending_task.h
@@ -19,14 +19,16 @@ namespace base {
// for use by classes that queue and execute tasks.
struct BASE_EXPORT PendingTask : public TrackingInfo {
PendingTask(const tracked_objects::Location& posted_from,
- const Closure& task);
+ Closure task);
PendingTask(const tracked_objects::Location& posted_from,
- const Closure& task,
+ Closure task,
TimeTicks delayed_run_time,
bool nestable);
- PendingTask(const PendingTask& other);
+ PendingTask(PendingTask&& other);
~PendingTask();
+ PendingTask& operator=(PendingTask&& other);
+
// Used to support sorting.
bool operator<(const PendingTask& other) const;

Powered by Google App Engine
This is Rietveld 408576698