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

Unified Diff: webrtc/base/messagequeue.cc

Issue 2680233002: Use fake clock in some more networks tests. (Closed)
Patch Set: Created 3 years, 10 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: webrtc/base/messagequeue.cc
diff --git a/webrtc/base/messagequeue.cc b/webrtc/base/messagequeue.cc
index 8dd84cb89c256d4b3fd99ab6ba1240ef3300954e..a673a4011afcab3bd11c7d22c53eb3b412fdf422 100644
--- a/webrtc/base/messagequeue.cc
+++ b/webrtc/base/messagequeue.cc
@@ -146,9 +146,10 @@ void MessageQueueManager::ProcessAllMessageQueuesInternal() {
{
DebugNonReentrantCritScope cs(&crit_, &locked_);
for (MessageQueue* queue : message_queues_) {
- if (queue->IsQuitting()) {
- // If the queue is quitting, it's done processing messages so it can
- // be ignored. If we tried to post a message to it, it would be dropped.
+ if (!queue->IsProcessingMessages()) {
+ // If the queue is not processing messages, it can
+ // be ignored. If we tried to post a message to it, it would be dropped
+ // or ignored.
continue;
}
queue->PostDelayed(RTC_FROM_HERE, 0, nullptr, MQID_DISPOSE,
@@ -250,6 +251,9 @@ void MessageQueue::Quit() {
bool MessageQueue::IsQuitting() {
return AtomicOps::AcquireLoad(&stop_) != 0;
}
Taylor Brandstetter 2017/02/08 01:23:58 nit: newline
pthatcher1 2017/02/08 08:52:24 Done.
+bool MessageQueue::IsProcessingMessages() {
+ return !IsQuitting();
+}
void MessageQueue::Restart() {
AtomicOps::ReleaseStore(&stop_, 0);

Powered by Google App Engine
This is Rietveld 408576698