Report LatencyInfo through trace buffer

This CL is the first step in converting to use trace event to
collect LatencyInfo. Changes are:

1. Each LatencyInfo will have at most one BEGIN/TERMINATED component.
When the BEGIN component is added, an ASYNC_BEGIN trace event is issued.
When the TERMINATED component is added, an ASYNC_END trace event is issued,
and the LatencyInfo is dumped into the trace buffer.

2. BEGIN component is added to event's LatencyInfo when the event reaches RWH.

3. If events cause renderering to be schedueld in renderer, then the
INPUT_EVENT_LATENCY_TERMINATED_FRAME_SWAP_COMPONENT
is added when actual frame swap happens. Accordingly, swap_timestamp_ is
removed.

4. If events do not cause rendering to be scheduled in renderer, then
   4.1) INPUT_EVENT_LATENCY_TERMINATED_MOUSE/GESTURE_COMPONENT
        is added when the mouse/gesture events are acked from renderer.
   4.2) If the acked touch event become gesture event, touch event's
        LatencInfo are copied into gesture event's LatencyInfo.
   4.3) If the acked touch event does not become gesture event,
        INPUT_EVENT_LATENCY_TERMINATED_TOUCH_COMPONENT
        is then added to the touch event's LatencyInfo.

This CL is only adding the ability to dump LatencyInfo to trace buffer but don't
change the current way LatencyInfo is used so all the telemetry tests are not
affected. The complete migration will be in followup CLs.

BUG=BUG=246034
TEST=1. telemetry smoothness test still works.
2. Do trace recording with category "benchmark", check that latencyinfo are
dumped to "InputLatency";

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@228095 0039d316-1c4b-4281-b951-d872f2087c98
SVN changes up to revision 228095