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

Unified Diff: base/callback_internal.cc

Issue 2042223002: Introduce OnceClosure and BindOnce (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: swap Once & Repeating positions 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') | base/callback_unittest.nc » ('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 e29dd694efb5e2fabc899ef1183fbac333b042b2..b37a319f103eeef925b36a281d4ad6f30f78757f 100644
--- a/base/callback_internal.cc
+++ b/base/callback_internal.cc
@@ -31,6 +31,16 @@ CallbackBase<CopyMode::MoveOnly>::CallbackBase(CallbackBase&& c) = default;
CallbackBase<CopyMode::MoveOnly>&
CallbackBase<CopyMode::MoveOnly>::operator=(CallbackBase&& c) = default;
+CallbackBase<CopyMode::MoveOnly>::CallbackBase(
+ const CallbackBase<CopyMode::Copyable>& c)
+ : bind_state_(c.bind_state_) {}
+
+CallbackBase<CopyMode::MoveOnly>& CallbackBase<CopyMode::MoveOnly>::operator=(
+ const CallbackBase<CopyMode::Copyable>& c) {
+ bind_state_ = c.bind_state_;
+ return *this;
+}
+
void CallbackBase<CopyMode::MoveOnly>::Reset() {
// NULL the bind_state_ last, since it may be holding the last ref to whatever
// object owns us, and we may be deleted after that.
« no previous file with comments | « base/callback_internal.h ('k') | base/callback_unittest.nc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698