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

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

Issue 2621303004: Keep track of coalesced events in main thread event queue (Closed)
Patch Set: Rebase Created 3 years, 11 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 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 10 matching lines...) Expand all
21 public: 21 public:
22 ScopedWebInputEventWithLatencyInfo(blink::WebScopedInputEvent, 22 ScopedWebInputEventWithLatencyInfo(blink::WebScopedInputEvent,
23 const ui::LatencyInfo&); 23 const ui::LatencyInfo&);
24 24
25 ~ScopedWebInputEventWithLatencyInfo(); 25 ~ScopedWebInputEventWithLatencyInfo();
26 26
27 bool CanCoalesceWith(const ScopedWebInputEventWithLatencyInfo& other) const 27 bool CanCoalesceWith(const ScopedWebInputEventWithLatencyInfo& other) const
28 WARN_UNUSED_RESULT; 28 WARN_UNUSED_RESULT;
29 29
30 const blink::WebInputEvent& event() const; 30 const blink::WebInputEvent& event() const;
31 const blink::WebCoalescedInputEvent& coalesced_event() const;
31 blink::WebInputEvent& event(); 32 blink::WebInputEvent& event();
32 const ui::LatencyInfo latencyInfo() const { return latency_; } 33 const ui::LatencyInfo latencyInfo() const { return latency_; }
33 34
34 void CoalesceWith(const ScopedWebInputEventWithLatencyInfo& other); 35 void CoalesceWith(const ScopedWebInputEventWithLatencyInfo& other);
35 36
36 private: 37 private:
37 blink::WebScopedInputEvent event_; 38 blink::WebScopedCoalescedInputEvent event_;
38 mutable ui::LatencyInfo latency_; 39 mutable ui::LatencyInfo latency_;
39 }; 40 };
40 41
41 template <typename T> 42 template <typename T>
42 class EventWithLatencyInfo { 43 class EventWithLatencyInfo {
43 public: 44 public:
44 T event; 45 T event;
45 mutable ui::LatencyInfo latency; 46 mutable ui::LatencyInfo latency;
46 47
47 explicit EventWithLatencyInfo(const T& e) : event(e) {} 48 explicit EventWithLatencyInfo(const T& e) : event(e) {}
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 typedef EventWithLatencyInfo<blink::WebMouseWheelEvent> 93 typedef EventWithLatencyInfo<blink::WebMouseWheelEvent>
93 MouseWheelEventWithLatencyInfo; 94 MouseWheelEventWithLatencyInfo;
94 typedef EventWithLatencyInfo<blink::WebMouseEvent> 95 typedef EventWithLatencyInfo<blink::WebMouseEvent>
95 MouseEventWithLatencyInfo; 96 MouseEventWithLatencyInfo;
96 typedef EventWithLatencyInfo<blink::WebTouchEvent> 97 typedef EventWithLatencyInfo<blink::WebTouchEvent>
97 TouchEventWithLatencyInfo; 98 TouchEventWithLatencyInfo;
98 99
99 } // namespace content 100 } // namespace content
100 101
101 #endif // CONTENT_COMMON_INPUT_EVENT_WITH_LATENCY_INFO_H_ 102 #endif // CONTENT_COMMON_INPUT_EVENT_WITH_LATENCY_INFO_H_
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_mac_unittest.mm ('k') | content/common/input/event_with_latency_info.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698