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

Side by Side Diff: base/task_scheduler/task_tracker.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 unified diff | Download patch
« no previous file with comments | « base/pending_task.cc ('k') | base/threading/worker_pool_posix.cc » ('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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/task_scheduler/task_tracker.h" 5 #include "base/task_scheduler/task_tracker.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/debug/task_annotator.h" 10 #include "base/debug/task_annotator.h"
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 : (task->sequenced_task_runner_ref ? ExecutionMode::SEQUENCED 248 : (task->sequenced_task_runner_ref ? ExecutionMode::SEQUENCED
249 : ExecutionMode::PARALLEL); 249 : ExecutionMode::PARALLEL);
250 // TODO(gab): In a better world this would be tacked on as an extra arg 250 // TODO(gab): In a better world this would be tacked on as an extra arg
251 // to the trace event generated above. This is not possible however until 251 // to the trace event generated above. This is not possible however until
252 // http://crbug.com/652692 is resolved. 252 // http://crbug.com/652692 is resolved.
253 TRACE_EVENT1("task_scheduler", "TaskTracker::RunTask", "task_info", 253 TRACE_EVENT1("task_scheduler", "TaskTracker::RunTask", "task_info",
254 MakeUnique<TaskTracingInfo>(task->traits, execution_mode, 254 MakeUnique<TaskTracingInfo>(task->traits, execution_mode,
255 sequence_token)); 255 sequence_token));
256 256
257 debug::TaskAnnotator task_annotator; 257 debug::TaskAnnotator task_annotator;
258 task_annotator.RunTask(kQueueFunctionName, *task); 258 task_annotator.RunTask(kQueueFunctionName, task.get());
259 } 259 }
260 260
261 AfterRunTask(shutdown_behavior); 261 AfterRunTask(shutdown_behavior);
262 } 262 }
263 263
264 if (task->delayed_run_time.is_null()) 264 if (task->delayed_run_time.is_null())
265 DecrementNumPendingUndelayedTasks(); 265 DecrementNumPendingUndelayedTasks();
266 266
267 return can_run_task; 267 return can_run_task;
268 } 268 }
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
435 subtle::NoBarrier_AtomicIncrement(&num_pending_undelayed_tasks_, -1); 435 subtle::NoBarrier_AtomicIncrement(&num_pending_undelayed_tasks_, -1);
436 DCHECK_GE(new_num_pending_undelayed_tasks, 0); 436 DCHECK_GE(new_num_pending_undelayed_tasks, 0);
437 if (new_num_pending_undelayed_tasks == 0) { 437 if (new_num_pending_undelayed_tasks == 0) {
438 AutoSchedulerLock auto_lock(flush_lock_); 438 AutoSchedulerLock auto_lock(flush_lock_);
439 flush_cv_->Signal(); 439 flush_cv_->Signal();
440 } 440 }
441 } 441 }
442 442
443 } // namespace internal 443 } // namespace internal
444 } // namespace base 444 } // namespace base
OLDNEW
« no previous file with comments | « base/pending_task.cc ('k') | base/threading/worker_pool_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698