mojo::StrongBindingPtr is a nice way to setup connections.
- They handle self destruction in response to onConnectionError
- They delete the mojo interface implementation as well
- They are a base::WeakPtr which allows the code that creates it to cleanly know not to perform more actions, as it is already dead
- They provide a method to close the connection
- They offer a callback for when they are self destructing
However we currently lack a nice way for handling several mojo::StrongBindingPtr within a container. This can lead to containers bloating with several cleared base::WeakPtrs, and requires callsites to clean up their own containers.
mojo::PtrSet is a similar construct used for several observer patterns. This container similarly clears out base::WeakPtrs, however only upon subsequent actions performed on the set.
I would like to make a container for mojo::StrongBindingPtr which listens for the destruction, and removes the cleared base::WeakPtrs from itself.
Comment 1 by jonr...@chromium.org
, Feb 21 2017