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

Unified Diff: base/callback_internal.cc

Issue 2322313002: Split BindStateBase ctor for non-cancellable Bind (Closed)
Patch Set: revert to PS2 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.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/callback_internal.cc
diff --git a/base/callback_internal.cc b/base/callback_internal.cc
index b37a319f103eeef925b36a281d4ad6f30f78757f..5759a74532ed28624c0fa4050489ad084a1c86f4 100644
--- a/base/callback_internal.cc
+++ b/base/callback_internal.cc
@@ -9,13 +9,26 @@
namespace base {
namespace internal {
+namespace {
+
+bool ReturnFalse(const BindStateBase*) {
+ return false;
+}
+
+} // namespace
+
+BindStateBase::BindStateBase(InvokeFuncStorage polymorphic_invoke,
+ void (*destructor)(BindStateBase*))
+ : BindStateBase(polymorphic_invoke, destructor, &ReturnFalse) {
+}
+
BindStateBase::BindStateBase(InvokeFuncStorage polymorphic_invoke,
void (*destructor)(BindStateBase*),
bool (*is_cancelled)(const BindStateBase*))
- : polymorphic_invoke_(polymorphic_invoke),
- ref_count_(0),
- destructor_(destructor),
- is_cancelled_(is_cancelled) {}
+ : polymorphic_invoke_(polymorphic_invoke),
+ ref_count_(0),
+ destructor_(destructor),
+ is_cancelled_(is_cancelled) {}
void BindStateBase::AddRef() {
AtomicRefCountInc(&ref_count_);
« no previous file with comments | « base/callback_internal.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698