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 1205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1216 | 1216 |
1217 // Note that we can't use handling_event_type_ here since it will be overriden | 1217 // Note that we can't use handling_event_type_ here since it will be overriden |
1218 // by reentrant calls for events after the paused one. | 1218 // by reentrant calls for events after the paused one. |
1219 bool no_ack = ignore_ack_for_mouse_move_from_debugger_ && | 1219 bool no_ack = ignore_ack_for_mouse_move_from_debugger_ && |
1220 input_event->type == WebInputEvent::MouseMove; | 1220 input_event->type == WebInputEvent::MouseMove; |
1221 if (!WebInputEventTraits::IgnoresAckDisposition(*input_event) && !no_ack) { | 1221 if (!WebInputEventTraits::IgnoresAckDisposition(*input_event) && !no_ack) { |
1222 InputHostMsg_HandleInputEvent_ACK_Params ack; | 1222 InputHostMsg_HandleInputEvent_ACK_Params ack; |
1223 ack.type = input_event->type; | 1223 ack.type = input_event->type; |
1224 ack.state = ack_result; | 1224 ack.state = ack_result; |
1225 ack.latency = swap_latency_info; | 1225 ack.latency = swap_latency_info; |
| 1226 if (WebInputEvent::isTouchEventType(ack.type)) { |
| 1227 const blink::WebTouchEvent& touch = |
| 1228 static_cast<const blink::WebTouchEvent&>(*input_event); |
| 1229 DCHECK_NE(touch.uniqueTouchEventId, 0UL); |
| 1230 ack.unique_touch_event_id = touch.uniqueTouchEventId; |
| 1231 } |
1226 scoped_ptr<IPC::Message> response( | 1232 scoped_ptr<IPC::Message> response( |
1227 new InputHostMsg_HandleInputEvent_ACK(routing_id_, ack)); | 1233 new InputHostMsg_HandleInputEvent_ACK(routing_id_, ack)); |
1228 if (rate_limiting_wanted && frame_pending && !is_hidden_) { | 1234 if (rate_limiting_wanted && frame_pending && !is_hidden_) { |
1229 // We want to rate limit the input events in this case, so we'll wait for | 1235 // We want to rate limit the input events in this case, so we'll wait for |
1230 // painting to finish before ACKing this message. | 1236 // painting to finish before ACKing this message. |
1231 TRACE_EVENT_INSTANT0("renderer", | 1237 TRACE_EVENT_INSTANT0("renderer", |
1232 "RenderWidget::OnHandleInputEvent ack throttled", | 1238 "RenderWidget::OnHandleInputEvent ack throttled", |
1233 TRACE_EVENT_SCOPE_THREAD); | 1239 TRACE_EVENT_SCOPE_THREAD); |
1234 if (pending_input_event_ack_) { | 1240 if (pending_input_event_ack_) { |
1235 TRACE_EVENT_ASYNC_END0("input", "RenderWidget::ThrottledInputEventAck", | 1241 TRACE_EVENT_ASYNC_END0("input", "RenderWidget::ThrottledInputEventAck", |
(...skipping 1181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2417 void RenderWidget::RegisterVideoHoleFrame(RenderFrameImpl* frame) { | 2423 void RenderWidget::RegisterVideoHoleFrame(RenderFrameImpl* frame) { |
2418 video_hole_frames_.AddObserver(frame); | 2424 video_hole_frames_.AddObserver(frame); |
2419 } | 2425 } |
2420 | 2426 |
2421 void RenderWidget::UnregisterVideoHoleFrame(RenderFrameImpl* frame) { | 2427 void RenderWidget::UnregisterVideoHoleFrame(RenderFrameImpl* frame) { |
2422 video_hole_frames_.RemoveObserver(frame); | 2428 video_hole_frames_.RemoveObserver(frame); |
2423 } | 2429 } |
2424 #endif // defined(VIDEO_HOLE) | 2430 #endif // defined(VIDEO_HOLE) |
2425 | 2431 |
2426 } // namespace content | 2432 } // namespace content |
OLD | NEW |