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 d4109afe50e154b6c026c0e309e530daca7c1973..c42a9c97fb8d6dd603139c0f3f1974805c9607b9 100644 |
--- a/content/common/mojo/service_registry_impl.cc |
+++ b/content/common/mojo/service_registry_impl.cc |
@@ -8,11 +8,12 @@ |
namespace content { |
-ServiceRegistryImpl::ServiceRegistryImpl() : bound_(false) { |
+ServiceRegistryImpl::ServiceRegistryImpl() |
+ : bound_(false), weak_factory_(this) { |
} |
ServiceRegistryImpl::ServiceRegistryImpl(mojo::ScopedMessagePipeHandle handle) |
- : bound_(false) { |
+ : bound_(false), weak_factory_(this) { |
BindRemoteServiceProvider(handle.Pass()); |
} |
@@ -63,6 +64,10 @@ void ServiceRegistryImpl::ConnectToRemoteService( |
client()->ConnectToService(mojo::String::From(service_name), handle.Pass()); |
} |
+base::WeakPtr<ServiceRegistry> ServiceRegistryImpl::GetWeakPtr() { |
+ return weak_factory_.GetWeakPtr(); |
+} |
+ |
void ServiceRegistryImpl::ConnectToService( |
const mojo::String& name, |
mojo::ScopedMessagePipeHandle client_handle) { |