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

Side by Side Diff: base/message_loop/incoming_task_queue.cc

Issue 2637843002: Migrate base::TaskRunner from Closure to OnceClosure (Closed)
Patch Set: rebase without dcheck_in_ref_count Created 3 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #include "base/message_loop/incoming_task_queue.h" 5 #include "base/message_loop/incoming_task_queue.h"
6 6
7 #include <limits> 7 #include <limits>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 : high_res_task_count_(0), 53 : high_res_task_count_(0),
54 message_loop_(message_loop), 54 message_loop_(message_loop),
55 next_sequence_num_(0), 55 next_sequence_num_(0),
56 message_loop_scheduled_(false), 56 message_loop_scheduled_(false),
57 always_schedule_work_(AlwaysNotifyPump(message_loop_->type())), 57 always_schedule_work_(AlwaysNotifyPump(message_loop_->type())),
58 is_ready_for_scheduling_(false) { 58 is_ready_for_scheduling_(false) {
59 } 59 }
60 60
61 bool IncomingTaskQueue::AddToIncomingQueue( 61 bool IncomingTaskQueue::AddToIncomingQueue(
62 const tracked_objects::Location& from_here, 62 const tracked_objects::Location& from_here,
63 Closure task, 63 OnceClosure task,
64 TimeDelta delay, 64 TimeDelta delay,
65 bool nestable) { 65 bool nestable) {
66 DLOG_IF(WARNING, 66 DLOG_IF(WARNING,
67 delay.InSeconds() > kTaskDelayWarningThresholdInSeconds) 67 delay.InSeconds() > kTaskDelayWarningThresholdInSeconds)
68 << "Requesting super-long task delay period of " << delay.InSeconds() 68 << "Requesting super-long task delay period of " << delay.InSeconds()
69 << " seconds from here: " << from_here.ToString(); 69 << " seconds from here: " << from_here.ToString();
70 70
71 PendingTask pending_task(from_here, std::move(task), 71 PendingTask pending_task(from_here, std::move(task),
72 CalculateDelayedRuntime(delay), nestable); 72 CalculateDelayedRuntime(delay), nestable);
73 #if defined(OS_WIN) 73 #if defined(OS_WIN)
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 // that wants to post a task will be blocked until this thread switches back 191 // that wants to post a task will be blocked until this thread switches back
192 // in and releases |incoming_queue_lock_|. 192 // in and releases |incoming_queue_lock_|.
193 if (schedule_work) 193 if (schedule_work)
194 message_loop_->ScheduleWork(); 194 message_loop_->ScheduleWork();
195 195
196 return true; 196 return true;
197 } 197 }
198 198
199 } // namespace internal 199 } // namespace internal
200 } // namespace base 200 } // namespace base
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698