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

Unified Diff: base/debug/task_annotator.cc

Issue 2122543002: Replace Closure in TaskRunner::PostTask with OneShotCallback (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@07_oneshot
Patch Set: fix Created 4 years, 3 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/debug/task_annotator.h ('k') | base/debug/task_annotator_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/debug/task_annotator.cc
diff --git a/base/debug/task_annotator.cc b/base/debug/task_annotator.cc
index 2747d63c2bf29aa3d356c8c750ff3784b943e66f..8568e48ebf679878fd687c0604284120ea32eabf 100644
--- a/base/debug/task_annotator.cc
+++ b/base/debug/task_annotator.cc
@@ -28,17 +28,17 @@ void TaskAnnotator::DidQueueTask(const char* queue_function,
}
void TaskAnnotator::RunTask(const char* queue_function,
- const PendingTask& pending_task) {
- ScopedTaskRunActivity task_activity(pending_task);
+ PendingTask* pending_task) {
+ ScopedTaskRunActivity task_activity(*pending_task);
tracked_objects::TaskStopwatch stopwatch;
stopwatch.Start();
tracked_objects::Duration queue_duration =
- stopwatch.StartTime() - pending_task.EffectiveTimePosted();
+ stopwatch.StartTime() - pending_task->EffectiveTimePosted();
TRACE_EVENT_WITH_FLOW1(TRACE_DISABLED_BY_DEFAULT("toplevel.flow"),
queue_function,
- TRACE_ID_MANGLE(GetTaskTraceID(pending_task)),
+ TRACE_ID_MANGLE(GetTaskTraceID(*pending_task)),
TRACE_EVENT_FLAG_FLOW_IN,
"queue_duration",
queue_duration.InMilliseconds());
@@ -48,14 +48,14 @@ void TaskAnnotator::RunTask(const char* queue_function,
// crashes. Be careful not to assume that the variable itself will have the
// expected value when displayed by the optimizer in an optimized build.
// Look at a memory dump of the stack.
- const void* program_counter = pending_task.posted_from.program_counter();
+ const void* program_counter = pending_task->posted_from.program_counter();
debug::Alias(&program_counter);
- pending_task.task.Run();
+ std::move(pending_task->task).Run();
stopwatch.Stop();
tracked_objects::ThreadData::TallyRunOnNamedThreadIfTracking(
- pending_task, stopwatch);
+ *pending_task, stopwatch);
}
uint64_t TaskAnnotator::GetTaskTraceID(const PendingTask& task) const {
« no previous file with comments | « base/debug/task_annotator.h ('k') | base/debug/task_annotator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698