From 66105a541735394f692b0337fef80126b825f816 Mon Sep 17 00:00:00 2001 From: Marshall Greenblatt Date: Sat, 12 Oct 2024 14:10:40 -0400 Subject: [PATCH] Add CefRefCount::SubtleRefCountForDebug Helper for debugging refcount-related issues. --- include/cef_base.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/cef_base.h b/include/cef_base.h index bd8f11ed4..03221d111 100644 --- a/include/cef_base.h +++ b/include/cef_base.h @@ -116,6 +116,14 @@ class CefRefCount { /// bool HasAtLeastOneRef() const { return !ref_count_.IsZero(); } + /// + /// Returns the current reference count (with no barriers). This is subtle, + /// and should be used only for debugging. + /// + int SubtleRefCountForDebug() const { + return ref_count_.SubtleRefCountForDebug(); + } + private: mutable base::AtomicRefCount ref_count_{0}; };