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

Unified Diff: base/tracking_info.h

Issue 18083015: Add queued_time_ms trace for events in message loop (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use ConvertableToTraceFormat Created 7 years, 6 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/tracking_info.h
diff --git a/base/tracking_info.h b/base/tracking_info.h
index dacbcea1d2b9d83a4734b5c5b21216f4cac004f7..ad9d93d86e0d7af56fb1c2848a13b0f9a98c25fd 100644
--- a/base/tracking_info.h
+++ b/base/tracking_info.h
@@ -27,6 +27,14 @@ struct BASE_EXPORT TrackingInfo {
base::TimeTicks delayed_run_time);
~TrackingInfo();
+ base::TimeTicks ExpectedRunTime() const {
+ return delayed_run_time.is_null() ? time_posted : delayed_run_time;
+ }
+
+ base::TimeDelta DurationSinceExpectedRunTime() const {
+ return TimeTicks::Now() - ExpectedRunTime();
jar (doing other things) 2013/07/08 17:08:33 nit: Now() is generally considered an expensive ca
Xianzhu 2013/07/08 18:51:39 Changed to use TrackedTime to avoid lock on Window
jar (doing other things) 2013/07/08 23:14:19 Yeah... that will go a lot faster. It uses a trun
+ }
+
// Record of location and thread that the task came from.
tracked_objects::Births* birth_tally;

Powered by Google App Engine
This is Rietveld 408576698