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

Side by Side Diff: content/renderer/render_view_impl.cc

Issue 190693002: Migrate Telemetry from beginWindowSnapshotPNG to Page.captureScreenshot (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/renderer/render_view_impl.h" 5 #include "content/renderer/render_view_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 1160 matching lines...) Expand 10 before | Expand all | Expand 10 after
1171 // TODO(viettrungluu): Move to a separate message filter. 1171 // TODO(viettrungluu): Move to a separate message filter.
1172 IPC_MESSAGE_HANDLER(ViewMsg_SetHistoryLengthAndPrune, 1172 IPC_MESSAGE_HANDLER(ViewMsg_SetHistoryLengthAndPrune,
1173 OnSetHistoryLengthAndPrune) 1173 OnSetHistoryLengthAndPrune)
1174 IPC_MESSAGE_HANDLER(ViewMsg_EnableViewSourceMode, OnEnableViewSourceMode) 1174 IPC_MESSAGE_HANDLER(ViewMsg_EnableViewSourceMode, OnEnableViewSourceMode)
1175 IPC_MESSAGE_HANDLER(ViewMsg_SetAccessibilityMode, OnSetAccessibilityMode) 1175 IPC_MESSAGE_HANDLER(ViewMsg_SetAccessibilityMode, OnSetAccessibilityMode)
1176 IPC_MESSAGE_HANDLER(ViewMsg_DisownOpener, OnDisownOpener) 1176 IPC_MESSAGE_HANDLER(ViewMsg_DisownOpener, OnDisownOpener)
1177 IPC_MESSAGE_HANDLER(ViewMsg_ReleaseDisambiguationPopupDIB, 1177 IPC_MESSAGE_HANDLER(ViewMsg_ReleaseDisambiguationPopupDIB,
1178 OnReleaseDisambiguationPopupDIB) 1178 OnReleaseDisambiguationPopupDIB)
1179 IPC_MESSAGE_HANDLER(ViewMsg_WindowSnapshotCompleted, 1179 IPC_MESSAGE_HANDLER(ViewMsg_WindowSnapshotCompleted,
1180 OnWindowSnapshotCompleted) 1180 OnWindowSnapshotCompleted)
1181 IPC_MESSAGE_HANDLER(ViewMsg_ForceRedraw, OnForceRedraw)
1181 #if defined(OS_ANDROID) 1182 #if defined(OS_ANDROID)
1182 IPC_MESSAGE_HANDLER(InputMsg_ActivateNearestFindResult, 1183 IPC_MESSAGE_HANDLER(InputMsg_ActivateNearestFindResult,
1183 OnActivateNearestFindResult) 1184 OnActivateNearestFindResult)
1184 IPC_MESSAGE_HANDLER(ViewMsg_FindMatchRects, OnFindMatchRects) 1185 IPC_MESSAGE_HANDLER(ViewMsg_FindMatchRects, OnFindMatchRects)
1185 IPC_MESSAGE_HANDLER(ViewMsg_SelectPopupMenuItems, OnSelectPopupMenuItems) 1186 IPC_MESSAGE_HANDLER(ViewMsg_SelectPopupMenuItems, OnSelectPopupMenuItems)
1186 IPC_MESSAGE_HANDLER(ViewMsg_UndoScrollFocusedEditableNodeIntoView, 1187 IPC_MESSAGE_HANDLER(ViewMsg_UndoScrollFocusedEditableNodeIntoView,
1187 OnUndoScrollFocusedEditableNodeIntoRect) 1188 OnUndoScrollFocusedEditableNodeIntoRect)
1188 IPC_MESSAGE_HANDLER(ViewMsg_UpdateTopControlsState, 1189 IPC_MESSAGE_HANDLER(ViewMsg_UpdateTopControlsState,
1189 OnUpdateTopControlsState) 1190 OnUpdateTopControlsState)
1190 IPC_MESSAGE_HANDLER(ViewMsg_PauseVideo, OnPauseVideo) 1191 IPC_MESSAGE_HANDLER(ViewMsg_PauseVideo, OnPauseVideo)
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after
1640 if (RenderThreadImpl::current()) // Will be NULL during unit tests. 1641 if (RenderThreadImpl::current()) // Will be NULL during unit tests.
1641 RenderThreadImpl::current()->DoNotNotifyWebKitOfModalLoop(); 1642 RenderThreadImpl::current()->DoNotNotifyWebKitOfModalLoop();
1642 1643
1643 message->EnableMessagePumping(); // Runs a nested message loop. 1644 message->EnableMessagePumping(); // Runs a nested message loop.
1644 return Send(message); 1645 return Send(message);
1645 } 1646 }
1646 1647
1647 void RenderViewImpl::GetWindowSnapshot(const WindowSnapshotCallback& callback) { 1648 void RenderViewImpl::GetWindowSnapshot(const WindowSnapshotCallback& callback) {
1648 int id = next_snapshot_id_++; 1649 int id = next_snapshot_id_++;
1649 pending_snapshots_.insert(std::make_pair(id, callback)); 1650 pending_snapshots_.insert(std::make_pair(id, callback));
1651 OnForceRedraw(id);
1652 }
1653
1654 void RenderViewImpl::OnForceRedraw(int id) {
1650 ui::LatencyInfo latency_info; 1655 ui::LatencyInfo latency_info;
1651 latency_info.AddLatencyNumber(ui::WINDOW_SNAPSHOT_FRAME_NUMBER_COMPONENT, 1656 latency_info.AddLatencyNumber(ui::WINDOW_SNAPSHOT_FRAME_NUMBER_COMPONENT,
1652 0, 1657 0,
1653 id); 1658 id);
1654 scoped_ptr<cc::SwapPromiseMonitor> latency_info_swap_promise_monitor; 1659 scoped_ptr<cc::SwapPromiseMonitor> latency_info_swap_promise_monitor;
1655 if (RenderWidgetCompositor* rwc = compositor()) { 1660 if (RenderWidgetCompositor* rwc = compositor()) {
1656 latency_info_swap_promise_monitor = 1661 latency_info_swap_promise_monitor =
1657 rwc->CreateLatencyInfoSwapPromiseMonitor(&latency_info).Pass(); 1662 rwc->CreateLatencyInfoSwapPromiseMonitor(&latency_info).Pass();
1658 } else { 1663 } else {
1659 latency_info_.push_back(latency_info); 1664 latency_info_.push_back(latency_info);
(...skipping 3542 matching lines...) Expand 10 before | Expand all | Expand 10 after
5202 for (size_t i = 0; i < icon_urls.size(); i++) { 5207 for (size_t i = 0; i < icon_urls.size(); i++) {
5203 WebURL url = icon_urls[i].iconURL(); 5208 WebURL url = icon_urls[i].iconURL();
5204 if (!url.isEmpty()) 5209 if (!url.isEmpty())
5205 urls.push_back(FaviconURL(url, 5210 urls.push_back(FaviconURL(url,
5206 ToFaviconType(icon_urls[i].iconType()))); 5211 ToFaviconType(icon_urls[i].iconType())));
5207 } 5212 }
5208 SendUpdateFaviconURL(urls); 5213 SendUpdateFaviconURL(urls);
5209 } 5214 }
5210 5215
5211 } // namespace content 5216 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698