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

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: More comments from mark 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..5d68438f5a3c2220da9e7f0ac9a57ed0c9808023 100644
--- a/base/message_loop/message_loop.cc
+++ b/base/message_loop/message_loop.cc
@@ -656,6 +656,22 @@ bool MessageLoop::DoIdleWork() {
return false;
}
+void MessageLoop::GetQueueingInformation(size_t* queue_size,
+ TimeDelta* queueing_delay) {
+ size_t size = work_queue_.size();
jar (doing other things) 2013/08/22 23:03:39 Note that the "work_queue" is not really the full
Robert Sesek 2013/08/23 16:58:24 Yes, I know the incoming_queue_ is not included in
+ *queue_size = size + delayed_work_queue_.size();
jar (doing other things) 2013/08/22 23:03:39 Why is it interesting to add together pending (rea
Robert Sesek 2013/08/23 16:58:24 Fair point. I did not count this in my initial inv
+
+ if (size == 0) {
+ *queueing_delay = TimeDelta();
+ return;
+ }
+
+ const PendingTask& next_to_run = work_queue_.front();
jar (doing other things) 2013/08/22 23:03:39 The work_queue_ could be empty... so you should te
Robert Sesek 2013/08/23 16:58:24 Already checking size above.
jar (doing other things) 2013/08/27 22:16:55 <doh>... I thought you checked the sum of the size
+ 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