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/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "base/debug/trace_event_synthetic_delay.h" | 10 #include "base/debug/trace_event_synthetic_delay.h" |
(...skipping 1044 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1055 base::TimeTicks end_time = base::TimeTicks::HighResNow(); | 1055 base::TimeTicks end_time = base::TimeTicks::HighResNow(); |
1056 total_input_handling_time_this_frame_ += (end_time - start_time); | 1056 total_input_handling_time_this_frame_ += (end_time - start_time); |
1057 rate_limiting_wanted = | 1057 rate_limiting_wanted = |
1058 total_input_handling_time_this_frame_.InMicroseconds() > | 1058 total_input_handling_time_this_frame_.InMicroseconds() > |
1059 kInputHandlingTimeThrottlingThresholdMicroseconds; | 1059 kInputHandlingTimeThrottlingThresholdMicroseconds; |
1060 } | 1060 } |
1061 | 1061 |
1062 TRACE_EVENT_SYNTHETIC_DELAY_END("blink.HandleInputEvent"); | 1062 TRACE_EVENT_SYNTHETIC_DELAY_END("blink.HandleInputEvent"); |
1063 | 1063 |
1064 if (!WebInputEventTraits::IgnoresAckDisposition(*input_event)) { | 1064 if (!WebInputEventTraits::IgnoresAckDisposition(*input_event)) { |
| 1065 InputEventAck ack; |
| 1066 ack.type = input_event->type; |
| 1067 ack.state = ack_result; |
| 1068 ack.latency = swap_latency_info; |
1065 scoped_ptr<IPC::Message> response( | 1069 scoped_ptr<IPC::Message> response( |
1066 new InputHostMsg_HandleInputEvent_ACK(routing_id_, | 1070 new InputHostMsg_HandleInputEvent_ACK(routing_id_, ack)); |
1067 input_event->type, | |
1068 ack_result, | |
1069 swap_latency_info)); | |
1070 if (rate_limiting_wanted && event_type_can_be_rate_limited && | 1071 if (rate_limiting_wanted && event_type_can_be_rate_limited && |
1071 frame_pending && !is_hidden_) { | 1072 frame_pending && !is_hidden_) { |
1072 // We want to rate limit the input events in this case, so we'll wait for | 1073 // We want to rate limit the input events in this case, so we'll wait for |
1073 // painting to finish before ACKing this message. | 1074 // painting to finish before ACKing this message. |
1074 TRACE_EVENT_INSTANT0("renderer", | 1075 TRACE_EVENT_INSTANT0("renderer", |
1075 "RenderWidget::OnHandleInputEvent ack throttled", | 1076 "RenderWidget::OnHandleInputEvent ack throttled", |
1076 TRACE_EVENT_SCOPE_THREAD); | 1077 TRACE_EVENT_SCOPE_THREAD); |
1077 if (pending_input_event_ack_) { | 1078 if (pending_input_event_ack_) { |
1078 // As two different kinds of events could cause us to postpone an ack | 1079 // As two different kinds of events could cause us to postpone an ack |
1079 // we send it now, if we have one pending. The Browser should never | 1080 // we send it now, if we have one pending. The Browser should never |
(...skipping 1027 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2107 | 2108 |
2108 void RenderWidget::RegisterSwappedOutChildFrame(RenderFrameImpl* frame) { | 2109 void RenderWidget::RegisterSwappedOutChildFrame(RenderFrameImpl* frame) { |
2109 swapped_out_frames_.AddObserver(frame); | 2110 swapped_out_frames_.AddObserver(frame); |
2110 } | 2111 } |
2111 | 2112 |
2112 void RenderWidget::UnregisterSwappedOutChildFrame(RenderFrameImpl* frame) { | 2113 void RenderWidget::UnregisterSwappedOutChildFrame(RenderFrameImpl* frame) { |
2113 swapped_out_frames_.RemoveObserver(frame); | 2114 swapped_out_frames_.RemoveObserver(frame); |
2114 } | 2115 } |
2115 | 2116 |
2116 } // namespace content | 2117 } // namespace content |
OLD | NEW |