| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_INPUT_RENDER_WIDGET_HOST_LATENCY_TRACKER_H
_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_INPUT_RENDER_WIDGET_HOST_LATENCY_TRACKER_H
_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_RENDER_WIDGET_HOST_LATENCY_TRACKER_H
_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_RENDER_WIDGET_HOST_LATENCY_TRACKER_H
_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 InputEventAckState ack_result); | 48 InputEventAckState ack_result); |
| 49 | 49 |
| 50 // Populates renderer-created LatencyInfo entries with the appropriate latency | 50 // Populates renderer-created LatencyInfo entries with the appropriate latency |
| 51 // component id. Called when the RenderWidgetHost receives a compositor swap | 51 // component id. Called when the RenderWidgetHost receives a compositor swap |
| 52 // update from the renderer. | 52 // update from the renderer. |
| 53 void OnSwapCompositorFrame(std::vector<ui::LatencyInfo>* latencies); | 53 void OnSwapCompositorFrame(std::vector<ui::LatencyInfo>* latencies); |
| 54 | 54 |
| 55 // Terminates latency tracking for events that triggered rendering, also | 55 // Terminates latency tracking for events that triggered rendering, also |
| 56 // performing relevant UMA latency reporting. | 56 // performing relevant UMA latency reporting. |
| 57 // Called when the RenderWidgetHost receives a swap update from the GPU. | 57 // Called when the RenderWidgetHost receives a swap update from the GPU. |
| 58 void OnFrameSwapped(const ui::LatencyInfo& latency); | 58 void OnFrameSwapped(const ui::LatencyInfo& latency, |
| 59 bool is_running_navigation_hint_task); |
| 59 | 60 |
| 60 // WebInputEvent coordinates are in DPIs, while LatencyInfo expects | 61 // WebInputEvent coordinates are in DPIs, while LatencyInfo expects |
| 61 // coordinates in device pixels. | 62 // coordinates in device pixels. |
| 62 void set_device_scale_factor(float device_scale_factor) { | 63 void set_device_scale_factor(float device_scale_factor) { |
| 63 device_scale_factor_ = device_scale_factor; | 64 device_scale_factor_ = device_scale_factor; |
| 64 } | 65 } |
| 65 | 66 |
| 66 // Returns the ID that uniquely describes this component to the latency | 67 // Returns the ID that uniquely describes this component to the latency |
| 67 // subsystem. | 68 // subsystem. |
| 68 int64_t latency_component_id() const { return latency_component_id_; } | 69 int64_t latency_component_id() const { return latency_component_id_; } |
| 69 | 70 |
| 70 private: | 71 private: |
| 71 int64_t last_event_id_; | 72 int64_t last_event_id_; |
| 72 int64_t latency_component_id_; | 73 int64_t latency_component_id_; |
| 73 float device_scale_factor_; | 74 float device_scale_factor_; |
| 74 bool has_seen_first_gesture_scroll_update_; | 75 bool has_seen_first_gesture_scroll_update_; |
| 75 // Whether the current stream of touch events has ever included more than one | 76 // Whether the current stream of touch events has ever included more than one |
| 76 // touch point. | 77 // touch point. |
| 77 bool multi_finger_gesture_; | 78 bool multi_finger_gesture_; |
| 78 // Whether the touch start for the current stream of touch events had its | 79 // Whether the touch start for the current stream of touch events had its |
| 79 // default action prevented. Only valid for single finger gestures. | 80 // default action prevented. Only valid for single finger gestures. |
| 80 bool touch_start_default_prevented_; | 81 bool touch_start_default_prevented_; |
| 81 | 82 |
| 82 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostLatencyTracker); | 83 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostLatencyTracker); |
| 83 }; | 84 }; |
| 84 | 85 |
| 85 } // namespace content | 86 } // namespace content |
| 86 | 87 |
| 87 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_RENDER_WIDGET_HOST_LATENCY_TRACKE
R_H_ | 88 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_RENDER_WIDGET_HOST_LATENCY_TRACKE
R_H_ |
| OLD | NEW |