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 1097 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1108 // handlers are heavy and rate limit them. | 1108 // handlers are heavy and rate limit them. |
1109 bool rate_limiting_wanted = true; | 1109 bool rate_limiting_wanted = true; |
1110 if (base::TimeTicks::IsHighResNowFastAndReliable()) { | 1110 if (base::TimeTicks::IsHighResNowFastAndReliable()) { |
1111 base::TimeTicks end_time = base::TimeTicks::HighResNow(); | 1111 base::TimeTicks end_time = base::TimeTicks::HighResNow(); |
1112 total_input_handling_time_this_frame_ += (end_time - start_time); | 1112 total_input_handling_time_this_frame_ += (end_time - start_time); |
1113 rate_limiting_wanted = | 1113 rate_limiting_wanted = |
1114 total_input_handling_time_this_frame_.InMicroseconds() > | 1114 total_input_handling_time_this_frame_.InMicroseconds() > |
1115 kInputHandlingTimeThrottlingThresholdMicroseconds; | 1115 kInputHandlingTimeThrottlingThresholdMicroseconds; |
1116 } | 1116 } |
1117 | 1117 |
1118 if (!WebInputEventTraits::IgnoresAckDisposition(input_event->type)) { | 1118 if (!WebInputEventTraits::IgnoresAckDisposition(*input_event)) { |
1119 scoped_ptr<IPC::Message> response( | 1119 scoped_ptr<IPC::Message> response( |
1120 new InputHostMsg_HandleInputEvent_ACK(routing_id_, | 1120 new InputHostMsg_HandleInputEvent_ACK(routing_id_, |
1121 input_event->type, | 1121 input_event->type, |
1122 ack_result, | 1122 ack_result, |
1123 swap_latency_info)); | 1123 swap_latency_info)); |
1124 if (rate_limiting_wanted && event_type_can_be_rate_limited && | 1124 if (rate_limiting_wanted && event_type_can_be_rate_limited && |
1125 frame_pending && !is_hidden_) { | 1125 frame_pending && !is_hidden_) { |
1126 // We want to rate limit the input events in this case, so we'll wait for | 1126 // We want to rate limit the input events in this case, so we'll wait for |
1127 // painting to finish before ACKing this message. | 1127 // painting to finish before ACKing this message. |
1128 TRACE_EVENT_INSTANT0("renderer", | 1128 TRACE_EVENT_INSTANT0("renderer", |
(...skipping 1396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2525 | 2525 |
2526 void RenderWidget::RegisterSwappedOutChildFrame(RenderFrameImpl* frame) { | 2526 void RenderWidget::RegisterSwappedOutChildFrame(RenderFrameImpl* frame) { |
2527 swapped_out_frames_.AddObserver(frame); | 2527 swapped_out_frames_.AddObserver(frame); |
2528 } | 2528 } |
2529 | 2529 |
2530 void RenderWidget::UnregisterSwappedOutChildFrame(RenderFrameImpl* frame) { | 2530 void RenderWidget::UnregisterSwappedOutChildFrame(RenderFrameImpl* frame) { |
2531 swapped_out_frames_.RemoveObserver(frame); | 2531 swapped_out_frames_.RemoveObserver(frame); |
2532 } | 2532 } |
2533 | 2533 |
2534 } // namespace content | 2534 } // namespace content |
OLD | NEW |