OLD | NEW |
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_RENDERER_INPUT_INPUT_EVENT_FILTER_H_ | 5 #ifndef CONTENT_RENDERER_INPUT_INPUT_EVENT_FILTER_H_ |
6 #define CONTENT_RENDERER_INPUT_INPUT_EVENT_FILTER_H_ | 6 #define CONTENT_RENDERER_INPUT_INPUT_EVENT_FILTER_H_ |
7 | 7 |
8 #include <queue> | 8 #include <queue> |
9 #include <set> | 9 #include <set> |
10 #include <unordered_map> | 10 #include <unordered_map> |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 // |main_listener| on the main thread. (The "main thread" in this context is | 58 // |main_listener| on the main thread. (The "main thread" in this context is |
59 // the thread where the InputEventFilter was constructed.) The responsibility | 59 // the thread where the InputEventFilter was constructed.) The responsibility |
60 // is left to the eventual handler to deliver the corresponding | 60 // is left to the eventual handler to deliver the corresponding |
61 // InputHostMsg_HandleInputEvent_ACK. | 61 // InputHostMsg_HandleInputEvent_ACK. |
62 // | 62 // |
63 void SetInputHandlerManager(InputHandlerManager*) override; | 63 void SetInputHandlerManager(InputHandlerManager*) override; |
64 void RegisterRoutingID(int routing_id) override; | 64 void RegisterRoutingID(int routing_id) override; |
65 void UnregisterRoutingID(int routing_id) override; | 65 void UnregisterRoutingID(int routing_id) override; |
66 void DidOverscroll(int routing_id, | 66 void DidOverscroll(int routing_id, |
67 const ui::DidOverscrollParams& params) override; | 67 const ui::DidOverscrollParams& params) override; |
68 void DidStartFlinging(int routing_id) override; | |
69 void DidStopFlinging(int routing_id) override; | 68 void DidStopFlinging(int routing_id) override; |
70 void DispatchNonBlockingEventToMainThread( | 69 void DispatchNonBlockingEventToMainThread( |
71 int routing_id, | 70 int routing_id, |
72 ui::ScopedWebInputEvent event, | 71 ui::ScopedWebInputEvent event, |
73 const ui::LatencyInfo& latency_info) override; | 72 const ui::LatencyInfo& latency_info) override; |
74 | 73 |
75 void NotifyInputEventHandled(int routing_id, | 74 void NotifyInputEventHandled(int routing_id, |
76 blink::WebInputEvent::Type type, | 75 blink::WebInputEvent::Type type, |
77 InputEventAckState ack_result) override; | 76 InputEventAckState ack_result) override; |
78 void ProcessRafAlignedInput(int routing_id) override; | 77 void ProcessRafAlignedInput(int routing_id) override; |
(...skipping 26 matching lines...) Expand all Loading... |
105 base::TimeTicks received_time); | 104 base::TimeTicks received_time); |
106 void DidForwardToHandlerAndOverscroll( | 105 void DidForwardToHandlerAndOverscroll( |
107 int routing_id, | 106 int routing_id, |
108 InputEventDispatchType dispatch_type, | 107 InputEventDispatchType dispatch_type, |
109 InputEventAckState ack_state, | 108 InputEventAckState ack_state, |
110 ui::ScopedWebInputEvent event, | 109 ui::ScopedWebInputEvent event, |
111 const ui::LatencyInfo& latency_info, | 110 const ui::LatencyInfo& latency_info, |
112 std::unique_ptr<ui::DidOverscrollParams> overscroll_params); | 111 std::unique_ptr<ui::DidOverscrollParams> overscroll_params); |
113 void SendMessage(std::unique_ptr<IPC::Message> message); | 112 void SendMessage(std::unique_ptr<IPC::Message> message); |
114 void SendMessageOnIOThread(std::unique_ptr<IPC::Message> message); | 113 void SendMessageOnIOThread(std::unique_ptr<IPC::Message> message); |
115 void SetIsFlingingInMainThreadEventQueue(int routing_id, bool is_flinging); | |
116 | 114 |
117 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_; | 115 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_; |
118 base::Callback<void(const IPC::Message&)> main_listener_; | 116 base::Callback<void(const IPC::Message&)> main_listener_; |
119 | 117 |
120 // The sender_ only gets invoked on the thread corresponding to io_loop_. | 118 // The sender_ only gets invoked on the thread corresponding to io_loop_. |
121 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; | 119 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; |
122 IPC::Sender* sender_; | 120 IPC::Sender* sender_; |
123 | 121 |
124 // The |input_handler_manager_| should outlive this class and | 122 // The |input_handler_manager_| should outlive this class and |
125 // should only be called back on the |target_task_runner_|. | 123 // should only be called back on the |target_task_runner_|. |
126 scoped_refptr<base::SingleThreadTaskRunner> target_task_runner_; | 124 scoped_refptr<base::SingleThreadTaskRunner> target_task_runner_; |
127 InputHandlerManager* input_handler_manager_; | 125 InputHandlerManager* input_handler_manager_; |
128 | 126 |
129 // Protects access to routes_. | 127 // Protects access to routes_. |
130 base::Lock routes_lock_; | 128 base::Lock routes_lock_; |
131 | 129 |
132 // Indicates the routing_ids for which input events should be filtered. | 130 // Indicates the routing_ids for which input events should be filtered. |
133 std::set<int> routes_; | 131 std::set<int> routes_; |
134 | 132 |
135 using RouteQueueMap = | 133 using RouteQueueMap = |
136 std::unordered_map<int, scoped_refptr<MainThreadEventQueue>>; | 134 std::unordered_map<int, scoped_refptr<MainThreadEventQueue>>; |
137 RouteQueueMap route_queues_; | 135 RouteQueueMap route_queues_; |
138 | 136 |
139 blink::scheduler::RendererScheduler* renderer_scheduler_; | 137 blink::scheduler::RendererScheduler* renderer_scheduler_; |
140 }; | 138 }; |
141 | 139 |
142 } // namespace content | 140 } // namespace content |
143 | 141 |
144 #endif // CONTENT_RENDERER_INPUT_INPUT_EVENT_FILTER_H_ | 142 #endif // CONTENT_RENDERER_INPUT_INPUT_EVENT_FILTER_H_ |
OLD | NEW |