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

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

Issue 19670007: Send input event's LatencyInfo back from renderer to browser when acked (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: fix compile error in immediate_input_router_unittest.cc Created 7 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/renderer/gpu/input_event_filter.h ('k') | content/renderer/gpu/input_event_filter_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/gpu/input_event_filter.cc
diff --git a/content/renderer/gpu/input_event_filter.cc b/content/renderer/gpu/input_event_filter.cc
index f9b9015289b69cfc669d7c0bb6f22f52bf098636..208c47180f9c9dc26f86ce9f7bfe1a341aedda13 100644
--- a/content/renderer/gpu/input_event_filter.cc
+++ b/content/renderer/gpu/input_event_filter.cc
@@ -103,20 +103,6 @@ bool InputEventFilter::OnMessageReceived(const IPC::Message& message) {
return true;
}
-// static
-const WebInputEvent* InputEventFilter::CrackMessage(
- const IPC::Message& message,
- ui::LatencyInfo* latency_info) {
- DCHECK(message.type() == InputMsg_HandleInputEvent::ID);
-
- PickleIterator iter(message);
- const WebInputEvent* event = NULL;
- IPC::ParamTraits<IPC::WebInputEventPointer>::Read(&message, &iter, &event);
- if (latency_info)
- IPC::ParamTraits<ui::LatencyInfo>::Read(&message, &iter, latency_info);
- return event;
-}
-
InputEventFilter::~InputEventFilter() {
}
@@ -136,35 +122,43 @@ void InputEventFilter::ForwardToHandler(const IPC::Message& message) {
return;
}
+ int routing_id = message.routing_id();
ui::LatencyInfo latency_info;
- const WebInputEvent* event = CrackMessage(message, &latency_info);
+ const WebInputEvent* event = NULL;
+ bool is_keyboard_shortcut;
+ if (!InputMsg_HandleInputEvent::Read(
+ &message, &event, &latency_info, &is_keyboard_shortcut))
+ return;
+ DCHECK(event);
InputEventAckState ack =
- handler_.Run(message.routing_id(), event, latency_info);
+ handler_.Run(routing_id, event, latency_info);
if (ack == INPUT_EVENT_ACK_STATE_NOT_CONSUMED) {
TRACE_EVENT0("input", "InputEventFilter::ForwardToHandler");
+ IPC::Message new_msg = InputMsg_HandleInputEvent(
+ routing_id, event, latency_info, is_keyboard_shortcut);
main_loop_->PostTask(
FROM_HERE,
base::Bind(&InputEventFilter::ForwardToMainListener,
- this, message));
+ this, new_msg));
return;
}
- SendACK(message, ack);
+ SendACK(event->type, ack, latency_info, routing_id);
}
-void InputEventFilter::SendACK(const IPC::Message& message,
- InputEventAckState ack_result) {
+void InputEventFilter::SendACK(WebKit::WebInputEvent::Type type,
+ InputEventAckState ack_result,
+ const ui::LatencyInfo& latency_info,
+ int routing_id) {
DCHECK(target_loop_->BelongsToCurrentThread());
io_loop_->PostTask(
FROM_HERE,
base::Bind(&InputEventFilter::SendMessageOnIOThread, this,
InputHostMsg_HandleInputEvent_ACK(
- message.routing_id(),
- CrackMessage(message, NULL)->type,
- ack_result)));
+ routing_id, type, ack_result, latency_info)));
}
void InputEventFilter::SendMessageOnIOThread(const IPC::Message& message) {
« no previous file with comments | « content/renderer/gpu/input_event_filter.h ('k') | content/renderer/gpu/input_event_filter_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698