Replace RunLoop's Delegate::Client by a ShouldQuitWhenIdleCallback.
The Client interface was diluted down to a single method at this point. Different implementations of overriding Delegate's Run() methods will need different behaviors from ShouldQuitWhenIdle(). Making it easily overrridable is key. One such example behaviour is when overriding a MessageLoopForUI/IO. When waiting inside a Run() with no more tasks, control needs to remain in the hands of the overridden MessageLoop as it may receive work first (from the system) and therefore shouldn't quit-when-idle when the overriding Delegate is out of work (the overriding Delegate can let it know to wake by posting a task to it if it gets work first). R=thestig@chromium.org Bug: 708584 Change-Id: I27a449bc3be5858b0e8d4d6482714523ad5e2b67 Reviewed-on: https://chromium-review.googlesource.com/817962 Commit-Queue: Gabriel Charette <gab@chromium.org> Reviewed-by:Lei Zhang <thestig@chromium.org> Cr-Commit-Position: refs/heads/master@{#524097}
Showing
Please register or sign in to comment