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

Unified Diff: content/common/mojo/service_registry_impl.cc

Issue 1128493002: Add connection error handing in ServiceRegistryImpl. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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/common/mojo/service_registry_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/mojo/service_registry_impl.cc
diff --git a/content/common/mojo/service_registry_impl.cc b/content/common/mojo/service_registry_impl.cc
index eec7640bc300e15425f9d99c95fccdc3cab5c2a4..a4d6174fec155013d97a2a395a2866c4bdea2775 100644
--- a/content/common/mojo/service_registry_impl.cc
+++ b/content/common/mojo/service_registry_impl.cc
@@ -21,6 +21,7 @@ ServiceRegistryImpl::~ServiceRegistryImpl() {
void ServiceRegistryImpl::Bind(
mojo::InterfaceRequest<mojo::ServiceProvider> request) {
+ binding_.set_error_handler(this);
Ken Rockot(use gerrit already) 2015/05/05 17:59:23 nit: might as well just do this in the ctor
xhwang 2015/05/05 18:09:26 Done.
binding_.Bind(request.Pass());
}
@@ -58,6 +59,10 @@ void ServiceRegistryImpl::ConnectToRemoteService(
handle.Pass());
}
+bool ServiceRegistryImpl::IsBound() const {
+ return binding_.is_bound();
+}
+
base::WeakPtr<ServiceRegistry> ServiceRegistryImpl::GetWeakPtr() {
return weak_factory_.GetWeakPtr();
}
@@ -74,4 +79,8 @@ void ServiceRegistryImpl::ConnectToService(
it->second.Run(client_handle.Pass());
}
+void ServiceRegistryImpl::OnConnectionError() {
+ binding_.Close();
+}
+
} // namespace content
« no previous file with comments | « content/common/mojo/service_registry_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698