5151#include " include/base/cef_atomic_ref_count.h"
5252#include " include/base/cef_build.h"
5353#include " include/base/cef_logging.h"
54- #include " include/base/cef_thread_collision_warner .h"
54+ #include " include/base/cef_macros .h"
5555
5656namespace base {
5757
@@ -60,6 +60,7 @@ namespace cef_subtle {
6060class RefCountedBase {
6161 public:
6262 bool HasOneRef () const { return ref_count_ == 1 ; }
63+ bool HasAtLeastOneRef () const { return ref_count_ >= 1 ; }
6364
6465 protected:
6566 RefCountedBase ()
@@ -78,10 +79,6 @@ class RefCountedBase {
7879 }
7980
8081 void AddRef () const {
81- // TODO(maruel): Add back once it doesn't assert 500 times/sec.
82- // Current thread books the critical section "AddRelease"
83- // without release it.
84- // DFAKE_SCOPED_LOCK_THREAD_LOCKED(add_release_);
8582#if DCHECK_IS_ON()
8683 DCHECK (!in_dtor_);
8784#endif
@@ -90,10 +87,6 @@ class RefCountedBase {
9087
9188 // Returns true if the object should self-delete.
9289 bool Release () const {
93- // TODO(maruel): Add back once it doesn't assert 500 times/sec.
94- // Current thread books the critical section "AddRelease"
95- // without release it.
96- // DFAKE_SCOPED_LOCK_THREAD_LOCKED(add_release_);
9790#if DCHECK_IS_ON()
9891 DCHECK (!in_dtor_);
9992#endif
@@ -112,14 +105,13 @@ class RefCountedBase {
112105 mutable bool in_dtor_;
113106#endif
114107
115- DFAKE_MUTEX (add_release_);
116-
117108 DISALLOW_COPY_AND_ASSIGN (RefCountedBase);
118109};
119110
120111class RefCountedThreadSafeBase {
121112 public:
122113 bool HasOneRef () const ;
114+ bool HasAtLeastOneRef () const ;
123115
124116 protected:
125117 RefCountedThreadSafeBase ();
0 commit comments