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

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

Issue 15920002: Fix WebView compositor input handling (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Code review and rebase Created 7 years, 6 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
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 9085c156922c6d4c4b2ba18c7d854478d597e98b..5b2d0d4ef597eda40837150b34c52ce4ca0d4489 100644
--- a/content/renderer/gpu/input_event_filter.cc
+++ b/content/renderer/gpu/input_event_filter.cc
@@ -8,6 +8,7 @@
#include "base/message_loop_proxy.h"
#include "content/common/input_messages.h"
#include "content/renderer/gpu/input_event_filter.h"
+#include "ipc/ipc_sync_channel.h"
using WebKit::WebInputEvent;
@@ -15,23 +16,25 @@ namespace content {
InputEventFilter::InputEventFilter(
IPC::Listener* main_listener,
- const scoped_refptr<base::MessageLoopProxy>& target_loop,
- const Handler& handler)
+ const scoped_refptr<base::MessageLoopProxy>& target_loop)
: main_loop_(base::MessageLoopProxy::current()),
main_listener_(main_listener),
sender_(NULL),
- target_loop_(target_loop),
- handler_(handler) {
- DCHECK(target_loop_.get());
- DCHECK(!handler_.is_null());
+ target_loop_(target_loop) {
+ DCHECK(target_loop_);
+}
+
+void InputEventFilter::SetBoundHandler(const Handler& handler) {
+ DCHECK(main_loop_->BelongsToCurrentThread());
+ handler_ = handler;
}
-void InputEventFilter::AddRoute(int routing_id) {
+void InputEventFilter::DidAddInputHandler(int routing_id) {
base::AutoLock locked(routes_lock_);
routes_.insert(routing_id);
}
-void InputEventFilter::RemoveRoute(int routing_id) {
+void InputEventFilter::DidRemoveInputHandler(int routing_id) {
base::AutoLock locked(routes_lock_);
routes_.erase(routing_id);
}
@@ -93,6 +96,7 @@ void InputEventFilter::ForwardToMainListener(const IPC::Message& message) {
}
void InputEventFilter::ForwardToHandler(const IPC::Message& message) {
+ DCHECK(!handler_.is_null());
DCHECK(target_loop_->BelongsToCurrentThread());
if (message.type() != InputMsg_HandleInputEvent::ID) {
@@ -104,7 +108,7 @@ void InputEventFilter::ForwardToHandler(const IPC::Message& message) {
}
InputEventAckState ack = handler_.Run(message.routing_id(),
- CrackMessage(message));
+ *CrackMessage(message));
if (ack == INPUT_EVENT_ACK_STATE_NOT_CONSUMED) {
TRACE_EVENT0("InputEventFilter::DidNotHandleInputEvent",

Powered by Google App Engine
This is Rietveld 408576698