| OLD | NEW |
| (Empty) |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 module ui.mojom; | |
| 6 | |
| 7 import "mojo/common/time.mojom"; | |
| 8 import "ui/gfx/geometry/mojo/geometry.mojom"; | |
| 9 | |
| 10 enum LatencyComponentType { | |
| 11 // ---------------------------BEGIN COMPONENT------------------------------- | |
| 12 // BEGIN COMPONENT is when we show the latency begin in chrome://tracing. | |
| 13 // Timestamp when the input event is sent from RenderWidgetHost to renderer. | |
| 14 INPUT_EVENT_LATENCY_BEGIN_RWH_COMPONENT, | |
| 15 // In threaded scrolling, main thread scroll listener update is async to | |
| 16 // scroll processing in impl thread. This is the timestamp when we consider | |
| 17 // the main thread scroll listener update is begun. | |
| 18 LATENCY_BEGIN_SCROLL_LISTENER_UPDATE_MAIN_COMPONENT, | |
| 19 // ---------------------------NORMAL COMPONENT------------------------------- | |
| 20 // The original timestamp of the touch event which converts to scroll update. | |
| 21 INPUT_EVENT_LATENCY_SCROLL_UPDATE_ORIGINAL_COMPONENT, | |
| 22 // The original timestamp of the touch event which converts to the *first* | |
| 23 // scroll update in a scroll gesture sequence. | |
| 24 INPUT_EVENT_LATENCY_FIRST_SCROLL_UPDATE_ORIGINAL_COMPONENT, | |
| 25 // Original timestamp for input event (e.g. timestamp from kernel). | |
| 26 INPUT_EVENT_LATENCY_ORIGINAL_COMPONENT, | |
| 27 // Timestamp when the UI event is created. | |
| 28 INPUT_EVENT_LATENCY_UI_COMPONENT, | |
| 29 // Timestamp when the event is dispatched on the main thread of the renderer. | |
| 30 INPUT_EVENT_LATENCY_RENDERER_MAIN_COMPONENT, | |
| 31 // This is special component indicating there is rendering scheduled for | |
| 32 // the event associated with this LatencyInfo on main thread. | |
| 33 INPUT_EVENT_LATENCY_RENDERING_SCHEDULED_MAIN_COMPONENT, | |
| 34 // This is special component indicating there is rendering scheduled for | |
| 35 // the event associated with this LatencyInfo on impl thread. | |
| 36 INPUT_EVENT_LATENCY_RENDERING_SCHEDULED_IMPL_COMPONENT, | |
| 37 // Timestamp when a scroll update is forwarded to the main thread. | |
| 38 INPUT_EVENT_LATENCY_FORWARD_SCROLL_UPDATE_TO_MAIN_COMPONENT, | |
| 39 // Timestamp when the event's ack is received by the RWH. | |
| 40 INPUT_EVENT_LATENCY_ACK_RWH_COMPONENT, | |
| 41 // Frame number when a window snapshot was requested. The snapshot | |
| 42 // is taken when the rendering results actually reach the screen. | |
| 43 WINDOW_SNAPSHOT_FRAME_NUMBER_COMPONENT, | |
| 44 // Timestamp when a tab is requested to be shown. | |
| 45 TAB_SHOW_COMPONENT, | |
| 46 // Timestamp when the frame is swapped in renderer. | |
| 47 INPUT_EVENT_LATENCY_RENDERER_SWAP_COMPONENT, | |
| 48 // Timestamp of when the browser process receives a buffer swap notification | |
| 49 // from the renderer. | |
| 50 INPUT_EVENT_BROWSER_RECEIVED_RENDERER_SWAP_COMPONENT, | |
| 51 // Timestamp of when the gpu service began swap buffers, unlike | |
| 52 // INPUT_EVENT_LATENCY_TERMINATED_FRAME_SWAP_COMPONENT which measures after. | |
| 53 INPUT_EVENT_GPU_SWAP_BUFFER_COMPONENT, | |
| 54 // Timestamp of when the gesture scroll update is generated from a mouse wheel | |
| 55 // event. | |
| 56 INPUT_EVENT_LATENCY_GENERATE_SCROLL_UPDATE_FROM_MOUSE_WHEEL, | |
| 57 // ---------------------------TERMINAL COMPONENT----------------------------- | |
| 58 // TERMINAL COMPONENT is when we show the latency end in chrome://tracing. | |
| 59 // Timestamp when the event is acked from renderer when it does not | |
| 60 // cause any rendering to be scheduled. | |
| 61 INPUT_EVENT_LATENCY_TERMINATED_NO_SWAP_COMPONENT, | |
| 62 // Timestamp when the frame is swapped (i.e. when the rendering caused by | |
| 63 // input event actually takes effect). | |
| 64 INPUT_EVENT_LATENCY_TERMINATED_FRAME_SWAP_COMPONENT, | |
| 65 // This component indicates that the input causes a commit to be scheduled | |
| 66 // but the commit failed. | |
| 67 INPUT_EVENT_LATENCY_TERMINATED_COMMIT_FAILED_COMPONENT, | |
| 68 // This component indicates that the input causes a commit to be scheduled | |
| 69 // but the commit was aborted since it carried no new information. | |
| 70 INPUT_EVENT_LATENCY_TERMINATED_COMMIT_NO_UPDATE_COMPONENT, | |
| 71 // This component indicates that the input causes a swap to be scheduled | |
| 72 // but the swap failed. | |
| 73 INPUT_EVENT_LATENCY_TERMINATED_SWAP_FAILED_COMPONENT, | |
| 74 LATENCY_COMPONENT_TYPE_LAST = | |
| 75 INPUT_EVENT_LATENCY_TERMINATED_SWAP_FAILED_COMPONENT, | |
| 76 }; | |
| 77 | |
| 78 struct LatencyComponentId { | |
| 79 LatencyComponentType type; | |
| 80 int64 id; | |
| 81 }; | |
| 82 | |
| 83 struct LatencyComponent { | |
| 84 // Nondecreasing number that can be used to determine what events happened | |
| 85 // in the component at the time this struct was sent on to the next | |
| 86 // component. | |
| 87 int64 sequence_number; | |
| 88 // Average time of events that happened in this component. | |
| 89 mojo.common.mojom.TimeTicks event_time; | |
| 90 // Count of events that happened in this component | |
| 91 uint32 event_count; | |
| 92 // Time of the oldest event that happened in this component. | |
| 93 mojo.common.mojom.TimeTicks first_event_time; | |
| 94 // Time of the most recent event that happened in this component. | |
| 95 mojo.common.mojom.TimeTicks last_event_time; | |
| 96 }; | |
| 97 | |
| 98 struct LatencyComponentPair { | |
| 99 LatencyComponentId key; | |
| 100 LatencyComponent value; | |
| 101 }; | |
| 102 | |
| 103 // See ui/events/latency_info.h | |
| 104 struct LatencyInfo { | |
| 105 string trace_name; | |
| 106 array<LatencyComponentPair> latency_components; | |
| 107 array<gfx.mojom.PointF> input_coordinates; | |
| 108 int64 trace_id; | |
| 109 bool coalesced; | |
| 110 bool terminated; | |
| 111 }; | |
| OLD | NEW |