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

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

Issue 2576013002: Introducing WebCoalescedInputEvent and inclusion in content/common (Closed)
Patch Set: Created 4 years 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
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 23dcbc093661de711dbf732d99105ec8cc99d3cd..9effd307326d28b00dd915ca31c0d1e4e4fe167e 100644
--- a/content/renderer/input/input_event_filter.cc
+++ b/content/renderer/input/input_event_filter.cc
@@ -97,7 +97,7 @@ void InputEventFilter::DidStopFlinging(int routing_id) {
void InputEventFilter::DispatchNonBlockingEventToMainThread(
int routing_id,
- ui::ScopedWebInputEvent event,
+ blink::WebCoalescedInputEvent::ScopedWebInputEvent event,
const ui::LatencyInfo& latency_info) {
DCHECK(target_task_runner_->BelongsToCurrentThread());
RouteQueueMap::iterator iter = route_queues_.find(routing_id);
@@ -210,20 +210,22 @@ void InputEventFilter::ForwardToHandler(const IPC::Message& message,
InputMsg_HandleInputEvent::Param params;
if (!InputMsg_HandleInputEvent::Read(&message, &params))
return;
- ui::ScopedWebInputEvent event =
- ui::WebInputEventTraits::Clone(*std::get<0>(params));
- ui::LatencyInfo latency_info = std::get<1>(params);
- InputEventDispatchType dispatch_type = std::get<2>(params);
+ blink::ScopedWebCoalescedInputEvent coalescedEvent(
+ new blink::WebCoalescedInputEvent(*std::get<0>(params),
+ std::get<1>(params)));
+ ui::LatencyInfo latency_info = std::get<2>(params);
+ InputEventDispatchType dispatch_type = std::get<3>(params);
DCHECK(event);
DCHECK(dispatch_type == DISPATCH_TYPE_BLOCKING ||
dispatch_type == DISPATCH_TYPE_NON_BLOCKING);
if (!received_time.is_null())
- event->timeStampSeconds = ui::EventTimeStampToSeconds(received_time);
+ coalescedEvent->eventPointer()->timeStampSeconds =
+ ui::EventTimeStampToSeconds(received_time);
input_handler_manager_->HandleInputEvent(
- routing_id, std::move(event), latency_info,
+ routing_id, std::move(coalescedEvent), latency_info,
base::Bind(&InputEventFilter::DidForwardToHandlerAndOverscroll, this,
routing_id, dispatch_type));
};
@@ -232,7 +234,7 @@ void InputEventFilter::DidForwardToHandlerAndOverscroll(
int routing_id,
InputEventDispatchType dispatch_type,
InputEventAckState ack_state,
- ui::ScopedWebInputEvent event,
+ blink::WebCoalescedInputEvent::ScopedWebInputEvent event,
const ui::LatencyInfo& latency_info,
std::unique_ptr<DidOverscrollParams> overscroll_params) {
bool send_ack = dispatch_type == DISPATCH_TYPE_BLOCKING;
@@ -287,13 +289,14 @@ void InputEventFilter::SendMessageOnIOThread(
void InputEventFilter::HandleEventOnMainThread(
int routing_id,
- const blink::WebInputEvent* event,
+ const blink::WebCoalescedInputEvent* event,
const ui::LatencyInfo& latency_info,
InputEventDispatchType dispatch_type) {
TRACE_EVENT_INSTANT0("input", "InputEventFilter::HandlEventOnMainThread",
TRACE_EVENT_SCOPE_THREAD);
- IPC::Message new_msg =
- InputMsg_HandleInputEvent(routing_id, event, latency_info, dispatch_type);
+ IPC::Message new_msg = InputMsg_HandleInputEvent(
+ routing_id, event->eventPointer(), event->getCoalescedEventsPointers(),
+ latency_info, dispatch_type);
main_listener_.Run(new_msg);
}

Powered by Google App Engine
This is Rietveld 408576698