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

Unified Diff: Source/wtf/RefCounted.h

Issue 397733004: Allow assertions to be enabled in Blink Release builds. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixed config.gni. Minor cleanups. Created 6 years, 5 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
Index: Source/wtf/RefCounted.h
diff --git a/Source/wtf/RefCounted.h b/Source/wtf/RefCounted.h
index 2e248d90d529d5a73b8cf925fc340e00d3c1a76e..823cc064d17ece4ddb0f6765492a63fc462470dd 100644
--- a/Source/wtf/RefCounted.h
+++ b/Source/wtf/RefCounted.h
@@ -21,17 +21,17 @@
#ifndef RefCounted_h
#define RefCounted_h
+#include "wtf/Assertions.h"
#include "wtf/FastAllocBase.h"
#include "wtf/InstanceCounter.h"
#include "wtf/Noncopyable.h"
#include "wtf/WTFExport.h"
-#ifdef NDEBUG
-#define CHECK_REF_COUNTED_LIFECYCLE 0
-#else
+#if ENABLE(ASSERT)
#define CHECK_REF_COUNTED_LIFECYCLE 1
-#include "wtf/Assertions.h"
#include "wtf/ThreadRestrictionVerifier.h"
+#else
+#define CHECK_REF_COUNTED_LIFECYCLE 0
#endif
namespace WTF {
@@ -82,7 +82,7 @@ public:
protected:
RefCountedBase()
: m_refCount(1)
-#if SECURITY_ASSERT_ENABLED
+#if ENABLE(SECURITY_ASSERT)
, m_deletionHasBegun(false)
#endif
#if CHECK_REF_COUNTED_LIFECYCLE
@@ -111,7 +111,7 @@ protected:
ASSERT(m_refCount > 0);
--m_refCount;
if (!m_refCount) {
-#if SECURITY_ASSERT_ENABLED
+#if ENABLE(SECURITY_ASSERT)
m_deletionHasBegun = true;
#endif
return true;
@@ -135,12 +135,12 @@ protected:
private:
-#if CHECK_REF_COUNTED_LIFECYCLE || SECURITY_ASSERT_ENABLED
+#if CHECK_REF_COUNTED_LIFECYCLE || ENABLE(SECURITY_ASSERT)
friend void adopted(RefCountedBase*);
#endif
int m_refCount;
-#if SECURITY_ASSERT_ENABLED
+#if ENABLE(SECURITY_ASSERT)
bool m_deletionHasBegun;
#endif
#if CHECK_REF_COUNTED_LIFECYCLE
@@ -149,7 +149,7 @@ private:
#endif
};
-#if CHECK_REF_COUNTED_LIFECYCLE || SECURITY_ASSERT_ENABLED
+#if CHECK_REF_COUNTED_LIFECYCLE || ENABLE(SECURITY_ASSERT)
inline void adopted(RefCountedBase* object)
{
if (!object)

Powered by Google App Engine
This is Rietveld 408576698