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

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

Issue 1780953003: Change the non-blocking event queue to the main thread event queue. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master_wheel_regression_5
Patch Set: Fix android Created 4 years, 9 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/render_widget_input_handler.cc
diff --git a/content/renderer/input/render_widget_input_handler.cc b/content/renderer/input/render_widget_input_handler.cc
index 6a0a652a335b31889ffe318323b2789e66718a7b..90734376315caa0fa148ce2776a0c0d4f099d40b 100644
--- a/content/renderer/input/render_widget_input_handler.cc
+++ b/content/renderer/input/render_widget_input_handler.cc
@@ -306,6 +306,8 @@ void RenderWidgetInputHandler::HandleInputEvent(
}
bool non_blocking =
+ dispatch_type ==
+ InputEventDispatchType::DISPATCH_TYPE_NON_BLOCKING_NOTIFY_MAIN ||
dispatch_type == InputEventDispatchType::DISPATCH_TYPE_NON_BLOCKING;
// TODO(dtapuska): Use the input_event.timeStampSeconds as the start
// ideally this should be when the event was sent by the compositor to the
@@ -397,14 +399,18 @@ void RenderWidgetInputHandler::HandleInputEvent(
// Note that we can't use handling_event_type_ here since it will be overriden
// by reentrant calls for events after the paused one.
- bool no_ack = ignore_ack_for_mouse_move_from_debugger_ &&
- input_event.type == WebInputEvent::MouseMove;
- if (non_blocking) {
+ bool can_send_ack = !(ignore_ack_for_mouse_move_from_debugger_ &&
+ input_event.type == WebInputEvent::MouseMove);
+ if (dispatch_type == DISPATCH_TYPE_BLOCKING_NOTIFY_MAIN ||
+ dispatch_type == DISPATCH_TYPE_NON_BLOCKING_NOTIFY_MAIN) {
// |non_blocking| means it was ack'd already by the InputHandlerProxy
// so let the delegate know the event has been handled.
- delegate_->NonBlockingInputEventHandled(input_event.type);
- } else if (WebInputEventTraits::WillReceiveAckFromRenderer(input_event) &&
- !no_ack) {
+ delegate_->NotifyInputEventHandled(input_event.type);
+ }
+
+ if ((dispatch_type == DISPATCH_TYPE_BLOCKING ||
+ dispatch_type == DISPATCH_TYPE_BLOCKING_NOTIFY_MAIN) &&
+ can_send_ack) {
scoped_ptr<InputEventAck> response(new InputEventAck(
input_event.type, ack_result, swap_latency_info,
std::move(event_overscroll),
@@ -437,7 +443,7 @@ void RenderWidgetInputHandler::HandleInputEvent(
} else {
DCHECK(!event_overscroll) << "Unexpected overscroll for un-acked event";
}
- if (!no_ack && RenderThreadImpl::current()) {
+ if (can_send_ack && RenderThreadImpl::current()) {
RenderThreadImpl::current()
->GetRendererScheduler()
->DidHandleInputEventOnMainThread(input_event);

Powered by Google App Engine
This is Rietveld 408576698