Index: services/shell/public/cpp/lib/interface_registry.cc |
diff --git a/services/shell/public/cpp/lib/interface_registry.cc b/services/shell/public/cpp/lib/interface_registry.cc |
index a4657b24e8304fc825e1892fffb2367a7e224ec8..f1b9ca9e617c0816318f8b0fbcfa8fe8a26818a3 100644 |
--- a/services/shell/public/cpp/lib/interface_registry.cc |
+++ b/services/shell/public/cpp/lib/interface_registry.cc |
@@ -9,7 +9,7 @@ |
namespace shell { |
InterfaceRegistry::InterfaceRegistry(Connection* connection) |
- : binding_(this), connection_(connection) {} |
+ : binding_(this), connection_(connection), weak_factory_(this) {} |
InterfaceRegistry::~InterfaceRegistry() {} |
void InterfaceRegistry::Bind( |
@@ -18,6 +18,10 @@ void InterfaceRegistry::Bind( |
binding_.Bind(std::move(local_interfaces_request)); |
} |
+base::WeakPtr<InterfaceRegistry> InterfaceRegistry::GetWeakPtr() { |
+ return weak_factory_.GetWeakPtr(); |
+} |
+ |
void InterfaceRegistry::RemoveInterface(const std::string& name) { |
auto it = name_to_binder_.find(name); |
if (it != name_to_binder_.end()) |