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