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

Unified Diff: base/callback_list.h

Issue 23645019: C++ Readability Review for caitkp (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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 | « no previous file | base/callback_list.h.pump » ('j') | base/callback_list_unittest.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/callback_list.h
diff --git a/base/callback_list.h b/base/callback_list.h
index ead92eadee345477046a5d1d95b40956d0e7ebe0..2db23b2da8c5b65145ea09344a82a6eb106bfc1a 100644
--- a/base/callback_list.h
+++ b/base/callback_list.h
@@ -45,6 +45,8 @@
// }
//
// base::CallbackList<void(const Foo&)> callback_list_;
+//
+// DISALLOW_COPY_AND_ASSIGN(MyWidget);
// };
//
//
@@ -67,6 +69,8 @@
//
// scoped_ptr<base::CallbackList<void(const Foo&)>::Subscription>
// foo_subscription_;
+//
+// DISALLOW_COPY_AND_ASSIGN(MyWidgetListener);
// };
namespace base {
@@ -81,11 +85,12 @@ class CallbackListBase {
Subscription(CallbackListBase<CallbackType>* list,
typename std::list<CallbackType>::iterator iter)
: list_(list),
- iter_(iter) {}
+ iter_(iter) {
+ }
~Subscription() {
if (list_->active_iterator_count_)
- (*iter_).Reset();
+ iter_->Reset();
else
list_->callbacks_.erase(iter_);
}
@@ -145,8 +150,7 @@ class CallbackListBase {
typename std::list<CallbackType>::iterator list_iter_;
};
- CallbackListBase()
- : active_iterator_count_(0) {}
+ CallbackListBase() : active_iterator_count_(0) {}
~CallbackListBase() {
DCHECK_EQ(0, active_iterator_count_);
« no previous file with comments | « no previous file | base/callback_list.h.pump » ('j') | base/callback_list_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698