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

Unified Diff: base/debug/task_annotator.cc

Issue 445413003: Creating a framework for suppressing pollution of the profiler data (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixing unit tests again. Created 6 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 | « no previous file | base/profiler/scoped_profile.h » ('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 c6576c829e83f1bb2bf4a2209afdd4a9b4e3f5e9..f2e4b7341c169a8870115cf35b77398afcb76c3c 100644
--- a/base/debug/task_annotator.cc
+++ b/base/debug/task_annotator.cc
@@ -28,10 +28,10 @@ void TaskAnnotator::DidQueueTask(const char* queue_function,
void TaskAnnotator::RunTask(const char* queue_function,
const char* run_function,
const PendingTask& pending_task) {
- tracked_objects::TrackedTime start_time =
- tracked_objects::ThreadData::NowForStartOfRun(pending_task.birth_tally);
+ tracked_objects::ThreadData::PrepareForStartOfRun(pending_task.birth_tally);
+ tracked_objects::TaskStopwatch stopwatch;
tracked_objects::Duration queue_duration =
- start_time - pending_task.EffectiveTimePosted();
+ stopwatch.StartTime() - pending_task.EffectiveTimePosted();
TRACE_EVENT_FLOW_END1(TRACE_DISABLED_BY_DEFAULT("toplevel.flow"),
queue_function,
@@ -61,8 +61,9 @@ void TaskAnnotator::RunTask(const char* queue_function,
pending_task.task.Run();
+ stopwatch.Stop();
tracked_objects::ThreadData::TallyRunOnNamedThreadIfTracking(
- pending_task, start_time, tracked_objects::ThreadData::NowForEndOfRun());
+ pending_task, stopwatch);
}
uint64 TaskAnnotator::GetTaskTraceID(const PendingTask& task) const {
« no previous file with comments | « no previous file | base/profiler/scoped_profile.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698