| 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 2486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 } | 2505 } |
| 2506 | 2506 |
| 2507 // static |
| 2508 void RenderWidgetHostImpl::CompositorFrameDrawn( |
| 2509 const ui::LatencyInfo& latency_info) { |
| 2510 for (ui::LatencyInfo::LatencyMap::const_iterator b = |
| 2511 latency_info.latency_components.begin(); |
| 2512 b != latency_info.latency_components.end(); |
| 2513 ++b) { |
| 2514 if (b->first.first != ui::INPUT_EVENT_LATENCY_COMPONENT) |
| 2515 continue; |
| 2516 // Matches with GetLatencyComponentId |
| 2517 int routing_id = b->first.second & 0xffffffff; |
| 2518 int process_id = (b->first.second >> 32) & 0xffffffff; |
| 2519 RenderProcessHost* host = RenderProcessHost::FromID(process_id); |
| 2520 if (!host) |
| 2521 continue; |
| 2522 RenderWidgetHost* rwh = host->GetRenderWidgetHostByID(routing_id); |
| 2523 if (!rwh) |
| 2524 continue; |
| 2525 RenderWidgetHostImpl::From(rwh)->FrameSwapped(latency_info); |
| 2526 } |
| 2527 } |
| 2528 |
| 2507 } // namespace content | 2529 } // namespace content |
| OLD | NEW |