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

Unified Diff: base/callback_internal.cc

Issue 2344143002: Add const to BindStateBase to align RefCounted constness (Closed)
Patch Set: Created 4 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
Index: base/callback_internal.cc
diff --git a/base/callback_internal.cc b/base/callback_internal.cc
index 5759a74532ed28624c0fa4050489ad084a1c86f4..4afd567f0fe32ee65c911f8a1cf55c061c7b95c3 100644
--- a/base/callback_internal.cc
+++ b/base/callback_internal.cc
@@ -18,23 +18,23 @@ bool ReturnFalse(const BindStateBase*) {
} // namespace
BindStateBase::BindStateBase(InvokeFuncStorage polymorphic_invoke,
- void (*destructor)(BindStateBase*))
+ void (*destructor)(const BindStateBase*))
: BindStateBase(polymorphic_invoke, destructor, &ReturnFalse) {
}
BindStateBase::BindStateBase(InvokeFuncStorage polymorphic_invoke,
- void (*destructor)(BindStateBase*),
+ void (*destructor)(const BindStateBase*),
bool (*is_cancelled)(const BindStateBase*))
: polymorphic_invoke_(polymorphic_invoke),
ref_count_(0),
destructor_(destructor),
is_cancelled_(is_cancelled) {}
-void BindStateBase::AddRef() {
+void BindStateBase::AddRef() const {
AtomicRefCountInc(&ref_count_);
}
-void BindStateBase::Release() {
+void BindStateBase::Release() const {
if (!AtomicRefCountDec(&ref_count_))
destructor_(this);
}

Powered by Google App Engine
This is Rietveld 408576698