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

Bug: 708584
Change-Id: I27a449bc3be5858b0e8d4d6482714523ad5e2b67
Commit-Queue: Gabriel Charette <>
Reviewed-by: Lei Zhang <>
Cr-Commit-Position: refs/heads/master@{#524097}
7 files changed