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

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_android.cc

Issue 2484793002: Remove access to WebContents in RWHVA::SynchronousFrameMetadata() (Closed)
Patch Set: comments Created 4 years, 1 month 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
« no previous file with comments | « content/browser/devtools/render_frame_devtools_agent_host.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/browser/renderer_host/render_widget_host_view_android.h" 5 #include "content/browser/renderer_host/render_widget_host_view_android.h"
6 6
7 #include <android/bitmap.h> 7 #include <android/bitmap.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 1173 matching lines...) Expand 10 before | Expand all | Expand 10 after
1184 if (host_ && host_->input_router()) { 1184 if (host_ && host_->input_router()) {
1185 host_->input_router()->NotifySiteIsMobileOptimized( 1185 host_->input_router()->NotifySiteIsMobileOptimized(
1186 is_mobile_optimized); 1186 is_mobile_optimized);
1187 } 1187 }
1188 1188
1189 // This is a subset of OnSwapCompositorFrame() used in the synchronous 1189 // This is a subset of OnSwapCompositorFrame() used in the synchronous
1190 // compositor flow. 1190 // compositor flow.
1191 OnFrameMetadataUpdated(frame_metadata.Clone(), false); 1191 OnFrameMetadataUpdated(frame_metadata.Clone(), false);
1192 1192
1193 // DevTools ScreenCast support for Android WebView. 1193 // DevTools ScreenCast support for Android WebView.
1194 WebContents* web_contents = content_view_core_->GetWebContents(); 1194 RenderFrameHost* frame_host = RenderViewHost::From(host_)->GetMainFrame();
1195 if (DevToolsAgentHost::HasFor(web_contents)) { 1195 if (frame_host) {
1196 scoped_refptr<DevToolsAgentHost> dtah = 1196 RenderFrameDevToolsAgentHost::SignalSynchronousSwapCompositorFrame(
1197 DevToolsAgentHost::GetOrCreateFor(web_contents); 1197 frame_host,
1198 // Unblock the compositor. 1198 std::move(frame_metadata));
1199 BrowserThread::PostTask(
1200 BrowserThread::UI, FROM_HERE,
1201 base::Bind(
1202 &RenderFrameDevToolsAgentHost::SynchronousSwapCompositorFrame,
1203 static_cast<RenderFrameDevToolsAgentHost*>(dtah.get()),
1204 base::Passed(&frame_metadata)));
1205 } 1199 }
1206 } 1200 }
1207 1201
1208 bool RenderWidgetHostViewAndroid::SupportsAnimation() const { 1202 bool RenderWidgetHostViewAndroid::SupportsAnimation() const {
1209 // The synchronous (WebView) compositor does not have a proper browser 1203 // The synchronous (WebView) compositor does not have a proper browser
1210 // compositor with which to drive animations. 1204 // compositor with which to drive animations.
1211 return using_browser_compositor_; 1205 return using_browser_compositor_;
1212 } 1206 }
1213 1207
1214 void RenderWidgetHostViewAndroid::SetNeedsAnimate() { 1208 void RenderWidgetHostViewAndroid::SetNeedsAnimate() {
(...skipping 751 matching lines...) Expand 10 before | Expand all | Expand 10 after
1966 case ui::MotionEvent::ACTION_UP: 1960 case ui::MotionEvent::ACTION_UP:
1967 case ui::MotionEvent::ACTION_POINTER_UP: 1961 case ui::MotionEvent::ACTION_POINTER_UP:
1968 UMA_HISTOGRAM_CUSTOM_COUNTS("Event.Latency.OS.TOUCH_RELEASED", 1962 UMA_HISTOGRAM_CUSTOM_COUNTS("Event.Latency.OS.TOUCH_RELEASED",
1969 delta.InMicroseconds(), 1, 1000000, 50); 1963 delta.InMicroseconds(), 1, 1000000, 50);
1970 default: 1964 default:
1971 return; 1965 return;
1972 } 1966 }
1973 } 1967 }
1974 1968
1975 } // namespace content 1969 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/devtools/render_frame_devtools_agent_host.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698