Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(681)

Unified Diff: content/browser/renderer_host/render_widget_host_impl.cc

Issue 2914023002: Remove LatencyInfo::sequence_number. (May break metrics).
Patch Set: Rebase Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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
}

Powered by Google App Engine
This is Rietveld 408576698