OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 UI_EVENTS_BLINK_EVENT_WITH_CALLBACK_H_ | 5 #ifndef UI_EVENTS_BLINK_EVENT_WITH_CALLBACK_H_ |
6 #define UI_EVENTS_BLINK_EVENT_WITH_CALLBACK_H_ | 6 #define UI_EVENTS_BLINK_EVENT_WITH_CALLBACK_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 | 9 |
10 #include "ui/events/blink/input_handler_proxy.h" | 10 #include "ui/events/blink/input_handler_proxy.h" |
11 #include "ui/latency/latency_info.h" | 11 #include "ui/latency/latency_info.h" |
12 | 12 |
13 namespace ui { | 13 namespace ui { |
14 | 14 |
15 namespace test { | 15 namespace test { |
16 class InputHandlerProxyEventQueueTest; | 16 class InputHandlerProxyEventQueueTest; |
17 } | 17 } |
18 | 18 |
19 class EventWithCallback { | 19 class EventWithCallback { |
20 public: | 20 public: |
21 struct OriginalEventWithCallback { | 21 struct OriginalEventWithCallback { |
22 OriginalEventWithCallback( | 22 OriginalEventWithCallback( |
23 WebScopedInputEvent event, | 23 WebScopedInputEvent event, |
24 const InputHandlerProxy::EventDispositionCallback& callback); | 24 InputHandlerProxy::EventDispositionCallback callback); |
25 ~OriginalEventWithCallback(); | 25 ~OriginalEventWithCallback(); |
26 WebScopedInputEvent event_; | 26 WebScopedInputEvent event_; |
27 InputHandlerProxy::EventDispositionCallback callback_; | 27 InputHandlerProxy::EventDispositionCallback callback_; |
28 }; | 28 }; |
29 using OriginalEventList = std::list<OriginalEventWithCallback>; | 29 using OriginalEventList = std::list<OriginalEventWithCallback>; |
30 | 30 |
31 EventWithCallback( | 31 EventWithCallback(WebScopedInputEvent event, |
32 WebScopedInputEvent event, | 32 const LatencyInfo& latency, |
33 const LatencyInfo& latency, | 33 base::TimeTicks timestamp_now, |
34 base::TimeTicks timestamp_now, | 34 InputHandlerProxy::EventDispositionCallback callback); |
35 const InputHandlerProxy::EventDispositionCallback& callback); | |
36 EventWithCallback(WebScopedInputEvent event, | 35 EventWithCallback(WebScopedInputEvent event, |
37 const LatencyInfo& latency, | 36 const LatencyInfo& latency, |
38 base::TimeTicks creation_timestamp, | 37 base::TimeTicks creation_timestamp, |
39 base::TimeTicks last_coalesced_timestamp, | 38 base::TimeTicks last_coalesced_timestamp, |
40 std::unique_ptr<OriginalEventList> original_events); | 39 std::unique_ptr<OriginalEventList> original_events); |
41 ~EventWithCallback(); | 40 ~EventWithCallback(); |
42 | 41 |
43 bool CanCoalesceWith(const EventWithCallback& other) const WARN_UNUSED_RESULT; | 42 bool CanCoalesceWith(const EventWithCallback& other) const WARN_UNUSED_RESULT; |
44 void CoalesceWith(EventWithCallback* other, base::TimeTicks timestamp_now); | 43 void CoalesceWith(EventWithCallback* other, base::TimeTicks timestamp_now); |
45 | 44 |
(...skipping 24 matching lines...) Expand all Loading... |
70 LatencyInfo latency_; | 69 LatencyInfo latency_; |
71 OriginalEventList original_events_; | 70 OriginalEventList original_events_; |
72 | 71 |
73 base::TimeTicks creation_timestamp_; | 72 base::TimeTicks creation_timestamp_; |
74 base::TimeTicks last_coalesced_timestamp_; | 73 base::TimeTicks last_coalesced_timestamp_; |
75 }; | 74 }; |
76 | 75 |
77 } // namespace ui | 76 } // namespace ui |
78 | 77 |
79 #endif // UI_EVENTS_BLINK_EVENT_WITH_CALLBACK_H_ | 78 #endif // UI_EVENTS_BLINK_EVENT_WITH_CALLBACK_H_ |
OLD | NEW |