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 #include "content/renderer/input/input_event_filter.h" | 5 #include "content/renderer/input/input_event_filter.h" |
6 | 6 |
| 7 #include <tuple> |
7 #include <utility> | 8 #include <utility> |
8 | 9 |
9 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
10 #include "base/bind.h" | 11 #include "base/bind.h" |
11 #include "base/location.h" | 12 #include "base/location.h" |
12 #include "base/memory/ptr_util.h" | 13 #include "base/memory/ptr_util.h" |
13 #include "base/single_thread_task_runner.h" | 14 #include "base/single_thread_task_runner.h" |
14 #include "base/threading/thread_task_runner_handle.h" | 15 #include "base/threading/thread_task_runner_handle.h" |
15 #include "base/trace_event/trace_event.h" | 16 #include "base/trace_event/trace_event.h" |
16 #include "content/common/input/did_overscroll_params.h" | 17 #include "content/common/input/did_overscroll_params.h" |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 "InputEventFilter::ForwardToHandler::ForwardToMainListener", | 168 "InputEventFilter::ForwardToHandler::ForwardToMainListener", |
168 TRACE_EVENT_SCOPE_THREAD); | 169 TRACE_EVENT_SCOPE_THREAD); |
169 main_task_runner_->PostTask(FROM_HERE, base::Bind(main_listener_, message)); | 170 main_task_runner_->PostTask(FROM_HERE, base::Bind(main_listener_, message)); |
170 return; | 171 return; |
171 } | 172 } |
172 | 173 |
173 int routing_id = message.routing_id(); | 174 int routing_id = message.routing_id(); |
174 InputMsg_HandleInputEvent::Param params; | 175 InputMsg_HandleInputEvent::Param params; |
175 if (!InputMsg_HandleInputEvent::Read(&message, ¶ms)) | 176 if (!InputMsg_HandleInputEvent::Read(&message, ¶ms)) |
176 return; | 177 return; |
177 const WebInputEvent* event = base::get<0>(params); | 178 const WebInputEvent* event = std::get<0>(params); |
178 ui::LatencyInfo latency_info = base::get<1>(params); | 179 ui::LatencyInfo latency_info = std::get<1>(params); |
179 InputEventDispatchType dispatch_type = base::get<2>(params); | 180 InputEventDispatchType dispatch_type = std::get<2>(params); |
180 DCHECK(event); | 181 DCHECK(event); |
181 DCHECK(dispatch_type == DISPATCH_TYPE_BLOCKING || | 182 DCHECK(dispatch_type == DISPATCH_TYPE_BLOCKING || |
182 dispatch_type == DISPATCH_TYPE_NON_BLOCKING); | 183 dispatch_type == DISPATCH_TYPE_NON_BLOCKING); |
183 | 184 |
184 bool send_ack = dispatch_type == DISPATCH_TYPE_BLOCKING; | 185 bool send_ack = dispatch_type == DISPATCH_TYPE_BLOCKING; |
185 | 186 |
186 // Intercept |DidOverscroll| notifications, bundling any triggered overscroll | 187 // Intercept |DidOverscroll| notifications, bundling any triggered overscroll |
187 // response with the input event ack. | 188 // response with the input event ack. |
188 std::unique_ptr<DidOverscrollParams> overscroll_params; | 189 std::unique_ptr<DidOverscrollParams> overscroll_params; |
189 base::AutoReset<std::unique_ptr<DidOverscrollParams>*> | 190 base::AutoReset<std::unique_ptr<DidOverscrollParams>*> |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 InputEventDispatchType dispatch_type) { | 237 InputEventDispatchType dispatch_type) { |
237 TRACE_EVENT_INSTANT0( | 238 TRACE_EVENT_INSTANT0( |
238 "input", "InputEventFilter::ForwardToHandler::SendEventToMainThread", | 239 "input", "InputEventFilter::ForwardToHandler::SendEventToMainThread", |
239 TRACE_EVENT_SCOPE_THREAD); | 240 TRACE_EVENT_SCOPE_THREAD); |
240 IPC::Message new_msg = | 241 IPC::Message new_msg = |
241 InputMsg_HandleInputEvent(routing_id, event, latency_info, dispatch_type); | 242 InputMsg_HandleInputEvent(routing_id, event, latency_info, dispatch_type); |
242 main_task_runner_->PostTask(FROM_HERE, base::Bind(main_listener_, new_msg)); | 243 main_task_runner_->PostTask(FROM_HERE, base::Bind(main_listener_, new_msg)); |
243 } | 244 } |
244 | 245 |
245 } // namespace content | 246 } // namespace content |
OLD | NEW |