Index: base/callback_internal.cc |
diff --git a/base/callback_internal.cc b/base/callback_internal.cc |
index 303de4d71b84d148557f17bbf388cb35849e0622..e29dd694efb5e2fabc899ef1183fbac333b042b2 100644 |
--- a/base/callback_internal.cc |
+++ b/base/callback_internal.cc |
@@ -10,9 +10,12 @@ namespace base { |
namespace internal { |
BindStateBase::BindStateBase(InvokeFuncStorage polymorphic_invoke, |
- void (*destructor)(BindStateBase*)) |
+ void (*destructor)(BindStateBase*), |
+ bool (*is_cancelled)(const BindStateBase*)) |
: polymorphic_invoke_(polymorphic_invoke), |
- ref_count_(0), destructor_(destructor) {} |
+ ref_count_(0), |
+ destructor_(destructor), |
+ is_cancelled_(is_cancelled) {} |
void BindStateBase::AddRef() { |
AtomicRefCountInc(&ref_count_); |
@@ -34,6 +37,11 @@ void CallbackBase<CopyMode::MoveOnly>::Reset() { |
bind_state_ = nullptr; |
} |
+bool CallbackBase<CopyMode::MoveOnly>::IsCancelled() const { |
+ DCHECK(bind_state_); |
+ return bind_state_->IsCancelled(); |
+} |
+ |
bool CallbackBase<CopyMode::MoveOnly>::EqualsInternal( |
const CallbackBase& other) const { |
return bind_state_ == other.bind_state_; |