Index: content/renderer/render_view_impl.cc |
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc |
index c7f9a0eb92b9993838a58f96540c8f57065f679e..37260c75252b097a8e13dd0d389d12a9c2905eb7 100644 |
--- a/content/renderer/render_view_impl.cc |
+++ b/content/renderer/render_view_impl.cc |
@@ -23,6 +23,7 @@ |
#include "base/metrics/histogram.h" |
#include "base/path_service.h" |
#include "base/process/kill.h" |
+#include "base/process/process.h" |
#include "base/strings/string_number_conversions.h" |
#include "base/strings/string_piece.h" |
#include "base/strings/string_split.h" |
@@ -193,6 +194,7 @@ |
#include "third_party/WebKit/public/web/WebView.h" |
#include "third_party/WebKit/public/web/WebWindowFeatures.h" |
#include "third_party/WebKit/public/web/default/WebRenderTheme.h" |
+#include "ui/base/latency_info.h" |
#include "ui/base/ui_base_switches_util.h" |
#include "ui/gfx/native_widget_types.h" |
#include "ui/gfx/point.h" |
@@ -2230,7 +2232,16 @@ bool RenderViewImpl::SendAndRunNestedMessageLoop(IPC::SyncMessage* message) { |
void RenderViewImpl::GetWindowSnapshot(const WindowSnapshotCallback& callback) { |
int id = next_snapshot_id_++; |
pending_snapshots_.insert(std::make_pair(id, callback)); |
- Send(new ViewHostMsg_GetWindowSnapshot(routing_id_, id)); |
+ ui::LatencyInfo latency_info; |
+ latency_info.AddLatencyNumber(ui::WINDOW_SNAPSHOT_FRAME_NUMBER_COMPONENT, |
+ GetLatencyComponentId(), |
+ id); |
+ if (RenderWidgetCompositor* rwc = compositor()) { |
+ rwc->SetLatencyInfo(latency_info); |
+ } else { |
+ latency_info_.MergeWith(latency_info); |
+ } |
+ ScheduleCompositeWithForcedRedraw(); |
} |
void RenderViewImpl::OnWindowSnapshotCompleted(const int snapshot_id, |
@@ -2714,6 +2725,12 @@ gfx::RectF RenderViewImpl::ClientRectToPhysicalWindowRect( |
return window_rect; |
} |
+int64 RenderViewImpl::GetLatencyComponentId() { |
+ // Note: this must match the logic in RenderWidgetHostImpl. |
+ return GetRoutingID() | (static_cast<int64>( |
+ RenderThreadImpl::current()->renderer_process_id()) << 32); |
+} |
+ |
void RenderViewImpl::StartNavStateSyncTimerIfNecessary() { |
// No need to update state if no page has committed yet. |
if (page_id_ == -1) |