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

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

Issue 2479123003: WIP Add getCoalescedEvents API using vector of WebInputEvents (Closed)
Patch Set: Creating CoalescedWebInputEvent Created 4 years, 1 month 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 04fd216dd9224faf8cfb4f90ba7d362dfa7d65a9..722eb2ac223885d23ba0fd5420b078af623bb55e 100644
--- a/content/renderer/input/input_event_filter.cc
+++ b/content/renderer/input/input_event_filter.cc
@@ -96,7 +96,7 @@ void InputEventFilter::DidStopFlinging(int routing_id) {
void InputEventFilter::DispatchNonBlockingEventToMainThread(
int routing_id,
- ui::ScopedWebInputEvent event,
+ blink::CoalescedWebInputEvent::ScopedWebInputEvent event,
const ui::LatencyInfo& latency_info) {
DCHECK(target_task_runner_->BelongsToCurrentThread());
RouteQueueMap::iterator iter = route_queues_.find(routing_id);
@@ -209,20 +209,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::ScopedCoalescedWebInputEvent coalescedEvent(
+ new blink::CoalescedWebInputEvent(*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(coalescedEvent);
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));
};
@@ -231,7 +233,7 @@ void InputEventFilter::DidForwardToHandlerAndOverscroll(
int routing_id,
InputEventDispatchType dispatch_type,
InputEventAckState ack_state,
- ui::ScopedWebInputEvent event,
+ blink::ScopedCoalescedWebInputEvent event,
const ui::LatencyInfo& latency_info,
std::unique_ptr<DidOverscrollParams> overscroll_params) {
bool send_ack = dispatch_type == DISPATCH_TYPE_BLOCKING;
@@ -280,13 +282,14 @@ void InputEventFilter::SendMessageOnIOThread(
void InputEventFilter::HandleEventOnMainThread(
int routing_id,
- const blink::WebInputEvent* event,
+ const blink::CoalescedWebInputEvent* 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