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

Unified Diff: base/threading/worker_pool_win.cc

Issue 8233037: Update task tracking to not depend on message_loop_ singleton (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 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
Index: base/threading/worker_pool_win.cc
===================================================================
--- base/threading/worker_pool_win.cc (revision 104925)
+++ base/threading/worker_pool_win.cc (working copy)
@@ -22,7 +22,7 @@
task(task) {
#if defined(TRACK_ALL_TASK_OBJECTS)
post_births = tracked_objects::ThreadData::TallyABirthIfActive(posted_from);
- time_posted = TimeTicks::Now();
jar (doing other things) 2011/10/14 02:29:53 I switched to a "higher performance" Now(), which
+ time_posted = tracked_objects::ThreadData::Now();
#endif // defined(TRACK_ALL_TASK_OBJECTS)
}
@@ -46,12 +46,14 @@
UNSHIPPED_TRACE_EVENT2("task", "WorkItemCallback::Run",
"src_file", pending_task->posted_from.file_name(),
"src_func", pending_task->posted_from.function_name());
+
+ TimeTicks start_of_run = tracked_objects::ThreadData::Now();
pending_task->task.Run();
-#if defined(TRACK_ALL_TASK_OBJECTS)
- tracked_objects::ThreadData::TallyADeathIfActive(
jar (doing other things) 2011/10/14 02:29:53 This function will be a no-op when we don't define
- pending_task->post_births,
- TimeTicks::Now() - pending_task->time_posted);
-#endif // defined(TRACK_ALL_TASK_OBJECTS)
+ tracked_objects::ThreadData::TallyADeathIfActive(pending_task->post_births,
+ pending_task->time_posted,
+ start_of_run,
+ NULL);
+
delete pending_task;
return 0;
}

Powered by Google App Engine
This is Rietveld 408576698