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

Unified Diff: base/callback_unittest.cc

Issue 2289703002: Add Callback::IsCancelled (Closed)
Patch Set: revert to PS5 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
« no previous file with comments | « base/callback_internal.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/callback_unittest.cc
diff --git a/base/callback_unittest.cc b/base/callback_unittest.cc
index 85ba20ee73ef772432d92e8f96b45ac6c27cb129..ad0430f247f381702644a629002e55e770852728 100644
--- a/base/callback_unittest.cc
+++ b/base/callback_unittest.cc
@@ -22,21 +22,27 @@ void NopInvokeFunc() {}
// chance of colliding with another instantiation and breaking the
// one-definition-rule.
struct FakeBindState1 : internal::BindStateBase {
- FakeBindState1() : BindStateBase(&NopInvokeFunc, &Destroy) {}
+ FakeBindState1() : BindStateBase(&NopInvokeFunc, &Destroy, &IsCancelled) {}
private:
~FakeBindState1() {}
static void Destroy(internal::BindStateBase* self) {
delete static_cast<FakeBindState1*>(self);
}
+ static bool IsCancelled(const internal::BindStateBase*) {
+ return false;
+ }
};
struct FakeBindState2 : internal::BindStateBase {
- FakeBindState2() : BindStateBase(&NopInvokeFunc, &Destroy) {}
+ FakeBindState2() : BindStateBase(&NopInvokeFunc, &Destroy, &IsCancelled) {}
private:
~FakeBindState2() {}
static void Destroy(internal::BindStateBase* self) {
delete static_cast<FakeBindState2*>(self);
}
+ static bool IsCancelled(const internal::BindStateBase*) {
+ return false;
+ }
};
namespace {
« no previous file with comments | « base/callback_internal.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698