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

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

Issue 15927023: Explicit interface for synchronous InputHandlerProxy input handling (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Shorter names ftw Created 7 years, 7 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 9488963ac78bf8e013bf4334544c276da0d10e46..9085c156922c6d4c4b2ba18c7d854478d597e98b 100644
--- a/content/renderer/gpu/input_event_filter.cc
+++ b/content/renderer/gpu/input_event_filter.cc
@@ -36,31 +36,6 @@ void InputEventFilter::RemoveRoute(int routing_id) {
routes_.erase(routing_id);
}
-void InputEventFilter::DidHandleInputEvent() {
- DCHECK(target_loop_->BelongsToCurrentThread());
-
- SendACK(messages_.front(), INPUT_EVENT_ACK_STATE_CONSUMED);
- messages_.pop();
-}
-
-void InputEventFilter::DidNotHandleInputEvent(bool send_to_widget) {
- DCHECK(target_loop_->BelongsToCurrentThread());
-
- if (send_to_widget) {
- // Forward to the renderer thread, and dispatch the message there.
- TRACE_EVENT0("InputEventFilter::DidNotHandleInputEvent",
- "ForwardToRenderThread");
- main_loop_->PostTask(
- FROM_HERE,
- base::Bind(&InputEventFilter::ForwardToMainListener,
- this, messages_.front()));
- } else {
- TRACE_EVENT0("InputEventFilter::DidNotHandleInputEvent", "LeaveUnhandled");
- SendACK(messages_.front(), INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS);
- }
- messages_.pop();
-}
-
void InputEventFilter::OnFilterAdded(IPC::Channel* channel) {
io_loop_ = base::MessageLoopProxy::current();
sender_ = channel;
@@ -128,15 +103,20 @@ void InputEventFilter::ForwardToHandler(const IPC::Message& message) {
return;
}
- // Save this message for later, in case we need to bounce it back up to the
- // main listener.
- //
- // TODO(darin): Change RenderWidgetHost to always require an ACK before
- // sending the next input event. This way we can nuke this queue.
- //
- messages_.push(message);
+ InputEventAckState ack = handler_.Run(message.routing_id(),
+ CrackMessage(message));
+
+ if (ack == INPUT_EVENT_ACK_STATE_NOT_CONSUMED) {
+ TRACE_EVENT0("InputEventFilter::DidNotHandleInputEvent",
+ "ForwardToRenderThread");
+ main_loop_->PostTask(
+ FROM_HERE,
+ base::Bind(&InputEventFilter::ForwardToMainListener,
+ this, message));
+ return;
+ }
- handler_.Run(message.routing_id(), CrackMessage(message));
+ SendACK(message, ack);
}
void InputEventFilter::SendACK(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