| Index: content/renderer/render_view_impl.cc
|
| diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
|
| index abfa452135ac776a9e2766090d9d65a3f0c6315c..efed8242679f914cfc15af979533c18536a0016d 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"
|
| @@ -194,6 +195,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"
|
| @@ -2253,7 +2255,19 @@ 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);
|
| + LOG(INFO) << "RenderViewImpl::GetWindowSnapshot: id = " << id << " process id = " << (int) base::Process::Current().pid() << " process handle = " << (int) base::GetCurrentProcessHandle() << " routing id = " << GetRoutingID() << " latency_component_id: " << GetLatencyComponentId();
|
| + if (RenderWidgetCompositor* rwc = compositor()) {
|
| + LOG(INFO) << " composited path";
|
| + rwc->SetLatencyInfo(latency_info);
|
| + } else {
|
| + LOG(INFO) << " non-composited path";
|
| + latency_info_.MergeWith(latency_info);
|
| + }
|
| + ScheduleCompositeWithForcedRedraw();
|
| }
|
|
|
| void RenderViewImpl::OnWindowSnapshotCompleted(const int snapshot_id,
|
| @@ -2741,6 +2755,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)
|
|
|