[base] Migrate Android's MessagePumpForUI to DoSomeWork().

The tricky part is the need to yield to java before declaring
idle. Previously this was done by only yielding to java if we
did any work. With DoSomeWork() however we do not know if we
did any work, we only know whether there's more work to come.
As such we use a special bit to yield to java once and declare
idle if no other work is scheduled in-between now and java
invoking us again.

Bug: 885371
Change-Id: Id9c8271cc216d06a2db7b9a95636fe87b285eb93
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1485130
Reviewed-by: Alex Clarke <[email protected]>
Reviewed-by: Michael Thiessen <[email protected]>
Commit-Queue: Gabriel Charette <[email protected]>
Auto-Submit: Gabriel Charette <[email protected]>
Cr-Commit-Position: refs/heads/master@{#654883}
5 files changed