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) { |