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

Side by Side Diff: content/common/input/event_with_latency_info.h

Issue 2479123003: WIP Add getCoalescedEvents API using vector of WebInputEvents (Closed)
Patch Set: Created 4 years, 1 month 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_COMMON_INPUT_EVENT_WITH_LATENCY_INFO_H_ 5 #ifndef CONTENT_COMMON_INPUT_EVENT_WITH_LATENCY_INFO_H_
6 #define CONTENT_COMMON_INPUT_EVENT_WITH_LATENCY_INFO_H_ 6 #define CONTENT_COMMON_INPUT_EVENT_WITH_LATENCY_INFO_H_
7 7
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "content/common/content_export.h" 10 #include "content/common/content_export.h"
(...skipping 29 matching lines...) Expand all
40 ScopedWebInputEventWithLatencyInfo(ui::ScopedWebInputEvent, 40 ScopedWebInputEventWithLatencyInfo(ui::ScopedWebInputEvent,
41 const ui::LatencyInfo&); 41 const ui::LatencyInfo&);
42 42
43 ~ScopedWebInputEventWithLatencyInfo(); 43 ~ScopedWebInputEventWithLatencyInfo();
44 44
45 bool CanCoalesceWith(const ScopedWebInputEventWithLatencyInfo& other) const 45 bool CanCoalesceWith(const ScopedWebInputEventWithLatencyInfo& other) const
46 WARN_UNUSED_RESULT; 46 WARN_UNUSED_RESULT;
47 47
48 const blink::WebInputEvent& event() const; 48 const blink::WebInputEvent& event() const;
49 blink::WebInputEvent& event(); 49 blink::WebInputEvent& event();
50 const std::vector<const blink::WebInputEvent*>& coalescedEvents();
50 const ui::LatencyInfo latencyInfo() const { return latency_; } 51 const ui::LatencyInfo latencyInfo() const { return latency_; }
51 52
52 void CoalesceWith(const ScopedWebInputEventWithLatencyInfo& other); 53 void CoalesceWith(const ScopedWebInputEventWithLatencyInfo& other);
53 54
54 private: 55 private:
55 ui::ScopedWebInputEvent event_; 56 ui::ScopedWebInputEvent event_;
57 std::vector<ui::ScopedWebInputEvent> scopedCoalescedEvents_;
58 std::vector<const blink::WebInputEvent*> coalescedEvents_;
59
56 mutable ui::LatencyInfo latency_; 60 mutable ui::LatencyInfo latency_;
57 }; 61 };
58 62
59 template <typename T> 63 template <typename T>
60 class EventWithLatencyInfo { 64 class EventWithLatencyInfo {
61 public: 65 public:
62 T event; 66 T event;
63 mutable ui::LatencyInfo latency; 67 mutable ui::LatencyInfo latency;
64 68
65 explicit EventWithLatencyInfo(const T& e) : event(e) {} 69 explicit EventWithLatencyInfo(const T& e) : event(e) {}
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 typedef EventWithLatencyInfo<blink::WebMouseWheelEvent> 108 typedef EventWithLatencyInfo<blink::WebMouseWheelEvent>
105 MouseWheelEventWithLatencyInfo; 109 MouseWheelEventWithLatencyInfo;
106 typedef EventWithLatencyInfo<blink::WebMouseEvent> 110 typedef EventWithLatencyInfo<blink::WebMouseEvent>
107 MouseEventWithLatencyInfo; 111 MouseEventWithLatencyInfo;
108 typedef EventWithLatencyInfo<blink::WebTouchEvent> 112 typedef EventWithLatencyInfo<blink::WebTouchEvent>
109 TouchEventWithLatencyInfo; 113 TouchEventWithLatencyInfo;
110 114
111 } // namespace content 115 } // namespace content
112 116
113 #endif // CONTENT_COMMON_INPUT_EVENT_WITH_LATENCY_INFO_H_ 117 #endif // CONTENT_COMMON_INPUT_EVENT_WITH_LATENCY_INFO_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698