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

Unified Diff: content/browser/devtools/protocol/input_handler.cc

Issue 2584193002: Revert of Delay Input.dispatchKeyEvent response until after key event ack. (Closed)
Patch Set: Created 4 years 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/browser/devtools/protocol/input_handler.cc
diff --git a/content/browser/devtools/protocol/input_handler.cc b/content/browser/devtools/protocol/input_handler.cc
index 1c0526f7555a60b828b707324e2a122ef210020e..b963044209c287436628372f8df442313c35867a 100644
--- a/content/browser/devtools/protocol/input_handler.cc
+++ b/content/browser/devtools/protocol/input_handler.cc
@@ -130,7 +130,6 @@
InputHandler::InputHandler()
: host_(NULL),
- input_queued_(false),
page_scale_factor_(1.0),
weak_factory_(this) {
}
@@ -138,30 +137,8 @@
InputHandler::~InputHandler() {
}
-void InputHandler::OnInputEvent(const blink::WebInputEvent& event) {
- input_queued_ = true;
-}
-
-void InputHandler::OnInputEventAck(const blink::WebInputEvent& event) {
- if (blink::WebInputEvent::isKeyboardEventType(event.type) &&
- !pending_key_command_ids_.empty()) {
- SendDispatchKeyEventResponse(pending_key_command_ids_.front());
- pending_key_command_ids_.pop_front();
- } else if (blink::WebInputEvent::isMouseEventType(event.type) &&
- !pending_mouse_command_ids_.empty()) {
- SendDispatchMouseEventResponse(pending_mouse_command_ids_.front());
- pending_mouse_command_ids_.pop_front();
- }
-}
-
void InputHandler::SetRenderWidgetHost(RenderWidgetHostImpl* host) {
- ClearPendingKeyCommands();
- ClearPendingMouseCommands();
- if (host_)
- host_->RemoveInputEventObserver(this);
host_ = host;
- if (host)
- host->AddInputEventObserver(this);
}
void InputHandler::SetClient(std::unique_ptr<Client> client) {
@@ -174,15 +151,7 @@
scrollable_viewport_size_ = frame_metadata.scrollable_viewport_size;
}
-void InputHandler::Detached() {
- ClearPendingKeyCommands();
- ClearPendingMouseCommands();
- if (host_)
- host_->RemoveInputEventObserver(this);
-}
-
Response InputHandler::DispatchKeyEvent(
- DevToolsCommandId command_id,
const std::string& type,
const int* modifiers,
const double* timestamp,
@@ -244,17 +213,11 @@
return Response::ServerError("Could not connect to view");
host_->Focus();
- input_queued_ = false;
host_->ForwardKeyboardEvent(event);
- if (input_queued_)
- pending_key_command_ids_.push_back(command_id);
- else
- SendDispatchKeyEventResponse(command_id);
return Response::OK();
}
Response InputHandler::DispatchMouseEvent(
- DevToolsCommandId command_id,
const std::string& type,
int x,
int y,
@@ -286,12 +249,7 @@
return Response::ServerError("Could not connect to view");
host_->Focus();
- input_queued_ = false;
host_->ForwardMouseEvent(event);
- if (input_queued_)
- pending_mouse_command_ids_.push_back(command_id);
- else
- SendDispatchMouseEventResponse(command_id);
return Response::OK();
}
@@ -521,17 +479,6 @@
return Response::FallThrough();
}
-void InputHandler::SendDispatchKeyEventResponse(DevToolsCommandId command_id) {
- client_->SendDispatchKeyEventResponse(
- command_id, DispatchKeyEventResponse::Create());
-}
-
-void InputHandler::SendDispatchMouseEventResponse(
- DevToolsCommandId command_id) {
- client_->SendDispatchMouseEventResponse(
- command_id, DispatchMouseEventResponse::Create());
-}
-
void InputHandler::SendSynthesizePinchGestureResponse(
DevToolsCommandId command_id,
SyntheticGesture::Result result) {
@@ -574,18 +521,6 @@
}
}
-void InputHandler::ClearPendingKeyCommands() {
- for (const DevToolsCommandId& command_id : pending_key_command_ids_)
- SendDispatchKeyEventResponse(command_id);
- pending_key_command_ids_.clear();
-}
-
-void InputHandler::ClearPendingMouseCommands() {
- for (const DevToolsCommandId& command_id : pending_mouse_command_ids_)
- SendDispatchMouseEventResponse(command_id);
- pending_mouse_command_ids_.clear();
-}
-
} // namespace input
} // namespace devtools
} // namespace content
« no previous file with comments | « content/browser/devtools/protocol/input_handler.h ('k') | content/browser/devtools/render_frame_devtools_agent_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698