| OLD | NEW |
| 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 1207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1218 total_input_handling_time_this_frame_.InMicroseconds() > | 1218 total_input_handling_time_this_frame_.InMicroseconds() > |
| 1219 kInputHandlingTimeThrottlingThresholdMicroseconds; | 1219 kInputHandlingTimeThrottlingThresholdMicroseconds; |
| 1220 } | 1220 } |
| 1221 | 1221 |
| 1222 TRACE_EVENT_SYNTHETIC_DELAY_END("blink.HandleInputEvent"); | 1222 TRACE_EVENT_SYNTHETIC_DELAY_END("blink.HandleInputEvent"); |
| 1223 | 1223 |
| 1224 // Note that we can't use handling_event_type_ here since it will be overriden | 1224 // Note that we can't use handling_event_type_ here since it will be overriden |
| 1225 // by reentrant calls for events after the paused one. | 1225 // by reentrant calls for events after the paused one. |
| 1226 bool no_ack = ignore_ack_for_mouse_move_from_debugger_ && | 1226 bool no_ack = ignore_ack_for_mouse_move_from_debugger_ && |
| 1227 input_event->type == WebInputEvent::MouseMove; | 1227 input_event->type == WebInputEvent::MouseMove; |
| 1228 if (!WebInputEventTraits::IgnoresAckDisposition(*input_event) && !no_ack) { | 1228 scoped_ptr<IPC::Message> response = WebInputEventTraits::CreateAckIfNecessary( |
| 1229 InputHostMsg_HandleInputEvent_ACK_Params ack; | 1229 *input_event, ack_result, swap_latency_info, NULL, routing_id_); |
| 1230 ack.type = input_event->type; | 1230 |
| 1231 ack.state = ack_result; | 1231 if (!no_ack && response) { |
| 1232 ack.latency = swap_latency_info; | |
| 1233 scoped_ptr<IPC::Message> response( | |
| 1234 new InputHostMsg_HandleInputEvent_ACK(routing_id_, ack)); | |
| 1235 if (rate_limiting_wanted && frame_pending && !is_hidden_) { | 1232 if (rate_limiting_wanted && frame_pending && !is_hidden_) { |
| 1236 // We want to rate limit the input events in this case, so we'll wait for | 1233 // We want to rate limit the input events in this case, so we'll wait for |
| 1237 // painting to finish before ACKing this message. | 1234 // painting to finish before ACKing this message. |
| 1238 TRACE_EVENT_INSTANT0("renderer", | 1235 TRACE_EVENT_INSTANT0("renderer", |
| 1239 "RenderWidget::OnHandleInputEvent ack throttled", | 1236 "RenderWidget::OnHandleInputEvent ack throttled", |
| 1240 TRACE_EVENT_SCOPE_THREAD); | 1237 TRACE_EVENT_SCOPE_THREAD); |
| 1241 if (pending_input_event_ack_) { | 1238 if (pending_input_event_ack_) { |
| 1242 TRACE_EVENT_ASYNC_END0("input", "RenderWidget::ThrottledInputEventAck", | 1239 TRACE_EVENT_ASYNC_END0("input", "RenderWidget::ThrottledInputEventAck", |
| 1243 pending_input_event_ack_.get()); | 1240 pending_input_event_ack_.get()); |
| 1244 // As two different kinds of events could cause us to postpone an ack | 1241 // As two different kinds of events could cause us to postpone an ack |
| (...skipping 1183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2428 void RenderWidget::RegisterVideoHoleFrame(RenderFrameImpl* frame) { | 2425 void RenderWidget::RegisterVideoHoleFrame(RenderFrameImpl* frame) { |
| 2429 video_hole_frames_.AddObserver(frame); | 2426 video_hole_frames_.AddObserver(frame); |
| 2430 } | 2427 } |
| 2431 | 2428 |
| 2432 void RenderWidget::UnregisterVideoHoleFrame(RenderFrameImpl* frame) { | 2429 void RenderWidget::UnregisterVideoHoleFrame(RenderFrameImpl* frame) { |
| 2433 video_hole_frames_.RemoveObserver(frame); | 2430 video_hole_frames_.RemoveObserver(frame); |
| 2434 } | 2431 } |
| 2435 #endif // defined(VIDEO_HOLE) | 2432 #endif // defined(VIDEO_HOLE) |
| 2436 | 2433 |
| 2437 } // namespace content | 2434 } // namespace content |
| OLD | NEW |