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

Unified Diff: base/message_loop/message_loop.cc

Issue 18181011: Make a fairer combined message loop (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated to ask the pump if it needs to be notified for each work item added Created 7 years, 6 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 9e33a426eb9f1241be625c25aee1a1585898c6fc..60f0fb89a9107cdec9d39ad2d9236c3b958a697e 100644
--- a/base/message_loop/message_loop.cc
+++ b/base/message_loop/message_loop.cc
@@ -624,7 +624,9 @@ bool MessageLoop::AddToIncomingQueue(PendingTask* pending_task,
bool was_empty = incoming_queue_.empty();
incoming_queue_.push(*pending_task);
pending_task->task.Reset();
- if (!was_empty)
+ // The Android UI message loop needs to get notified each time
+ // a task is added to the incoming queue
+ if (!was_empty && !pump_->NeedsScheduleWorkPerTask())
return true; // Someone else should have started the sub-pump.
pump = pump_;

Powered by Google App Engine
This is Rietveld 408576698