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

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: moved DCHECK inside if scope Created 4 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/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..80994dd5f764b1c2b871a3c058ac4d4b11d7a373 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,37 @@ 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) {
no sievers 2016/06/10 19:58:30 nit: DCHECK(task_runner_->BelongsToCurrentThread(
Changwan Ryu 2016/06/13 01:20:59 Done.
+ client_->RegisterRoutingID(routing_id);
+}
+
+void InputHandlerManager::UnregisterRoutingID(int routing_id) {
+ if (task_runner_->BelongsToCurrentThread()) {
+ UnregisterRoutingIDOnCompositorThread(routing_id);
+ } else {
+ task_runner_->PostTask(
+ FROM_HERE,
+ base::Bind(&InputHandlerManager::UnregisterRoutingIDOnCompositorThread,
+ base::Unretained(this), routing_id));
+ }
+}
+
+void InputHandlerManager::UnregisterRoutingIDOnCompositorThread(
+ int routing_id) {
+ client_->UnregisterRoutingID(routing_id);
no sievers 2016/06/10 19:58:30 nit: DCHECK(task_runner_->BelongsToCurrentThread(
Changwan Ryu 2016/06/13 01:20:59 Done.
+}
+
void InputHandlerManager::ObserveWheelEventAndResultOnMainThread(
int routing_id,
const blink::WebMouseWheelEvent& wheel_event,
« no previous file with comments | « content/renderer/input/input_handler_manager.h ('k') | content/renderer/input/input_handler_manager_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698