| Index: webrtc/base/refcount.h
|
| diff --git a/webrtc/base/refcount.h b/webrtc/base/refcount.h
|
| index 55ce23a348b68a84ce362d98f85c0f871725303a..550a7122ae2fe9c2f6c22d4ad506cd329c59596f 100644
|
| --- a/webrtc/base/refcount.h
|
| +++ b/webrtc/base/refcount.h
|
| @@ -107,15 +107,20 @@ class RefCountedObject : public T {
|
| return count;
|
| }
|
|
|
| + // This call returns the reference count, and performs the memory
|
| + // barrier needed for the owning thread to act on the object, in
|
| + // case the value of the reference count implies exclusive access to
|
| + // the object.
|
| + virtual int GetRefCount() const {
|
| + return AtomicOps::AcquireLoad(&ref_count_);
|
| + }
|
| // Return whether the reference count is one. If the reference count is used
|
| // in the conventional way, a reference count of 1 implies that the current
|
| // thread owns the reference and no other thread shares it. This call
|
| // performs the test for a reference count of one, and performs the memory
|
| // barrier needed for the owning thread to act on the object, knowing that it
|
| // has exclusive access to the object.
|
| - virtual bool HasOneRef() const {
|
| - return AtomicOps::AcquireLoad(&ref_count_) == 1;
|
| - }
|
| + virtual bool HasOneRef() const { return GetRefCount() == 1; }
|
|
|
| protected:
|
| virtual ~RefCountedObject() {
|
|
|