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

Side by Side Diff: content/renderer/render_widget.cc

Issue 997283002: Coalesce async touch move events until the ack back from render (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use queue to store the IDs for sent async touchmove Created 5 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/render_widget.h" 5 #include "content/renderer/render_widget.h"
6 6
7 #include "base/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 1221 matching lines...) Expand 10 before | Expand all | Expand 10 after
1232 total_input_handling_time_this_frame_.InMicroseconds() > 1232 total_input_handling_time_this_frame_.InMicroseconds() >
1233 kInputHandlingTimeThrottlingThresholdMicroseconds; 1233 kInputHandlingTimeThrottlingThresholdMicroseconds;
1234 } 1234 }
1235 1235
1236 TRACE_EVENT_SYNTHETIC_DELAY_END("blink.HandleInputEvent"); 1236 TRACE_EVENT_SYNTHETIC_DELAY_END("blink.HandleInputEvent");
1237 1237
1238 // Note that we can't use handling_event_type_ here since it will be overriden 1238 // Note that we can't use handling_event_type_ here since it will be overriden
1239 // by reentrant calls for events after the paused one. 1239 // by reentrant calls for events after the paused one.
1240 bool no_ack = ignore_ack_for_mouse_move_from_debugger_ && 1240 bool no_ack = ignore_ack_for_mouse_move_from_debugger_ &&
1241 input_event->type == WebInputEvent::MouseMove; 1241 input_event->type == WebInputEvent::MouseMove;
1242 if (!WebInputEventTraits::IgnoresAckDisposition(*input_event) && !no_ack) { 1242 if (WebInputEventTraits::WillReceiveAckFromRenderer(*input_event) &&
1243 !no_ack) {
1243 InputHostMsg_HandleInputEvent_ACK_Params ack; 1244 InputHostMsg_HandleInputEvent_ACK_Params ack;
1244 ack.type = input_event->type; 1245 ack.type = input_event->type;
1245 ack.state = ack_result; 1246 ack.state = ack_result;
1246 ack.latency = swap_latency_info; 1247 ack.latency = swap_latency_info;
1248 ack.unique_touch_event_id =
1249 WebInputEventTraits::GetUniqueTouchEventId(*input_event);
1247 scoped_ptr<IPC::Message> response( 1250 scoped_ptr<IPC::Message> response(
1248 new InputHostMsg_HandleInputEvent_ACK(routing_id_, ack)); 1251 new InputHostMsg_HandleInputEvent_ACK(routing_id_, ack));
1249 if (rate_limiting_wanted && frame_pending && !is_hidden_) { 1252 if (rate_limiting_wanted && frame_pending && !is_hidden_) {
1250 // We want to rate limit the input events in this case, so we'll wait for 1253 // We want to rate limit the input events in this case, so we'll wait for
1251 // painting to finish before ACKing this message. 1254 // painting to finish before ACKing this message.
1252 TRACE_EVENT_INSTANT0("renderer", 1255 TRACE_EVENT_INSTANT0("renderer",
1253 "RenderWidget::OnHandleInputEvent ack throttled", 1256 "RenderWidget::OnHandleInputEvent ack throttled",
1254 TRACE_EVENT_SCOPE_THREAD); 1257 TRACE_EVENT_SCOPE_THREAD);
1255 if (pending_input_event_ack_) { 1258 if (pending_input_event_ack_) {
1256 TRACE_EVENT_ASYNC_END0("input", "RenderWidget::ThrottledInputEventAck", 1259 TRACE_EVENT_ASYNC_END0("input", "RenderWidget::ThrottledInputEventAck",
(...skipping 1183 matching lines...) Expand 10 before | Expand all | Expand 10 after
2440 void RenderWidget::RegisterVideoHoleFrame(RenderFrameImpl* frame) { 2443 void RenderWidget::RegisterVideoHoleFrame(RenderFrameImpl* frame) {
2441 video_hole_frames_.AddObserver(frame); 2444 video_hole_frames_.AddObserver(frame);
2442 } 2445 }
2443 2446
2444 void RenderWidget::UnregisterVideoHoleFrame(RenderFrameImpl* frame) { 2447 void RenderWidget::UnregisterVideoHoleFrame(RenderFrameImpl* frame) {
2445 video_hole_frames_.RemoveObserver(frame); 2448 video_hole_frames_.RemoveObserver(frame);
2446 } 2449 }
2447 #endif // defined(VIDEO_HOLE) 2450 #endif // defined(VIDEO_HOLE)
2448 2451
2449 } // namespace content 2452 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698