Chromium Code Reviews| Index: content/browser/renderer_host/render_widget_host_impl.cc |
| diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc |
| index d177e31a35969c24316e54d599f97ccae5dd9221..1d926477b56e524c711b4ad970c17c37272657ed 100644 |
| --- a/content/browser/renderer_host/render_widget_host_impl.cc |
| +++ b/content/browser/renderer_host/render_widget_host_impl.cc |
| @@ -1503,7 +1503,7 @@ void RenderWidgetHostImpl::GetSnapshotFromBrowser( |
| pending_surface_browser_snapshots_.insert(std::make_pair(id, callback)); |
| ui::LatencyInfo latency_info; |
| latency_info.AddLatencyNumber(ui::BROWSER_SNAPSHOT_FRAME_NUMBER_COMPONENT, |
| - 0, id); |
| + id); |
| Send(new ViewMsg_ForceRedraw(GetRoutingID(), latency_info)); |
| return; |
| } |
| @@ -1517,7 +1517,7 @@ void RenderWidgetHostImpl::GetSnapshotFromBrowser( |
| #endif |
| pending_browser_snapshots_.insert(std::make_pair(id, callback)); |
| ui::LatencyInfo latency_info; |
| - latency_info.AddLatencyNumber(ui::BROWSER_SNAPSHOT_FRAME_NUMBER_COMPONENT, 0, |
| + latency_info.AddLatencyNumber(ui::BROWSER_SNAPSHOT_FRAME_NUMBER_COMPONENT, |
| id); |
| Send(new ViewMsg_ForceRedraw(GetRoutingID(), latency_info)); |
| } |
| @@ -1833,8 +1833,8 @@ void RenderWidgetHostImpl::OnGpuSwapBuffersCompletedInternal( |
| if (latency_info.FindLatency(ui::BROWSER_SNAPSHOT_FRAME_NUMBER_COMPONENT, |
| GetLatencyComponentId(), |
| &window_snapshot_component)) { |
|
ccameron
2017/06/29 20:52:18
Looks reasonable (first not-just-delete change).
|
| - int sequence_number = |
| - static_cast<int>(window_snapshot_component.sequence_number); |
| + static int snapshot_id = 0; |
| + ++snapshot_id; |
| #if defined(OS_MACOSX) || defined(OS_WIN) |
| // On Mac, when using CoreAnimation, or Win32 when using GDI, there is a |
| // delay between when content is drawn to the screen, and when the |
| @@ -1844,10 +1844,10 @@ void RenderWidgetHostImpl::OnGpuSwapBuffersCompletedInternal( |
| base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( |
| FROM_HERE, |
| base::Bind(&RenderWidgetHostImpl::WindowSnapshotReachedScreen, |
| - weak_factory_.GetWeakPtr(), sequence_number), |
| + weak_factory_.GetWeakPtr(), snapshot_id), |
| base::TimeDelta::FromSecondsD(1. / 6)); |
| #else |
| - WindowSnapshotReachedScreen(sequence_number); |
| + WindowSnapshotReachedScreen(snapshot_id); |
| #endif |
| } |