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

Unified Diff: base/callback_unittest.cc

Issue 2317563002: Move CallbackBase::polymorphic_invoke_ into BindStateBase (Closed)
Patch Set: rebase 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 ce453a10758e72f9a8799ba2db2b350588c508a6..85ba20ee73ef772432d92e8f96b45ac6c27cb129 100644
--- a/base/callback_unittest.cc
+++ b/base/callback_unittest.cc
@@ -14,7 +14,7 @@
namespace base {
-void NopInvokeFunc(internal::BindStateBase*) {}
+void NopInvokeFunc() {}
// White-box testpoints to inject into a Callback<> object for checking
// comparators and emptiness APIs. Use a BindState that is specialized
@@ -22,7 +22,7 @@ void NopInvokeFunc(internal::BindStateBase*) {}
// chance of colliding with another instantiation and breaking the
// one-definition-rule.
struct FakeBindState1 : internal::BindStateBase {
- FakeBindState1() : BindStateBase(&Destroy) {}
+ FakeBindState1() : BindStateBase(&NopInvokeFunc, &Destroy) {}
private:
~FakeBindState1() {}
static void Destroy(internal::BindStateBase* self) {
@@ -31,7 +31,7 @@ struct FakeBindState1 : internal::BindStateBase {
};
struct FakeBindState2 : internal::BindStateBase {
- FakeBindState2() : BindStateBase(&Destroy) {}
+ FakeBindState2() : BindStateBase(&NopInvokeFunc, &Destroy) {}
private:
~FakeBindState2() {}
static void Destroy(internal::BindStateBase* self) {
@@ -44,8 +44,8 @@ namespace {
class CallbackTest : public ::testing::Test {
public:
CallbackTest()
- : callback_a_(new FakeBindState1(), &NopInvokeFunc),
- callback_b_(new FakeBindState2(), &NopInvokeFunc) {
+ : callback_a_(new FakeBindState1()),
+ callback_b_(new FakeBindState2()) {
}
~CallbackTest() override {}
@@ -88,7 +88,7 @@ TEST_F(CallbackTest, Equals) {
EXPECT_FALSE(callback_b_.Equals(callback_a_));
// We should compare based on instance, not type.
- Callback<void()> callback_c(new FakeBindState1(), &NopInvokeFunc);
+ Callback<void()> callback_c(new FakeBindState1());
Callback<void()> callback_a2 = callback_a_;
EXPECT_TRUE(callback_a_.Equals(callback_a2));
EXPECT_FALSE(callback_a_.Equals(callback_c));
« 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