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

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

Issue 1877073003: Respect the order of input messages from browser to renderer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 4 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
Index: content/renderer/input/input_handler_manager.cc
diff --git a/content/renderer/input/input_handler_manager.cc b/content/renderer/input/input_handler_manager.cc
index b6deb4c0b187c2064f916160e10aa46aff04cebb..52df5f63931de3c502e1d0117c71d59e6927c67a 100644
--- a/content/renderer/input/input_handler_manager.cc
+++ b/content/renderer/input/input_handler_manager.cc
@@ -107,7 +107,7 @@ void InputHandlerManager::AddInputHandlerOnCompositorThread(
std::unique_ptr<InputHandlerWrapper> wrapper(new InputHandlerWrapper(
this, routing_id, main_task_runner, input_handler, render_view_impl,
enable_smooth_scrolling, enable_wheel_gestures));
- client_->DidAddInputHandler(routing_id);
+ client_->RegisterRoutingID(routing_id);
if (synchronous_handler_proxy_client_) {
synchronous_handler_proxy_client_->DidAddSynchronousHandlerProxy(
routing_id, wrapper->input_handler_proxy());
@@ -121,7 +121,7 @@ void InputHandlerManager::RemoveInputHandler(int routing_id) {
TRACE_EVENT0("input", "InputHandlerManager::RemoveInputHandler");
- client_->DidRemoveInputHandler(routing_id);
+ client_->UnregisterRoutingID(routing_id);
if (synchronous_handler_proxy_client_) {
synchronous_handler_proxy_client_->DidRemoveSynchronousHandlerProxy(
routing_id);
@@ -129,6 +129,21 @@ void InputHandlerManager::RemoveInputHandler(int routing_id) {
input_handlers_.erase(routing_id);
}
+void InputHandlerManager::RegisterRoutingID(int routing_id) {
+ if (task_runner_->BelongsToCurrentThread()) {
+ RegisterRoutingIDOnCompositorThread(routing_id);
+ } else {
+ task_runner_->PostTask(
+ FROM_HERE,
+ base::Bind(&InputHandlerManager::RegisterRoutingIDOnCompositorThread,
+ base::Unretained(this), routing_id));
+ }
+}
+
+void InputHandlerManager::RegisterRoutingIDOnCompositorThread(int routing_id) {
+ client_->RegisterRoutingID(routing_id);
+}
+
void InputHandlerManager::ObserveWheelEventAndResultOnMainThread(
int routing_id,
const blink::WebMouseWheelEvent& wheel_event,

Powered by Google App Engine
This is Rietveld 408576698