Cherry-pick: Reland [Android] Mark posted UI thread tasks as asynchronous

Clean cherry-pick of chromium
crrev.com/d51117a99a4e023e791134185c6db12b28028a1d

BUG: 18283959

Original description:

Chromium shares a message loop with Android on the browser UI thread.
This can cause problems when the associated Looper has a sync barrier,
preventing posted Chromium tasks from being dispatched until the
barrier is removed. Make this sharing more fair by marking all Chromium
Message tasks as asynchronous, avoiding stalls when there is a sync
barrier.

Note: This change was originally landed in crrev.com/512333002, but was
reverted to gather more data about sync barrier impact and investigate
alternative solutions. The investigation determiend that this approach
is fine for the near future, though it will likely evolve in time.

Change-Id: I9879a9c1bdad0dcec12c2bbee62356a5b12d9596
1 file changed