OLD | NEW |
1 // This file was GENERATED by command: | 1 // This file was GENERATED by command: |
2 // pump.py callback_list.h.pump | 2 // pump.py callback_list.h.pump |
3 // DO NOT EDIT BY HAND!!! | 3 // DO NOT EDIT BY HAND!!! |
4 | 4 |
5 | 5 |
6 // Copyright 2013 The Chromium Authors. All rights reserved. | 6 // Copyright 2013 The Chromium Authors. All rights reserved. |
7 // Use of this source code is governed by a BSD-style license that can be | 7 // Use of this source code is governed by a BSD-style license that can be |
8 // found in the LICENSE file. | 8 // found in the LICENSE file. |
9 | 9 |
10 #ifndef BASE_CALLBACK_LIST_H_ | 10 #ifndef BASE_CALLBACK_LIST_H_ |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 private: | 98 private: |
99 CallbackListBase<CallbackType>* list_; | 99 CallbackListBase<CallbackType>* list_; |
100 typename std::list<CallbackType>::iterator iter_; | 100 typename std::list<CallbackType>::iterator iter_; |
101 | 101 |
102 DISALLOW_COPY_AND_ASSIGN(Subscription); | 102 DISALLOW_COPY_AND_ASSIGN(Subscription); |
103 }; | 103 }; |
104 | 104 |
105 // Add a callback to the list. The callback will remain registered until the | 105 // Add a callback to the list. The callback will remain registered until the |
106 // returned Subscription is destroyed, which must occur before the | 106 // returned Subscription is destroyed, which must occur before the |
107 // CallbackList is destroyed. | 107 // CallbackList is destroyed. |
108 scoped_ptr<Subscription> Add(const CallbackType& cb) { | 108 scoped_ptr<Subscription> Add(const CallbackType& cb) WARN_UNUSED_RESULT { |
109 DCHECK(!cb.is_null()); | 109 DCHECK(!cb.is_null()); |
110 return scoped_ptr<Subscription>( | 110 return scoped_ptr<Subscription>( |
111 new Subscription(this, callbacks_.insert(callbacks_.end(), cb))); | 111 new Subscription(this, callbacks_.insert(callbacks_.end(), cb))); |
112 } | 112 } |
113 | 113 |
114 protected: | 114 protected: |
115 // An iterator class that can be used to access the list of callbacks. | 115 // An iterator class that can be used to access the list of callbacks. |
116 class Iterator { | 116 class Iterator { |
117 public: | 117 public: |
118 explicit Iterator(CallbackListBase<CallbackType>* list) | 118 explicit Iterator(CallbackListBase<CallbackType>* list) |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
375 } | 375 } |
376 } | 376 } |
377 | 377 |
378 private: | 378 private: |
379 DISALLOW_COPY_AND_ASSIGN(CallbackList); | 379 DISALLOW_COPY_AND_ASSIGN(CallbackList); |
380 }; | 380 }; |
381 | 381 |
382 } // namespace base | 382 } // namespace base |
383 | 383 |
384 #endif // BASE_CALLBACK_LIST_H_ | 384 #endif // BASE_CALLBACK_LIST_H_ |
OLD | NEW |