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

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

Issue 2637843002: Migrate base::TaskRunner from Closure to OnceClosure (Closed)
Patch Set: rebase 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
« no previous file with comments | « base/message_loop/incoming_task_queue.h ('k') | base/message_loop/message_loop_task_runner.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 DCHECK(task); 66 DCHECK(task);
67 DLOG_IF(WARNING, 67 DLOG_IF(WARNING,
68 delay.InSeconds() > kTaskDelayWarningThresholdInSeconds) 68 delay.InSeconds() > kTaskDelayWarningThresholdInSeconds)
69 << "Requesting super-long task delay period of " << delay.InSeconds() 69 << "Requesting super-long task delay period of " << delay.InSeconds()
70 << " seconds from here: " << from_here.ToString(); 70 << " seconds from here: " << from_here.ToString();
71 71
72 PendingTask pending_task(from_here, std::move(task), 72 PendingTask pending_task(from_here, std::move(task),
73 CalculateDelayedRuntime(delay), nestable); 73 CalculateDelayedRuntime(delay), nestable);
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 // that wants to post a task will be blocked until this thread switches back 192 // that wants to post a task will be blocked until this thread switches back
193 // in and releases |incoming_queue_lock_|. 193 // in and releases |incoming_queue_lock_|.
194 if (schedule_work) 194 if (schedule_work)
195 message_loop_->ScheduleWork(); 195 message_loop_->ScheduleWork();
196 196
197 return true; 197 return true;
198 } 198 }
199 199
200 } // namespace internal 200 } // namespace internal
201 } // namespace base 201 } // namespace base
OLDNEW
« no previous file with comments | « base/message_loop/incoming_task_queue.h ('k') | base/message_loop/message_loop_task_runner.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698