Version of MessagePumpForUI optimized for GPU

This is re-landing of https://codereview.chromium.org/1714263002.

The original patch was reverted due to responsiveness issues with the
browser main window on Window 10 during high GPU load. It turned out
not pumping Windows messages promptly enough in the GPU process resulted
in blocking mouse messages in the browser process due to the
shared nature of the underlying message queue (and the fact that DXVA
window is a disabled child of the main browser window covering its
entire client area).

The original patch is patch-set 1 and patch-set 2 shows the revised
version. There are two main differences:
- Message Pumping is now done on every loop iteration just like in
   MessagePumpForUI.
- At the same time I moved away from using a work message to signal
   the consumer thread and used an event instead. This should mostly
   eliminate the message traffic in the main GPU thread message queue
   and hopefully reduce interference between the browser main thread
   and the GPU main thread.

See the original change for the description of the efficiency
improvements. The secondary goal for this change is to see whether
stopping using work messages altogether would affect the rate
of GPU hangs (crbug/596190). Hangs in KillTimer account
for about 2-2.5% of all GPU hangs. I hope that eliminating
any timer related code altogether might help to reduce
the rate. The previously used signalling mechanism based
on PostMessage could fail as well when the message queue
was overfilled. The new mechanism based on SetEvent
should be more reliable.

BUG=588798

Review-Url: https://codereview.chromium.org/1943063002
Cr-Commit-Position: refs/heads/master@{#396240}


CrOS-Libchrome-Original-Commit: 100d03d7637f9ec1f31ae012a7712a44d195c483
1 file changed
tree: 1be7d89ae5697aa718997cdf02b64d8bcaf0c7ae
  1. base/
  2. build/
  3. components/
  4. dbus/
  5. device/
  6. ipc/
  7. mojo/
  8. testing/
  9. third_party/
  10. ui/