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

Unified Diff: content/renderer/input/input_event_filter.cc

Issue 2240473002: Give MainThreadEventQueue a mutable WebInputEvent. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed consts Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/common/input/event_with_latency_info.cc ('k') | content/renderer/input/main_thread_event_queue.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/input/input_event_filter.cc
diff --git a/content/renderer/input/input_event_filter.cc b/content/renderer/input/input_event_filter.cc
index bb9f6a894f1c0a5313ca612a8491c11f1a87add9..b3bf1fdaf0006da4da64505da996d9f1409846ca 100644
--- a/content/renderer/input/input_event_filter.cc
+++ b/content/renderer/input/input_event_filter.cc
@@ -181,7 +181,7 @@ void InputEventFilter::ForwardToHandler(const IPC::Message& message) {
InputMsg_HandleInputEvent::Param params;
if (!InputMsg_HandleInputEvent::Read(&message, &params))
return;
- const WebInputEvent* event = std::get<0>(params);
+ ScopedWebInputEvent event = WebInputEventTraits::Clone(*std::get<0>(params));
ui::LatencyInfo latency_info = std::get<1>(params);
InputEventDispatchType dispatch_type = std::get<2>(params);
DCHECK(event);
@@ -197,23 +197,29 @@ void InputEventFilter::ForwardToHandler(const IPC::Message& message) {
auto_reset_current_overscroll_params(
&current_overscroll_params_, send_ack ? &overscroll_params : NULL);
- InputEventAckState ack_state = handler_.Run(routing_id, event, &latency_info);
+ InputEventAckState ack_state =
+ handler_.Run(routing_id, event.get(), &latency_info);
+
+ uint32_t unique_touch_event_id =
+ WebInputEventTraits::GetUniqueTouchEventId(*event);
+ WebInputEvent::Type type = event->type;
if (ack_state == INPUT_EVENT_ACK_STATE_SET_NON_BLOCKING ||
ack_state == INPUT_EVENT_ACK_STATE_NOT_CONSUMED) {
DCHECK(!overscroll_params);
RouteQueueMap::iterator iter = route_queues_.find(routing_id);
- if (iter != route_queues_.end())
- send_ack &= iter->second->HandleEvent(event, latency_info, dispatch_type,
- ack_state);
+ if (iter != route_queues_.end()) {
+ send_ack &= iter->second->HandleEvent(std::move(event), latency_info,
+ dispatch_type, ack_state);
+ }
}
+ event.reset();
if (!send_ack)
return;
- InputEventAck ack(event->type, ack_state, latency_info,
- std::move(overscroll_params),
- WebInputEventTraits::GetUniqueTouchEventId(*event));
+ InputEventAck ack(type, ack_state, latency_info, std::move(overscroll_params),
+ unique_touch_event_id);
SendMessage(std::unique_ptr<IPC::Message>(
new InputHostMsg_HandleInputEvent_ACK(routing_id, ack)));
}
« no previous file with comments | « content/common/input/event_with_latency_info.cc ('k') | content/renderer/input/main_thread_event_queue.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698