| 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/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
| (...skipping 1049 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1060 } | 1060 } |
| 1061 #endif | 1061 #endif |
| 1062 | 1062 |
| 1063 base::AutoReset<const ui::LatencyInfo*> resetter(¤t_event_latency_info_, | 1063 base::AutoReset<const ui::LatencyInfo*> resetter(¤t_event_latency_info_, |
| 1064 &latency_info); | 1064 &latency_info); |
| 1065 | 1065 |
| 1066 base::TimeTicks start_time; | 1066 base::TimeTicks start_time; |
| 1067 if (base::TimeTicks::IsHighResNowFastAndReliable()) | 1067 if (base::TimeTicks::IsHighResNowFastAndReliable()) |
| 1068 start_time = base::TimeTicks::HighResNow(); | 1068 start_time = base::TimeTicks::HighResNow(); |
| 1069 | 1069 |
| 1070 TRACE_EVENT1("renderer", "RenderWidget::OnHandleInputEvent", | 1070 TRACE_EVENT1("renderer,benchmark", "RenderWidget::OnHandleInputEvent", |
| 1071 "event", WebInputEventTraits::GetName(input_event->type)); | 1071 "event", WebInputEventTraits::GetName(input_event->type)); |
| 1072 TRACE_EVENT_SYNTHETIC_DELAY_BEGIN("blink.HandleInputEvent"); | 1072 TRACE_EVENT_SYNTHETIC_DELAY_BEGIN("blink.HandleInputEvent"); |
| 1073 TRACE_EVENT_FLOW_STEP0( | 1073 TRACE_EVENT_FLOW_STEP0( |
| 1074 "input", | 1074 "input,benchmark", |
| 1075 "LatencyInfo.Flow", | 1075 "LatencyInfo.Flow", |
| 1076 TRACE_ID_DONT_MANGLE(latency_info.trace_id), | 1076 TRACE_ID_DONT_MANGLE(latency_info.trace_id), |
| 1077 "HanldeInputEventMain"); | 1077 "HanldeInputEventMain"); |
| 1078 | 1078 |
| 1079 // If we don't have a high res timer, these metrics won't be accurate enough | 1079 // If we don't have a high res timer, these metrics won't be accurate enough |
| 1080 // to be worth collecting. Note that this does introduce some sampling bias. | 1080 // to be worth collecting. Note that this does introduce some sampling bias. |
| 1081 if (!start_time.is_null()) | 1081 if (!start_time.is_null()) |
| 1082 LogInputEventLatencyUma(*input_event, start_time); | 1082 LogInputEventLatencyUma(*input_event, start_time); |
| 1083 | 1083 |
| 1084 scoped_ptr<cc::SwapPromiseMonitor> latency_info_swap_promise_monitor; | 1084 scoped_ptr<cc::SwapPromiseMonitor> latency_info_swap_promise_monitor; |
| (...skipping 1288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2373 void RenderWidget::RegisterVideoHoleFrame(RenderFrameImpl* frame) { | 2373 void RenderWidget::RegisterVideoHoleFrame(RenderFrameImpl* frame) { |
| 2374 video_hole_frames_.AddObserver(frame); | 2374 video_hole_frames_.AddObserver(frame); |
| 2375 } | 2375 } |
| 2376 | 2376 |
| 2377 void RenderWidget::UnregisterVideoHoleFrame(RenderFrameImpl* frame) { | 2377 void RenderWidget::UnregisterVideoHoleFrame(RenderFrameImpl* frame) { |
| 2378 video_hole_frames_.RemoveObserver(frame); | 2378 video_hole_frames_.RemoveObserver(frame); |
| 2379 } | 2379 } |
| 2380 #endif // defined(VIDEO_HOLE) | 2380 #endif // defined(VIDEO_HOLE) |
| 2381 | 2381 |
| 2382 } // namespace content | 2382 } // namespace content |
| OLD | NEW |