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 d19b96f3da081d0bb1fbdcba216f1bdaa7e1836e..ec17054d34abd8129b0993555b0378565bdd9df4 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::GetRemoteInterface( |
client()->GetInterface(mojo::String::From(service_name), handle.Pass()); |
} |
+base::WeakPtr<ServiceRegistry> ServiceRegistryImpl::GetWeakPtr() { |
+ return weak_factory_.GetWeakPtr(); |
+} |
+ |
void ServiceRegistryImpl::GetInterface( |
const mojo::String& name, |
mojo::ScopedMessagePipeHandle client_handle) { |