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

Unified Diff: base/callback_unittest.cc

Issue 1129353003: Devirtualize base::BindState to save ~1% of Chrome's binary size (~1MB) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@20150507-SizesExplorations
Patch Set: Keep the DCHECK Created 5 years, 7 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 5644b8515f0e538942d69c945cae2b56b0a075cd..2844aa98a29317149eaaf493b3d9f92b3f7fff0b 100644
--- a/base/callback_unittest.cc
+++ b/base/callback_unittest.cc
@@ -35,9 +35,13 @@ template <>
struct BindState<void(void), void(void), void(FakeInvoker)>
: public BindStateBase {
public:
+ BindState() : BindStateBase(&Destroy) {}
typedef FakeInvoker InvokerType;
private:
- ~BindState() override {}
+ ~BindState() {}
+ static void Destroy(BindStateBase* self) {
+ delete static_cast<BindState*>(self);
+ }
};
template <>
@@ -45,9 +49,13 @@ struct BindState<void(void), void(void),
void(FakeInvoker, FakeInvoker)>
: public BindStateBase {
public:
+ BindState() : BindStateBase(&Destroy) {}
typedef FakeInvoker InvokerType;
private:
- ~BindState() override {}
+ ~BindState() {}
+ static void Destroy(BindStateBase* self) {
+ delete static_cast<BindState*>(self);
+ }
};
} // namespace internal
« 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