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

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: Aligned with the existing API 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 1158 matching lines...) Expand 10 before | Expand all | Expand 10 after
1169 // TODO(viettrungluu): Move to a separate message filter. 1169 // TODO(viettrungluu): Move to a separate message filter.
1170 IPC_MESSAGE_HANDLER(ViewMsg_SetHistoryLengthAndPrune, 1170 IPC_MESSAGE_HANDLER(ViewMsg_SetHistoryLengthAndPrune,
1171 OnSetHistoryLengthAndPrune) 1171 OnSetHistoryLengthAndPrune)
1172 IPC_MESSAGE_HANDLER(ViewMsg_EnableViewSourceMode, OnEnableViewSourceMode) 1172 IPC_MESSAGE_HANDLER(ViewMsg_EnableViewSourceMode, OnEnableViewSourceMode)
1173 IPC_MESSAGE_HANDLER(ViewMsg_SetAccessibilityMode, OnSetAccessibilityMode) 1173 IPC_MESSAGE_HANDLER(ViewMsg_SetAccessibilityMode, OnSetAccessibilityMode)
1174 IPC_MESSAGE_HANDLER(ViewMsg_DisownOpener, OnDisownOpener) 1174 IPC_MESSAGE_HANDLER(ViewMsg_DisownOpener, OnDisownOpener)
1175 IPC_MESSAGE_HANDLER(ViewMsg_ReleaseDisambiguationPopupDIB, 1175 IPC_MESSAGE_HANDLER(ViewMsg_ReleaseDisambiguationPopupDIB,
1176 OnReleaseDisambiguationPopupDIB) 1176 OnReleaseDisambiguationPopupDIB)
1177 IPC_MESSAGE_HANDLER(ViewMsg_WindowSnapshotCompleted, 1177 IPC_MESSAGE_HANDLER(ViewMsg_WindowSnapshotCompleted,
1178 OnWindowSnapshotCompleted) 1178 OnWindowSnapshotCompleted)
1179 IPC_MESSAGE_HANDLER(ViewMsg_ForceRedraw, OnForceRedraw)
1179 #if defined(OS_ANDROID) 1180 #if defined(OS_ANDROID)
1180 IPC_MESSAGE_HANDLER(InputMsg_ActivateNearestFindResult, 1181 IPC_MESSAGE_HANDLER(InputMsg_ActivateNearestFindResult,
1181 OnActivateNearestFindResult) 1182 OnActivateNearestFindResult)
1182 IPC_MESSAGE_HANDLER(ViewMsg_FindMatchRects, OnFindMatchRects) 1183 IPC_MESSAGE_HANDLER(ViewMsg_FindMatchRects, OnFindMatchRects)
1183 IPC_MESSAGE_HANDLER(ViewMsg_SelectPopupMenuItems, OnSelectPopupMenuItems) 1184 IPC_MESSAGE_HANDLER(ViewMsg_SelectPopupMenuItems, OnSelectPopupMenuItems)
1184 IPC_MESSAGE_HANDLER(ViewMsg_UndoScrollFocusedEditableNodeIntoView, 1185 IPC_MESSAGE_HANDLER(ViewMsg_UndoScrollFocusedEditableNodeIntoView,
1185 OnUndoScrollFocusedEditableNodeIntoRect) 1186 OnUndoScrollFocusedEditableNodeIntoRect)
1186 IPC_MESSAGE_HANDLER(ViewMsg_UpdateTopControlsState, 1187 IPC_MESSAGE_HANDLER(ViewMsg_UpdateTopControlsState,
1187 OnUpdateTopControlsState) 1188 OnUpdateTopControlsState)
1188 IPC_MESSAGE_HANDLER(ViewMsg_PauseVideo, OnPauseVideo) 1189 IPC_MESSAGE_HANDLER(ViewMsg_PauseVideo, OnPauseVideo)
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after
1609 if (RenderThreadImpl::current()) // Will be NULL during unit tests. 1610 if (RenderThreadImpl::current()) // Will be NULL during unit tests.
1610 RenderThreadImpl::current()->DoNotNotifyWebKitOfModalLoop(); 1611 RenderThreadImpl::current()->DoNotNotifyWebKitOfModalLoop();
1611 1612
1612 message->EnableMessagePumping(); // Runs a nested message loop. 1613 message->EnableMessagePumping(); // Runs a nested message loop.
1613 return Send(message); 1614 return Send(message);
1614 } 1615 }
1615 1616
1616 void RenderViewImpl::GetWindowSnapshot(const WindowSnapshotCallback& callback) { 1617 void RenderViewImpl::GetWindowSnapshot(const WindowSnapshotCallback& callback) {
1617 int id = next_snapshot_id_++; 1618 int id = next_snapshot_id_++;
1618 pending_snapshots_.insert(std::make_pair(id, callback)); 1619 pending_snapshots_.insert(std::make_pair(id, callback));
1620 OnForceRedraw(id);
1621 }
1622
1623 void RenderViewImpl::OnForceRedraw(int id) {
1619 ui::LatencyInfo latency_info; 1624 ui::LatencyInfo latency_info;
1620 latency_info.AddLatencyNumber(ui::WINDOW_SNAPSHOT_FRAME_NUMBER_COMPONENT, 1625 latency_info.AddLatencyNumber(ui::WINDOW_SNAPSHOT_FRAME_NUMBER_COMPONENT,
1621 0, 1626 0,
1622 id); 1627 id);
1623 scoped_ptr<cc::SwapPromiseMonitor> latency_info_swap_promise_monitor; 1628 scoped_ptr<cc::SwapPromiseMonitor> latency_info_swap_promise_monitor;
1624 if (RenderWidgetCompositor* rwc = compositor()) { 1629 if (RenderWidgetCompositor* rwc = compositor()) {
1625 latency_info_swap_promise_monitor = 1630 latency_info_swap_promise_monitor =
1626 rwc->CreateLatencyInfoSwapPromiseMonitor(&latency_info).Pass(); 1631 rwc->CreateLatencyInfoSwapPromiseMonitor(&latency_info).Pass();
1627 } else { 1632 } else {
1628 latency_info_.push_back(latency_info); 1633 latency_info_.push_back(latency_info);
(...skipping 3526 matching lines...) Expand 10 before | Expand all | Expand 10 after
5155 for (size_t i = 0; i < icon_urls.size(); i++) { 5160 for (size_t i = 0; i < icon_urls.size(); i++) {
5156 WebURL url = icon_urls[i].iconURL(); 5161 WebURL url = icon_urls[i].iconURL();
5157 if (!url.isEmpty()) 5162 if (!url.isEmpty())
5158 urls.push_back(FaviconURL(url, 5163 urls.push_back(FaviconURL(url,
5159 ToFaviconType(icon_urls[i].iconType()))); 5164 ToFaviconType(icon_urls[i].iconType())));
5160 } 5165 }
5161 SendUpdateFaviconURL(urls); 5166 SendUpdateFaviconURL(urls);
5162 } 5167 }
5163 5168
5164 } // namespace content 5169 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698