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

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 comments 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..84b380d7aa34ef9aa8d73789d702db49dc2b6165 100644
--- a/base/message_loop/message_loop.cc
+++ b/base/message_loop/message_loop.cc
@@ -656,6 +656,24 @@ bool MessageLoop::DoIdleWork() {
return false;
}
+void MessageLoop::GetQueueingInformation(size_t* queue_size,
+ TimeDelta* queueing_delay) {
+ size_t size = work_queue_.size();
+ if (queue_size)
Mark Mentovai 2013/08/22 18:00:12 Since nobody needs to call this with NULL argument
Robert Sesek 2013/08/22 19:12:21 Done.
+ *queue_size = size + delayed_work_queue_.size();
+
+ if (size == 0 || !queueing_delay) {
+ if (queueing_delay)
+ *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