Index: mojo/common/strong_binding_set.h |
diff --git a/mojo/common/strong_binding_set.h b/mojo/common/strong_binding_set.h |
index 95467d892c0745a2c4f8b681c04c292dcb08b6a7..99b25ea4d2214fec08cb936447ee8c4a4859d082 100644 |
--- a/mojo/common/strong_binding_set.h |
+++ b/mojo/common/strong_binding_set.h |
@@ -44,6 +44,16 @@ class StrongBindingSet { |
}); |
} |
+ // Removes all bindings for the specified interface implementation. |
+ // The implementation object is not destroyed. |
+ void RemoveBindings(Interface* impl) { |
+ bindings_.erase( |
+ std::remove_if(bindings_.begin(), bindings_.end(), |
+ [impl](const std::unique_ptr<Binding<Interface>>& b) { |
+ return (b->impl() == impl); |
+ })); |
+ } |
+ |
// Closes all bindings and deletes their associated interfaces. |
void CloseAllBindings() { |
for (auto it = bindings_.begin(); it != bindings_.end(); ++it) { |