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

Unified Diff: base/message_loop/message_loop.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: More jar@ comments 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') | base/run_loop.cc » ('J')
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 dd1a393ab08633514df9d6d021a1be7ff4dbd23f..f39b05088e5a1cfb45684eaa63b9726cd8fe1d7a 100644
--- a/base/message_loop/message_loop.cc
+++ b/base/message_loop/message_loop.cc
@@ -415,13 +415,14 @@ bool MessageLoop::ProcessNextDelayedNonNestableTask() {
}
void MessageLoop::RunTask(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;
TRACE_EVENT_FLOW_END1(TRACE_DISABLED_BY_DEFAULT("toplevel.flow"),
"MessageLoop::PostTask", TRACE_ID_MANGLE(GetTaskTraceID(pending_task)),
"queue_duration",
- (start_time - pending_task.EffectiveTimePosted()).InMilliseconds());
+ (stopwatch.StartTime() - pending_task.EffectiveTimePosted()).
+ InMilliseconds());
// When tracing memory for posted tasks it's more valuable to attribute the
// memory allocations to the source function than generically to "RunTask".
TRACE_EVENT_WITH_MEMORY_TAG2(
@@ -451,8 +452,9 @@ void MessageLoop::RunTask(const PendingTask& pending_task) {
FOR_EACH_OBSERVER(TaskObserver, task_observers_,
DidProcessTask(pending_task));
- tracked_objects::ThreadData::TallyRunOnNamedThreadIfTracking(pending_task,
- start_time, tracked_objects::ThreadData::NowForEndOfRun());
+ stopwatch.Stop();
+ tracked_objects::ThreadData::TallyRunOnNamedThreadIfTracking(
+ pending_task, stopwatch);
nestable_tasks_allowed_ = true;
}
« no previous file with comments | « no previous file | base/profiler/scoped_profile.h » ('j') | base/run_loop.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698