summaryrefslogtreecommitdiffstats
path: root/base/ref_counted.cc
diff options
context:
space:
mode:
Diffstat (limited to 'base/ref_counted.cc')
-rw-r--r--base/ref_counted.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/base/ref_counted.cc b/base/ref_counted.cc
index d278b3b..d272567 100644
--- a/base/ref_counted.cc
+++ b/base/ref_counted.cc
@@ -83,6 +83,11 @@ bool RefCountedThreadSafeBase::Release() {
return false;
}
+bool RefCountedThreadSafeBase::HasOneRef() const {
+ return AtomicRefCountIsOne(
+ &const_cast<RefCountedThreadSafeBase*>(this)->ref_count_);
+}
+
} // namespace subtle
} // namespace base