2011-03-24 21:36:47 +01:00
|
|
|
Index: message_loop.cc
|
|
|
|
===================================================================
|
2012-05-23 21:01:04 +02:00
|
|
|
--- message_loop.cc (revision 138235)
|
2011-03-24 21:36:47 +01:00
|
|
|
+++ message_loop.cc (working copy)
|
2012-05-23 21:01:04 +02:00
|
|
|
@@ -367,9 +367,13 @@
|
2011-03-24 21:36:47 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void MessageLoop::AssertIdle() const {
|
|
|
|
+ DCHECK(IsIdle());
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+bool MessageLoop::IsIdle() const {
|
|
|
|
// We only check |incoming_queue_|, since we don't want to lock |work_queue_|.
|
|
|
|
base::AutoLock lock(incoming_queue_lock_);
|
|
|
|
- DCHECK(incoming_queue_.empty());
|
|
|
|
+ return incoming_queue_.empty();
|
|
|
|
}
|
|
|
|
|
2011-11-05 00:12:18 +01:00
|
|
|
bool MessageLoop::is_running() const {
|
2011-03-24 21:36:47 +01:00
|
|
|
Index: message_loop.h
|
|
|
|
===================================================================
|
2012-05-23 21:01:04 +02:00
|
|
|
--- message_loop.h (revision 138235)
|
2011-03-24 21:36:47 +01:00
|
|
|
+++ message_loop.h (working copy)
|
2012-05-23 21:01:04 +02:00
|
|
|
@@ -347,6 +347,9 @@
|
2011-03-24 21:36:47 +01:00
|
|
|
// Asserts that the MessageLoop is "idle".
|
|
|
|
void AssertIdle() const;
|
|
|
|
|
|
|
|
+ // Returns true if the MessageLoop is "idle".
|
|
|
|
+ bool IsIdle() const;
|
|
|
|
+
|
2011-04-05 18:17:33 +02:00
|
|
|
#if defined(OS_WIN)
|
|
|
|
void set_os_modal_loop(bool os_modal_loop) {
|
|
|
|
os_modal_loop_ = os_modal_loop;
|