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

Unified Diff: base/message_loop/message_loop.cc

Issue 2386653002: Replace base::Callback with base::OnceCallback in base::PendingTask (Closed)
Patch Set: move UnsafeConvertOnceClosureToRepeating Created 4 years, 2 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 | « base/message_loop/message_loop.h ('k') | base/message_loop/message_pump_perftest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/message_loop/message_loop.cc
diff --git a/base/message_loop/message_loop.cc b/base/message_loop/message_loop.cc
index 9bdcf406589aaabfd9a9ade97d25f828a6a7ac9e..8df5bcaaa567881e8f6a523b36fc3cc9c4f7ecb9 100644
--- a/base/message_loop/message_loop.cc
+++ b/base/message_loop/message_loop.cc
@@ -387,15 +387,15 @@ bool MessageLoop::ProcessNextDelayedNonNestableTask() {
std::move(deferred_non_nestable_work_queue_.front());
deferred_non_nestable_work_queue_.pop();
- RunTask(pending_task);
+ RunTask(&pending_task);
return true;
}
-void MessageLoop::RunTask(const PendingTask& pending_task) {
+void MessageLoop::RunTask(PendingTask* pending_task) {
DCHECK(nestable_tasks_allowed_);
#if defined(OS_WIN)
- if (pending_task.is_high_res) {
+ if (pending_task->is_high_res) {
pending_high_res_tasks_--;
CHECK_GE(pending_high_res_tasks_, 0);
}
@@ -404,20 +404,20 @@ void MessageLoop::RunTask(const PendingTask& pending_task) {
// Execute the task and assume the worst: It is probably not reentrant.
nestable_tasks_allowed_ = false;
- TRACE_TASK_EXECUTION("MessageLoop::RunTask", pending_task);
+ TRACE_TASK_EXECUTION("MessageLoop::RunTask", *pending_task);
FOR_EACH_OBSERVER(TaskObserver, task_observers_,
- WillProcessTask(pending_task));
+ WillProcessTask(*pending_task));
task_annotator_.RunTask("MessageLoop::PostTask", pending_task);
FOR_EACH_OBSERVER(TaskObserver, task_observers_,
- DidProcessTask(pending_task));
+ DidProcessTask(*pending_task));
nestable_tasks_allowed_ = true;
}
bool MessageLoop::DeferOrRunPendingTask(PendingTask pending_task) {
if (pending_task.nestable || run_loop_->run_depth_ == 1) {
- RunTask(pending_task);
+ RunTask(&pending_task);
// Show that we ran a task (Note: a new one might arrive as a
// consequence!).
return true;
« no previous file with comments | « base/message_loop/message_loop.h ('k') | base/message_loop/message_pump_perftest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698