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

Unified Diff: base/callback_list.h.pump

Issue 23645019: C++ Readability Review for caitkp (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Nits Created 7 years, 2 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 | « base/callback_list.h ('k') | base/callback_list_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/callback_list.h.pump
diff --git a/base/callback_list.h.pump b/base/callback_list.h.pump
index 66295ec259dab56b59a66b77e7f9889b9d5cf3d2..168c70c2a3bf905e98ae0cbe3eec82e7565cd042 100644
--- a/base/callback_list.h.pump
+++ b/base/callback_list.h.pump
@@ -50,6 +50,8 @@ $var MAX_ARITY = 7
// }
//
// base::CallbackList<void(const Foo&)> callback_list_;
+//
+// DISALLOW_COPY_AND_ASSIGN(MyWidget);
// };
//
//
@@ -72,6 +74,8 @@ $var MAX_ARITY = 7
//
// scoped_ptr<base::CallbackList<void(const Foo&)>::Subscription>
// foo_subscription_;
+//
+// DISALLOW_COPY_AND_ASSIGN(MyWidgetListener);
// };
namespace base {
@@ -86,11 +90,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_);
}
@@ -150,8 +155,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_);
@@ -199,8 +203,7 @@ class CallbackList<void(void)>
]] $else [[
template <$for ARG , [[typename A$(ARG)]]>
class CallbackList<void($for ARG , [[A$(ARG)]])>
- : public internal::CallbackListBase<
- Callback<void($for ARG , [[A$(ARG)]])> > {
+ : public internal::CallbackListBase<Callback<void($for ARG , [[A$(ARG)]])> > {
]]
public:
@@ -228,7 +231,7 @@ $if ARITY == 0 [[
]]
CallbackType* cb;
- while((cb = it.GetNext()) != NULL) {
+ while ((cb = it.GetNext()) != NULL) {
cb->Run($for ARG , [[a$(ARG)]]);
}
}
« no previous file with comments | « base/callback_list.h ('k') | base/callback_list_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698