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

Unified Diff: mojo/services/view_manager/view_manager_init_service_impl.cc

Issue 372273004: Shutdown cleanup (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 5 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
Index: mojo/services/view_manager/view_manager_init_service_impl.cc
diff --git a/mojo/services/view_manager/view_manager_init_service_impl.cc b/mojo/services/view_manager/view_manager_init_service_impl.cc
index 28c7beb37c9559a3e7cc6d72da3f632a6ff702d7..9cb337bd6a6fae159f0b23c71e50d512d9d05e72 100644
--- a/mojo/services/view_manager/view_manager_init_service_impl.cc
+++ b/mojo/services/view_manager/view_manager_init_service_impl.cc
@@ -4,6 +4,7 @@
#include "mojo/services/view_manager/view_manager_init_service_impl.h"
+#include "base/bind.h"
#include "mojo/public/interfaces/service_provider/service_provider.mojom.h"
#include "mojo/services/view_manager/ids.h"
#include "mojo/services/view_manager/view_manager_service_impl.h"
@@ -19,7 +20,11 @@ ViewManagerInitServiceImpl::ConnectParams::~ConnectParams() {}
ViewManagerInitServiceImpl::ViewManagerInitServiceImpl(
ApplicationConnection* connection)
- : root_node_manager_(connection, this),
+ : root_node_manager_(
+ connection,
+ this,
+ base::Bind(&ViewManagerInitServiceImpl::OnNativeViewportDeleted,
+ base::Unretained(this))),
is_tree_host_ready_(false) {
}
@@ -57,6 +62,13 @@ void ViewManagerInitServiceImpl::OnRootViewManagerWindowTreeHostCreated() {
MaybeEmbedRoot(connect_params_->url, connect_params_->callback);
}
+void ViewManagerInitServiceImpl::OnNativeViewportDeleted() {
+ // TODO(beng): Should not have to rely on implementation detail of
+ // InterfaceImpl to close the connection. Instead should simply
+ // be able to delete this object.
+ internal_state()->router()->CloseMessagePipe();
+}
+
} // namespace service
} // namespace view_manager
} // namespace mojo

Powered by Google App Engine
This is Rietveld 408576698