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 1059 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1070 // handlers are heavy and rate limit them. | 1070 // handlers are heavy and rate limit them. |
1071 bool rate_limiting_wanted = true; | 1071 bool rate_limiting_wanted = true; |
1072 if (base::TimeTicks::IsHighResNowFastAndReliable()) { | 1072 if (base::TimeTicks::IsHighResNowFastAndReliable()) { |
1073 base::TimeTicks end_time = base::TimeTicks::HighResNow(); | 1073 base::TimeTicks end_time = base::TimeTicks::HighResNow(); |
1074 total_input_handling_time_this_frame_ += (end_time - start_time); | 1074 total_input_handling_time_this_frame_ += (end_time - start_time); |
1075 rate_limiting_wanted = | 1075 rate_limiting_wanted = |
1076 total_input_handling_time_this_frame_.InMicroseconds() > | 1076 total_input_handling_time_this_frame_.InMicroseconds() > |
1077 kInputHandlingTimeThrottlingThresholdMicroseconds; | 1077 kInputHandlingTimeThrottlingThresholdMicroseconds; |
1078 } | 1078 } |
1079 | 1079 |
1080 if (!WebInputEventTraits::IgnoresAckDisposition(*input_event)) { | 1080 if (!WebInputEventTraits::IgnoresAckDisposition(input_event->type)) { |
1081 scoped_ptr<IPC::Message> response( | 1081 scoped_ptr<IPC::Message> response( |
1082 new InputHostMsg_HandleInputEvent_ACK(routing_id_, | 1082 new InputHostMsg_HandleInputEvent_ACK(routing_id_, |
1083 input_event->type, | 1083 input_event->type, |
1084 ack_result, | 1084 ack_result, |
1085 swap_latency_info)); | 1085 swap_latency_info)); |
1086 if (rate_limiting_wanted && event_type_can_be_rate_limited && | 1086 if (rate_limiting_wanted && event_type_can_be_rate_limited && |
1087 frame_pending && !is_hidden_) { | 1087 frame_pending && !is_hidden_) { |
1088 // We want to rate limit the input events in this case, so we'll wait for | 1088 // We want to rate limit the input events in this case, so we'll wait for |
1089 // painting to finish before ACKing this message. | 1089 // painting to finish before ACKing this message. |
1090 TRACE_EVENT_INSTANT0("renderer", | 1090 TRACE_EVENT_INSTANT0("renderer", |
(...skipping 1237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2328 | 2328 |
2329 void RenderWidget::RegisterSwappedOutChildFrame(RenderFrameImpl* frame) { | 2329 void RenderWidget::RegisterSwappedOutChildFrame(RenderFrameImpl* frame) { |
2330 swapped_out_frames_.AddObserver(frame); | 2330 swapped_out_frames_.AddObserver(frame); |
2331 } | 2331 } |
2332 | 2332 |
2333 void RenderWidget::UnregisterSwappedOutChildFrame(RenderFrameImpl* frame) { | 2333 void RenderWidget::UnregisterSwappedOutChildFrame(RenderFrameImpl* frame) { |
2334 swapped_out_frames_.RemoveObserver(frame); | 2334 swapped_out_frames_.RemoveObserver(frame); |
2335 } | 2335 } |
2336 | 2336 |
2337 } // namespace content | 2337 } // namespace content |
OLD | NEW |