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

Unified Diff: base/callback_internal.cc

Issue 8915024: Retry 114494 - Remove BindStateHolder and have Bind() return a Callback<> object directly." (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 9 years 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') | base/callback_unittest.cc » ('j') | 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 582fbdc12c43b520f81e5684c3dde02072e476ea..a483293257e445224c6c6148bc8e7c5a6ff2db58 100644
--- a/base/callback_internal.cc
+++ b/base/callback_internal.cc
@@ -4,6 +4,8 @@
#include "base/callback_internal.h"
+#include "base/logging.h"
+
namespace base {
namespace internal {
@@ -21,12 +23,10 @@ bool CallbackBase::Equals(const CallbackBase& other) const {
polymorphic_invoke_ == other.polymorphic_invoke_;
}
-CallbackBase::CallbackBase(InvokeFuncStorage polymorphic_invoke,
- scoped_refptr<BindStateBase>* bind_state)
- : polymorphic_invoke_(polymorphic_invoke) {
- if (bind_state) {
- bind_state_.swap(*bind_state);
- }
+CallbackBase::CallbackBase(BindStateBase* bind_state)
+ : bind_state_(bind_state),
+ polymorphic_invoke_(NULL) {
+ DCHECK(!bind_state_ || bind_state_->HasOneRef());
}
CallbackBase::~CallbackBase() {
« no previous file with comments | « base/callback_internal.h ('k') | base/callback_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698