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

Unified Diff: base/message_loop/incoming_task_queue.cc

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
« no previous file with comments | « no previous file | base/message_loop/message_loop.h » ('j') | base/threading/worker_pool_posix.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/message_loop/incoming_task_queue.cc
diff --git a/base/message_loop/incoming_task_queue.cc b/base/message_loop/incoming_task_queue.cc
index 05bb28891c9b922f2d81e6494c77ba934372a101..d40d5d5dddaed597da72a992fb6ca5de8f06a249 100644
--- a/base/message_loop/incoming_task_queue.cc
+++ b/base/message_loop/incoming_task_queue.cc
@@ -155,8 +155,8 @@ bool IncomingTaskQueue::PostPendingTask(PendingTask* pending_task) {
*pending_task);
bool was_empty = incoming_queue_.empty();
- incoming_queue_.push(*pending_task);
- pending_task->task.Reset();
+ incoming_queue_.push(std::move(*pending_task));
+ DCHECK(pending_task->task.is_null());
Sami 2016/04/13 11:33:00 Is this a valid assumption? I thought we should tr
tzik 2016/04/13 14:35:37 Done.
Sami 2016/04/13 15:17:32 I'm not sure we need to even do this. We've moved
tzik 2016/04/14 19:44:30 Right, it's redundant since we know the move const
if (is_ready_for_scheduling_ &&
(always_schedule_work_ || (!message_loop_scheduled_ && was_empty))) {
« no previous file with comments | « no previous file | base/message_loop/message_loop.h » ('j') | base/threading/worker_pool_posix.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698