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

Side by Side Diff: content/browser/renderer_host/event_with_latency_info.h

Issue 779763002: Factor out latency tracking from RenderWidgetHostImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_EVENT_WITH_LATENCY_INFO_H_ 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_EVENT_WITH_LATENCY_INFO_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_EVENT_WITH_LATENCY_INFO_H_ 6 #define CONTENT_BROWSER_RENDERER_HOST_EVENT_WITH_LATENCY_INFO_H_
7 7
8 #include "ui/events/latency_info.h" 8 #include "ui/events/latency_info.h"
9 9
10 #include "content/common/input/web_input_event_traits.h" 10 #include "content/common/input/web_input_event_traits.h"
11 11
12 namespace blink { 12 namespace blink {
13 class WebGestureEvent; 13 class WebGestureEvent;
14 class WebMouseEvent; 14 class WebMouseEvent;
15 class WebMouseWheelEvent; 15 class WebMouseWheelEvent;
16 class WebTouchEvent; 16 class WebTouchEvent;
17 } 17 }
18 18
19 namespace content { 19 namespace content {
20 20
21 template <typename T> 21 template <typename T>
22 class EventWithLatencyInfo { 22 class EventWithLatencyInfo {
23 public: 23 public:
24 T event; 24 T event;
25 ui::LatencyInfo latency; 25 mutable ui::LatencyInfo latency;
26
27 explicit EventWithLatencyInfo(const T& e) : event(e) {}
26 28
27 EventWithLatencyInfo(const T& e, const ui::LatencyInfo& l) 29 EventWithLatencyInfo(const T& e, const ui::LatencyInfo& l)
28 : event(e), latency(l) {} 30 : event(e), latency(l) {}
29 31
30 EventWithLatencyInfo() {} 32 EventWithLatencyInfo() {}
31 33
32 bool CanCoalesceWith(const EventWithLatencyInfo& other) 34 bool CanCoalesceWith(const EventWithLatencyInfo& other)
33 const WARN_UNUSED_RESULT { 35 const WARN_UNUSED_RESULT {
34 return WebInputEventTraits::CanCoalesce(other.event, event); 36 return WebInputEventTraits::CanCoalesce(other.event, event);
35 } 37 }
(...skipping 14 matching lines...) Expand all
50 typedef EventWithLatencyInfo<blink::WebMouseWheelEvent> 52 typedef EventWithLatencyInfo<blink::WebMouseWheelEvent>
51 MouseWheelEventWithLatencyInfo; 53 MouseWheelEventWithLatencyInfo;
52 typedef EventWithLatencyInfo<blink::WebMouseEvent> 54 typedef EventWithLatencyInfo<blink::WebMouseEvent>
53 MouseEventWithLatencyInfo; 55 MouseEventWithLatencyInfo;
54 typedef EventWithLatencyInfo<blink::WebTouchEvent> 56 typedef EventWithLatencyInfo<blink::WebTouchEvent>
55 TouchEventWithLatencyInfo; 57 TouchEventWithLatencyInfo;
56 58
57 } // namespace content 59 } // namespace content
58 60
59 #endif // CONTENT_BROWSER_RENDERER_HOST_EVENT_WITH_LATENCY_INFO_H_ 61 #endif // CONTENT_BROWSER_RENDERER_HOST_EVENT_WITH_LATENCY_INFO_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698