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

Unified Diff: base/message_loop/message_loop.cc

Issue 22911026: Add instrumentation to the MessagePumpMac family of classes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address some comments from jar Created 7 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/message_loop/message_loop.cc
diff --git a/base/message_loop/message_loop.cc b/base/message_loop/message_loop.cc
index 826c7573ee60e942fd0fb1beac5dff327d7a907c..2f7c3218cb0b4d820d5a9f3f53e60819087bfee2 100644
--- a/base/message_loop/message_loop.cc
+++ b/base/message_loop/message_loop.cc
@@ -656,6 +656,20 @@ bool MessageLoop::DoIdleWork() {
return false;
}
+void MessageLoop::GetQueueingInformation(size_t* queue_size,
+ TimeDelta* queueing_delay) {
+ *queue_size = work_queue_.size();
+ if (*queue_size == 0) {
+ *queueing_delay = TimeDelta();
+ return;
+ }
+
+ const PendingTask& next_to_run = work_queue_.front();
+ tracked_objects::Duration duration =
+ tracked_objects::TrackedTime::Now() - next_to_run.EffectiveTimePosted();
+ *queueing_delay = TimeDelta::FromMilliseconds(duration.InMilliseconds());
+}
+
void MessageLoop::DeleteSoonInternal(const tracked_objects::Location& from_here,
void(*deleter)(const void*),
const void* object) {

Powered by Google App Engine
This is Rietveld 408576698