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

Unified Diff: ui/android/delegated_frame_host_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 | « ui/android/delegated_frame_host_android.h ('k') | ui/android/window_android_compositor.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/android/delegated_frame_host_android.cc
diff --git a/ui/android/delegated_frame_host_android.cc b/ui/android/delegated_frame_host_android.cc
index f82e92576b52936425763e7c1046b6e5a4a98c55..5be36577f3c8d9aefe7f721f59307ee053fe56a9 100644
--- a/ui/android/delegated_frame_host_android.cc
+++ b/ui/android/delegated_frame_host_android.cc
@@ -93,6 +93,7 @@ DelegatedFrameHostAndroid::DelegatedFrameHostAndroid(
DelegatedFrameHostAndroid::~DelegatedFrameHostAndroid() {
DestroyDelegatedContent();
surface_factory_.reset();
+ UnregisterSurfaceNamespaceHierarchy();
surface_manager_->InvalidateSurfaceClientId(
surface_id_allocator_->client_id());
background_layer_->RemoveFromParent();
@@ -221,6 +222,27 @@ void DelegatedFrameHostAndroid::UpdateContainerSizeinDIP(
UpdateBackgroundLayer();
}
+void DelegatedFrameHostAndroid::RegisterSurfaceNamespaceHierarchy(
+ uint32_t parent_id) {
+ if (registered_parent_client_id_ != 0u)
+ UnregisterSurfaceNamespaceHierarchy();
+ registered_parent_client_id_ = parent_id;
+ surface_manager_->RegisterSurfaceFactoryClient(
+ surface_id_allocator_->client_id(), this);
+ surface_manager_->RegisterSurfaceNamespaceHierarchy(
+ parent_id, surface_id_allocator_->client_id());
+}
+
+void DelegatedFrameHostAndroid::UnregisterSurfaceNamespaceHierarchy() {
+ if (registered_parent_client_id_ == 0u)
+ return;
+ surface_manager_->UnregisterSurfaceFactoryClient(
+ surface_id_allocator_->client_id());
+ surface_manager_->UnregisterSurfaceNamespaceHierarchy(
+ registered_parent_client_id_, surface_id_allocator_->client_id());
+ registered_parent_client_id_ = 0u;
+}
+
void DelegatedFrameHostAndroid::ReturnResources(
const cc::ReturnedResourceArray& resources) {
return_resources_callback_.Run(resources);
@@ -228,7 +250,8 @@ void DelegatedFrameHostAndroid::ReturnResources(
void DelegatedFrameHostAndroid::SetBeginFrameSource(
cc::BeginFrameSource* begin_frame_source) {
- // TODO(tansell): Hook this up.
+ // TODO(enne): hook this up instead of making RWHVAndroid a
+ // WindowAndroidObserver.
}
void DelegatedFrameHostAndroid::UpdateBackgroundLayer() {
« no previous file with comments | « ui/android/delegated_frame_host_android.h ('k') | ui/android/window_android_compositor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698