[Android] Experimental sync barrier detection for tracing

When an Android View is invalidated outside of frame dispatch
(animation/input/draw), a sync barrier may be inserted into the shared
UI thread message loop. This effectively blocks dispatch of all Chrome
tasks posted to the browser UI thread for an entire frame (or more if
the View is continually invalidated).

There are currently no easy or even automated ways to avoid this
untimely invalidation, and judicious coding can only take us so far. As
an intermediate assist in debugging the issue, use reflection and a
crude form of MessageQueue inspection to trace known cases where the
MessageQueue is blocked by a sync barrier.

Note that this detection is not perfect, neither is it exact, but it's a
solid proxy for informing traces about such pipeline stalls.

BUG=407133

Review URL: https://codereview.chromium.org/575103002

Cr-Commit-Position: refs/heads/master@{#296249}
1 file changed