Add a callback to the list. The callback will remain registered until the returned Subscription is destroyed, which must occur before the CallbackList is destroyed.
| 143 | // returned Subscription is destroyed, which must occur before the |
| 144 | // CallbackList is destroyed. |
| 145 | scoped_ptr<Subscription> Add(const CallbackType& cb) WARN_UNUSED_RESULT { |
| 146 | DCHECK(!cb.is_null()); |
| 147 | return scoped_ptr<Subscription>( |
| 148 | new Subscription(this, callbacks_.insert(callbacks_.end(), cb))); |
| 149 | } |
| 150 | |
| 151 | // Sets a callback which will be run when a subscription list is changed. |
| 152 | void set_removal_callback(const Closure& callback) { |
no test coverage detected