| Index: base/ios/crb_protocol_observers.h
|
| diff --git a/base/ios/crb_protocol_observers.h b/base/ios/crb_protocol_observers.h
|
| index 15d16569ff84660365dceaf4088e2b8c9ecfda34..8ff587883659c00a36c2fdb064102272038ad956 100644
|
| --- a/base/ios/crb_protocol_observers.h
|
| +++ b/base/ios/crb_protocol_observers.h
|
| @@ -13,6 +13,10 @@ typedef void (^ExecutionWithObserverBlock)(id);
|
| // protocol. The container forwards method invocations to its contained
|
| // observers, so that sending a message to all the observers is as simple as
|
| // sending the message to the container.
|
| +// It is safe for an observer to remove itself or another observer while being
|
| +// notified. It is also safe to add an other observer while being notified but
|
| +// the newly added observer will not be notified as part of the current
|
| +// notification dispatch.
|
| @interface CRBProtocolObservers : NSObject
|
|
|
| // The Objective-C protocol that the observers in this container conform to.
|
| @@ -20,7 +24,7 @@ typedef void (^ExecutionWithObserverBlock)(id);
|
|
|
| // Returns a CRBProtocolObservers container for observers that conform to
|
| // |protocol|.
|
| -+ (CRBProtocolObservers*)observersWithProtocol:(Protocol*)protocol;
|
| ++ (instancetype)observersWithProtocol:(Protocol*)protocol;
|
|
|
| // Adds |observer| to this container.
|
| - (void)addObserver:(id)observer;
|
| @@ -28,6 +32,9 @@ typedef void (^ExecutionWithObserverBlock)(id);
|
| // Remove |observer| from this container.
|
| - (void)removeObserver:(id)observer;
|
|
|
| +// Returns true if there are currently no observers.
|
| +- (BOOL)empty;
|
| +
|
| // Executes callback on every observer. |callback| cannot be nil.
|
| - (void)executeOnObservers:(ExecutionWithObserverBlock)callback;
|
|
|
|
|