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

Unified Diff: mojo/common/strong_binding_set.h

Issue 1556803002: Add helpers for creating UI components. (Closed) Base URL: git@github.com:domokit/mojo.git@moz-13
Patch Set: Created 4 years, 12 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 | « mojo/BUILD.gn ('k') | mojo/ui/BUILD.gn » ('j') | mojo/ui/BUILD.gn » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) {
« no previous file with comments | « mojo/BUILD.gn ('k') | mojo/ui/BUILD.gn » ('j') | mojo/ui/BUILD.gn » ('J')

Powered by Google App Engine
This is Rietveld 408576698