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

Unified Diff: content/browser/renderer_host/render_widget_host_view_android.cc

Issue 2369643002: Fix OOPIFs on Android (Closed)
Patch Set: Add conditional for WebView shutdown Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/renderer_host/compositor_impl_android.cc ('k') | ui/android/delegated_frame_host_android.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/render_widget_host_view_android.cc
diff --git a/content/browser/renderer_host/render_widget_host_view_android.cc b/content/browser/renderer_host/render_widget_host_view_android.cc
index 2412e18cc69ae41c91a283b12e02f3f8c6cd4c17..20afe28caebfd3729a6f3884e0db69f9f43b6fe8 100644
--- a/content/browser/renderer_host/render_widget_host_view_android.cc
+++ b/content/browser/renderer_host/render_widget_host_view_android.cc
@@ -1387,6 +1387,13 @@ void RenderWidgetHostViewAndroid::StartObservingRootWindow() {
uint32_t outstanding_vsync_requests = outstanding_vsync_requests_;
outstanding_vsync_requests_ = 0;
RequestVSyncUpdate(outstanding_vsync_requests);
+
+ ui::WindowAndroidCompositor* compositor =
+ content_view_core_->GetWindowAndroid()->GetCompositor();
+ if (compositor) {
+ delegated_frame_host_->RegisterSurfaceNamespaceHierarchy(
+ compositor->GetSurfaceClientId());
+ }
}
void RenderWidgetHostViewAndroid::StopObservingRootWindow() {
@@ -1405,6 +1412,10 @@ void RenderWidgetHostViewAndroid::StopObservingRootWindow() {
if (host_)
host_->Send(new ViewMsg_SetBeginFramePaused(host_->GetRoutingID(), true));
content_view_core_->GetWindowAndroid()->RemoveObserver(this);
+ // If the DFH has already been destroyed, it will have cleaned itself up.
+ // This happens in some WebView cases.
+ if (delegated_frame_host_)
+ delegated_frame_host_->UnregisterSurfaceNamespaceHierarchy();
}
void RenderWidgetHostViewAndroid::SendBeginFrame(base::TimeTicks frame_time,
@@ -1801,6 +1812,10 @@ void RenderWidgetHostViewAndroid::OnAttachCompositor() {
if (!overscroll_controller_)
overscroll_controller_ = CreateOverscrollController(
content_view_core_, ui::GetScaleFactorForNativeView(GetNativeView()));
+ ui::WindowAndroidCompositor* compositor =
+ content_view_core_->GetWindowAndroid()->GetCompositor();
+ delegated_frame_host_->RegisterSurfaceNamespaceHierarchy(
+ compositor->GetSurfaceClientId());
}
void RenderWidgetHostViewAndroid::OnDetachCompositor() {
@@ -1808,6 +1823,7 @@ void RenderWidgetHostViewAndroid::OnDetachCompositor() {
DCHECK(using_browser_compositor_);
RunAckCallbacks();
overscroll_controller_.reset();
+ delegated_frame_host_->UnregisterSurfaceNamespaceHierarchy();
}
void RenderWidgetHostViewAndroid::OnVSync(base::TimeTicks frame_time,
« no previous file with comments | « content/browser/renderer_host/compositor_impl_android.cc ('k') | ui/android/delegated_frame_host_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698