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

Side by Side Diff: content/renderer/input/render_widget_input_handler.cc

Issue 2162143002: Don't use PostTask queueing between compositor and main thread. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Don't ack mouse move right away send them unthrottled Created 4 years, 5 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/input/render_widget_input_handler.h" 5 #include "content/renderer/input/render_widget_input_handler.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after
413 if (rate_limiting_wanted && !start_time.is_null()) { 413 if (rate_limiting_wanted && !start_time.is_null()) {
414 base::TimeTicks end_time = base::TimeTicks::Now(); 414 base::TimeTicks end_time = base::TimeTicks::Now();
415 total_input_handling_time_this_frame_ += (end_time - start_time); 415 total_input_handling_time_this_frame_ += (end_time - start_time);
416 rate_limiting_wanted = 416 rate_limiting_wanted =
417 total_input_handling_time_this_frame_.InMicroseconds() > 417 total_input_handling_time_this_frame_.InMicroseconds() >
418 kInputHandlingTimeThrottlingThresholdMicroseconds; 418 kInputHandlingTimeThrottlingThresholdMicroseconds;
419 } 419 }
420 420
421 TRACE_EVENT_SYNTHETIC_DELAY_END("blink.HandleInputEvent"); 421 TRACE_EVENT_SYNTHETIC_DELAY_END("blink.HandleInputEvent");
422 422
423 // Note that we can't use handling_event_type_ here since it will be overriden 423 // Note that we can't use handling_event_type_ here since it will be overriden
tdresser 2016/07/20 20:52:28 While you're here, could you fix overriden -> over
424 // by reentrant calls for events after the paused one. 424 // by reentrant calls for events after the paused one.
425 bool can_send_ack = !(ignore_ack_for_mouse_move_from_debugger_ && 425 bool can_send_ack = !(ignore_ack_for_mouse_move_from_debugger_ &&
426 input_event.type == WebInputEvent::MouseMove); 426 input_event.type == WebInputEvent::MouseMove);
427 if (dispatch_type == DISPATCH_TYPE_BLOCKING_NOTIFY_MAIN || 427 if (dispatch_type == DISPATCH_TYPE_BLOCKING_NOTIFY_MAIN) {
428 dispatch_type == DISPATCH_TYPE_NON_BLOCKING_NOTIFY_MAIN) {
429 // |non_blocking| means it was ack'd already by the InputHandlerProxy 428 // |non_blocking| means it was ack'd already by the InputHandlerProxy
430 // so let the delegate know the event has been handled. 429 // so let the delegate know the event has been handled.
431 delegate_->NotifyInputEventHandled(input_event.type, ack_result); 430 delegate_->NotifyInputEventHandled(input_event.type, ack_result);
432 } 431 }
433 432
434 if ((dispatch_type == DISPATCH_TYPE_BLOCKING || 433 if ((dispatch_type == DISPATCH_TYPE_BLOCKING ||
435 dispatch_type == DISPATCH_TYPE_BLOCKING_NOTIFY_MAIN) && 434 dispatch_type == DISPATCH_TYPE_BLOCKING_NOTIFY_MAIN) &&
436 can_send_ack) { 435 can_send_ack) {
437 std::unique_ptr<InputEventAck> response(new InputEventAck( 436 std::unique_ptr<InputEventAck> response(new InputEventAck(
438 input_event.type, ack_result, swap_latency_info, 437 input_event.type, ack_result, swap_latency_info,
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
555 if (pending_input_event_ack_) { 554 if (pending_input_event_ack_) {
556 TRACE_EVENT_ASYNC_END0("input", 555 TRACE_EVENT_ASYNC_END0("input",
557 "RenderWidgetInputHandler::ThrottledInputEventAck", 556 "RenderWidgetInputHandler::ThrottledInputEventAck",
558 pending_input_event_ack_.get()); 557 pending_input_event_ack_.get());
559 delegate_->OnInputEventAck(std::move(pending_input_event_ack_)); 558 delegate_->OnInputEventAck(std::move(pending_input_event_ack_));
560 } 559 }
561 total_input_handling_time_this_frame_ = base::TimeDelta(); 560 total_input_handling_time_this_frame_ = base::TimeDelta();
562 } 561 }
563 562
564 } // namespace content 563 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698