Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(360)

Side by Side Diff: content/browser/renderer_host/input/render_widget_host_latency_tracker.h

Issue 2888153002: Add TimeToScrollUpdateSwapBegin2 to UKM (Closed)
Patch Set: Rename the test function Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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>
11 11
12 #include "base/macros.h" 12 #include "base/macros.h"
13 #include "components/ukm/public/ukm_recorder.h"
13 #include "content/browser/renderer_host/event_with_latency_info.h" 14 #include "content/browser/renderer_host/event_with_latency_info.h"
14 #include "content/common/content_export.h" 15 #include "content/common/content_export.h"
15 #include "content/common/input/input_event_ack_state.h" 16 #include "content/common/input/input_event_ack_state.h"
16 #include "ui/latency/latency_info.h" 17 #include "ui/latency/latency_info.h"
17 #include "ui/latency/latency_tracker.h" 18 #include "ui/latency/latency_tracker.h"
18 19
19 namespace content { 20 namespace content {
20 21
21 class RenderWidgetHostDelegate; 22 class RenderWidgetHostDelegate;
22 23
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 65
65 // Returns the ID that uniquely describes this component to the latency 66 // Returns the ID that uniquely describes this component to the latency
66 // subsystem. 67 // subsystem.
67 int64_t latency_component_id() const { return latency_component_id_; } 68 int64_t latency_component_id() const { return latency_component_id_; }
68 69
69 // A delegate is used to get the url to be stored in Rappor Sample. 70 // A delegate is used to get the url to be stored in Rappor Sample.
70 // If delegate is null no Rappor sample will be reported. 71 // If delegate is null no Rappor sample will be reported.
71 void SetDelegate(RenderWidgetHostDelegate*); 72 void SetDelegate(RenderWidgetHostDelegate*);
72 73
73 private: 74 private:
75 ukm::SourceId GetUkmSourceId();
76
74 // ui::LatencyTracker: 77 // ui::LatencyTracker:
75 void ReportRapporScrollLatency( 78 void ReportRapporScrollLatency(
76 const std::string& name, 79 const std::string& name,
77 const ui::LatencyInfo::LatencyComponent& start_component, 80 const ui::LatencyInfo::LatencyComponent& start_component,
78 const ui::LatencyInfo::LatencyComponent& end_component) override; 81 const ui::LatencyInfo::LatencyComponent& end_component) override;
79 82
83 // ui::LatencyTracker:
84 void ReportUkmScrollLatency(
85 const std::string& event_name,
86 const std::string& metric_name,
87 const ui::LatencyInfo::LatencyComponent& start_component,
88 const ui::LatencyInfo::LatencyComponent& end_component) override;
89
90 ukm::SourceId ukm_source_id_;
80 int64_t last_event_id_; 91 int64_t last_event_id_;
81 int64_t latency_component_id_; 92 int64_t latency_component_id_;
82 float device_scale_factor_; 93 float device_scale_factor_;
83 bool has_seen_first_gesture_scroll_update_; 94 bool has_seen_first_gesture_scroll_update_;
84 // Whether the current stream of touch events includes more than one active 95 // Whether the current stream of touch events includes more than one active
85 // touch point. This is set in OnInputEvent, and cleared in OnInputEventAck. 96 // touch point. This is set in OnInputEvent, and cleared in OnInputEventAck.
86 bool active_multi_finger_gesture_; 97 bool active_multi_finger_gesture_;
87 // Whether the touch start for the current stream of touch events had its 98 // Whether the touch start for the current stream of touch events had its
88 // default action prevented. Only valid for single finger gestures. 99 // default action prevented. Only valid for single finger gestures.
89 bool touch_start_default_prevented_; 100 bool touch_start_default_prevented_;
90 101
91 RenderWidgetHostDelegate* render_widget_host_delegate_; 102 RenderWidgetHostDelegate* render_widget_host_delegate_;
92 103
93 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostLatencyTracker); 104 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostLatencyTracker);
94 }; 105 };
95 106
96 } // namespace content 107 } // namespace content
97 108
98 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_RENDER_WIDGET_HOST_LATENCY_TRACKE R_H_ 109 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_RENDER_WIDGET_HOST_LATENCY_TRACKE R_H_
OLDNEW
« no previous file with comments | « components/ukm/public/ukm_recorder.h ('k') | content/browser/renderer_host/input/render_widget_host_latency_tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698