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

Side by Side Diff: base/callback_internal.cc

Issue 2310093003: Make BindStateBase constructor out-of-line (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 unified diff | Download patch
« no previous file with comments | « base/callback_internal.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/callback_internal.h" 5 #include "base/callback_internal.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 8
9 namespace base { 9 namespace base {
10 namespace internal { 10 namespace internal {
11 11
12 BindStateBase::BindStateBase(InvokeFuncStorage polymorphic_invoke,
13 void (*destructor)(BindStateBase*))
14 : polymorphic_invoke_(polymorphic_invoke),
15 ref_count_(0), destructor_(destructor) {}
16
12 void BindStateBase::AddRef() { 17 void BindStateBase::AddRef() {
13 AtomicRefCountInc(&ref_count_); 18 AtomicRefCountInc(&ref_count_);
14 } 19 }
15 20
16 void BindStateBase::Release() { 21 void BindStateBase::Release() {
17 if (!AtomicRefCountDec(&ref_count_)) 22 if (!AtomicRefCountDec(&ref_count_))
18 destructor_(this); 23 destructor_(this);
19 } 24 }
20 25
21 CallbackBase<CopyMode::MoveOnly>::CallbackBase(CallbackBase&& c) = default; 26 CallbackBase<CopyMode::MoveOnly>::CallbackBase(CallbackBase&& c) = default;
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 } 62 }
58 63
59 CallbackBase<CopyMode::Copyable>& 64 CallbackBase<CopyMode::Copyable>&
60 CallbackBase<CopyMode::Copyable>::operator=(CallbackBase&& c) = default; 65 CallbackBase<CopyMode::Copyable>::operator=(CallbackBase&& c) = default;
61 66
62 template class CallbackBase<CopyMode::MoveOnly>; 67 template class CallbackBase<CopyMode::MoveOnly>;
63 template class CallbackBase<CopyMode::Copyable>; 68 template class CallbackBase<CopyMode::Copyable>;
64 69
65 } // namespace internal 70 } // namespace internal
66 } // namespace base 71 } // namespace base
OLDNEW
« 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