| 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 <set> | 8 #include <set> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 2432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2443 return; | 2443 return; |
| 2444 } | 2444 } |
| 2445 } | 2445 } |
| 2446 | 2446 |
| 2447 Send(new ViewMsg_WindowSnapshotCompleted( | 2447 Send(new ViewMsg_WindowSnapshotCompleted( |
| 2448 GetRoutingID(), snapshot_id, gfx::Size(), png)); | 2448 GetRoutingID(), snapshot_id, gfx::Size(), png)); |
| 2449 } | 2449 } |
| 2450 | 2450 |
| 2451 // static | 2451 // static |
| 2452 void RenderWidgetHostImpl::CompositorFrameDrawn( | 2452 void RenderWidgetHostImpl::CompositorFrameDrawn( |
| 2453 const ui::LatencyInfo& latency_info) { | 2453 const std::vector<ui::LatencyInfo>& latency_info) { |
| 2454 std::set<RenderWidgetHostImpl*> rwhi_set; | 2454 for (size_t i = 0; i < latency_info.size(); i++) { |
| 2455 | 2455 std::set<RenderWidgetHostImpl*> rwhi_set; |
| 2456 for (ui::LatencyInfo::LatencyMap::const_iterator b = | 2456 for (ui::LatencyInfo::LatencyMap::const_iterator b = |
| 2457 latency_info.latency_components.begin(); | 2457 latency_info[i].latency_components.begin(); |
| 2458 b != latency_info.latency_components.end(); | 2458 b != latency_info[i].latency_components.end(); |
| 2459 ++b) { | 2459 ++b) { |
| 2460 if (b->first.first == ui::INPUT_EVENT_LATENCY_BEGIN_RWH_COMPONENT || | 2460 if (b->first.first == ui::INPUT_EVENT_LATENCY_BEGIN_RWH_COMPONENT || |
| 2461 b->first.first == ui::WINDOW_SNAPSHOT_FRAME_NUMBER_COMPONENT) { | 2461 b->first.first == ui::WINDOW_SNAPSHOT_FRAME_NUMBER_COMPONENT) { |
| 2462 // Matches with GetLatencyComponentId | 2462 // Matches with GetLatencyComponentId |
| 2463 int routing_id = b->first.second & 0xffffffff; | 2463 int routing_id = b->first.second & 0xffffffff; |
| 2464 int process_id = (b->first.second >> 32) & 0xffffffff; | 2464 int process_id = (b->first.second >> 32) & 0xffffffff; |
| 2465 RenderWidgetHost* rwh = | 2465 RenderWidgetHost* rwh = |
| 2466 RenderWidgetHost::FromID(process_id, routing_id); | 2466 RenderWidgetHost::FromID(process_id, routing_id); |
| 2467 if (!rwh) { | 2467 if (!rwh) { |
| 2468 continue; | 2468 continue; |
| 2469 } |
| 2470 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(rwh); |
| 2471 if (rwhi_set.insert(rwhi).second) |
| 2472 rwhi->FrameSwapped(latency_info[i]); |
| 2469 } | 2473 } |
| 2470 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(rwh); | |
| 2471 if (rwhi_set.insert(rwhi).second) | |
| 2472 rwhi->FrameSwapped(latency_info); | |
| 2473 } | 2474 } |
| 2474 } | 2475 } |
| 2475 } | 2476 } |
| 2476 | 2477 |
| 2477 } // namespace content | 2478 } // namespace content |
| OLD | NEW |