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

Unified Diff: base/memory/ref_counted.cc

Issue 2947863003: Make RefCountedThreadSafeBase::AddRef and Release available for inlining (Closed)
Patch Set: Created 3 years, 6 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/memory/ref_counted.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/memory/ref_counted.cc
diff --git a/base/memory/ref_counted.cc b/base/memory/ref_counted.cc
index f85ba5e40afbd2cc2e29026f06e23febb2eca1ab..bc8bd5fd1a7c811cd98f9c364d5b9b9de02697d3 100644
--- a/base/memory/ref_counted.cc
+++ b/base/memory/ref_counted.cc
@@ -28,31 +28,6 @@ RefCountedThreadSafeBase::~RefCountedThreadSafeBase() {
#endif
}
-void RefCountedThreadSafeBase::AddRef() const {
-#if DCHECK_IS_ON()
- DCHECK(!in_dtor_);
- DCHECK(!needs_adopt_ref_)
- << "This RefCounted object is created with non-zero reference count."
- << " The first reference to such a object has to be made by AdoptRef or"
- << " MakeRefCounted.";
-#endif
- AtomicRefCountInc(&ref_count_);
-}
-
-bool RefCountedThreadSafeBase::Release() const {
-#if DCHECK_IS_ON()
- DCHECK(!in_dtor_);
- DCHECK(!AtomicRefCountIsZero(&ref_count_));
-#endif
- if (!AtomicRefCountDec(&ref_count_)) {
-#if DCHECK_IS_ON()
- in_dtor_ = true;
-#endif
- return true;
- }
- return false;
-}
-
#if DCHECK_IS_ON()
bool RefCountedBase::CalledOnValidSequence() const {
return sequence_checker_.CalledOnValidSequence() ||
« no previous file with comments | « base/memory/ref_counted.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698