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

Unified Diff: base/threading/worker_pool_win.cc

Issue 8429009: Enable tracking of objects by default (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
« no previous file with comments | « base/threading/worker_pool_posix.cc ('k') | base/tracked_objects.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/threading/worker_pool_win.cc
===================================================================
--- base/threading/worker_pool_win.cc (revision 107970)
+++ base/threading/worker_pool_win.cc (working copy)
@@ -20,19 +20,15 @@
const base::Closure& task)
: posted_from(posted_from),
task(task) {
-#if defined(TRACK_ALL_TASK_OBJECTS)
- post_births = tracked_objects::ThreadData::TallyABirthIfActive(posted_from);
+ birth_tally = tracked_objects::ThreadData::TallyABirthIfActive(posted_from);
time_posted = tracked_objects::ThreadData::Now();
-#endif // defined(TRACK_ALL_TASK_OBJECTS)
}
-#if defined(TRACK_ALL_TASK_OBJECTS)
// Counter for location where the Closure was posted from.
- tracked_objects::Births* post_births;
+ tracked_objects::Births* birth_tally;
// Time the task was posted.
- TimeTicks time_posted;
-#endif // defined(TRACK_ALL_TASK_OBJECTS)
+ tracked_objects::TrackedTime time_posted;
// The site this PendingTask was posted from.
tracked_objects::Location posted_from;
@@ -47,16 +43,14 @@
"src_file", pending_task->posted_from.file_name(),
"src_func", pending_task->posted_from.function_name());
-#if defined(TRACK_ALL_TASK_OBJECTS)
- TimeTicks start_of_run = tracked_objects::ThreadData::Now();
-#endif // defined(TRACK_ALL_TASK_OBJECTS)
+ tracked_objects::TrackedTime start_time = tracked_objects::ThreadData::Now();
+
pending_task->task.Run();
-#if defined(TRACK_ALL_TASK_OBJECTS)
- tracked_objects::ThreadData::TallyADeathIfActive(pending_task->post_births,
- pending_task->time_posted, TimeTicks::TimeTicks(), start_of_run,
- tracked_objects::ThreadData::Now());
-#endif // defined(TRACK_ALL_TASK_OBJECTS)
+ tracked_objects::ThreadData::TallyRunOnWorkerThreadIfTracking(
+ pending_task->birth_tally, pending_task->time_posted,
+ start_time, tracked_objects::ThreadData::Now());
+
delete pending_task;
return 0;
}
« no previous file with comments | « base/threading/worker_pool_posix.cc ('k') | base/tracked_objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698