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

Unified Diff: base/threading/sequenced_worker_pool.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: Clarifying terminology Created 6 years, 4 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/sequenced_worker_pool.cc
diff --git a/base/threading/sequenced_worker_pool.cc b/base/threading/sequenced_worker_pool.cc
index 532f26ebe5c784eba7613045ef99f5c40b012714..9e51d645894dafe379a6dc3c244ab0b42d8f2b87 100644
--- a/base/threading/sequenced_worker_pool.cc
+++ b/base/threading/sequenced_worker_pool.cc
@@ -755,13 +755,14 @@ void SequencedWorkerPool::Inner::ThreadLoop(Worker* this_worker) {
this_worker->set_running_task_info(
SequenceToken(task.sequence_token_id), task.shutdown_behavior);
- tracked_objects::TrackedTime start_time =
- tracked_objects::ThreadData::NowForStartOfRun(task.birth_tally);
-
+ tracked_objects::TaskStopwatch stopwatch;
+ stopwatch.Start(
+ tracked_objects::ThreadData::NowForStartOfRun(task.birth_tally));
jar (doing other things) 2014/09/02 16:52:16 The reason there is an API called NowForStartOfRun
vadimt 2014/09/02 22:41:37 Done.
task.task.Run();
+ stopwatch.Stop(tracked_objects::ThreadData::NowForEndOfRun());
jar (doing other things) 2014/09/02 16:52:16 This call can then be simply: stopwatch.Stop(); I
vadimt 2014/09/02 22:41:37 Done. Given that there are 3 methods that can foll
- tracked_objects::ThreadData::TallyRunOnNamedThreadIfTracking(task,
- start_time, tracked_objects::ThreadData::NowForEndOfRun());
+ tracked_objects::ThreadData::TallyRunOnNamedThreadIfTracking(
+ task, stopwatch);
jar (doing other things) 2014/09/02 16:52:16 If you're willing to embed the Stop() into the abo
vadimt 2014/09/02 22:41:36 See the above answer.
// Make sure our task is erased outside the lock for the
// same reason we do this with delete_these_oustide_lock.

Powered by Google App Engine
This is Rietveld 408576698