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/browser/renderer_host/render_widget_host_impl.h" | 5 #include "content/browser/renderer_host/render_widget_host_impl.h" |
6 | 6 |
7 #include <math.h> | 7 #include <math.h> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 2484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2495 return; | 2495 return; |
2496 | 2496 |
2497 OnRenderAutoResized(new_size); | 2497 OnRenderAutoResized(new_size); |
2498 } | 2498 } |
2499 | 2499 |
2500 void RenderWidgetHostImpl::DetachDelegate() { | 2500 void RenderWidgetHostImpl::DetachDelegate() { |
2501 delegate_ = NULL; | 2501 delegate_ = NULL; |
2502 } | 2502 } |
2503 | 2503 |
2504 void RenderWidgetHostImpl::FrameSwapped(const ui::LatencyInfo& latency_info) { | 2504 void RenderWidgetHostImpl::FrameSwapped(const ui::LatencyInfo& latency_info) { |
| 2505 ui::LatencyInfo::LatencyMap::const_iterator l = |
| 2506 latency_info.latency_components.find(std::make_pair( |
| 2507 ui::INPUT_EVENT_LATENCY_COMPONENT, GetLatencyComponentId())); |
| 2508 if (l == latency_info.latency_components.end()) |
| 2509 return; |
| 2510 |
| 2511 rendering_stats_.input_event_count += l->second.event_count; |
| 2512 rendering_stats_.total_input_latency += |
| 2513 l->second.event_count * |
| 2514 (latency_info.swap_timestamp - l->second.event_time); |
| 2515 |
| 2516 if (CommandLine::ForCurrentProcess()->HasSwitch( |
| 2517 switches::kEnableGpuBenchmarking)) |
| 2518 Send(new ViewMsg_SetBrowserRenderingStats(routing_id_, rendering_stats_)); |
2505 } | 2519 } |
2506 | 2520 |
2507 } // namespace content | 2521 } // namespace content |
OLD | NEW |