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

Unified Diff: Source/wtf/Assertions.h

Issue 394353002: Replace tests of ASSERT_ENABLED with ENABLE(ASSERT). (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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/Assertions.h
diff --git a/Source/wtf/Assertions.h b/Source/wtf/Assertions.h
index 612b389fe7bb53594268a44a09871cdc456fdd8d..d4b281ab636389883abad7ea34a03b0551f35bbe 100644
--- a/Source/wtf/Assertions.h
+++ b/Source/wtf/Assertions.h
@@ -54,29 +54,31 @@
#define BACKTRACE_DISABLED ASSERTIONS_DISABLED_DEFAULT
#endif
-#ifndef ASSERT_ENABLED
+// Users must test "#if ENABLE(ASSERT)", which helps ensure that code
Ken Russell (switch to Gerrit) 2014/07/16 22:04:56 The changes in this file were done by hand.
+// testing this macro has included this header.
+#ifndef ENABLE_ASSERT
// Notice the not below:
-#define ASSERT_ENABLED !ASSERTIONS_DISABLED_DEFAULT
+#define ENABLE_ASSERT !ASSERTIONS_DISABLED_DEFAULT
#endif
#ifndef ASSERT_MSG_DISABLED
-#define ASSERT_MSG_DISABLED ASSERTIONS_DISABLED_DEFAULT
+#define ASSERT_MSG_DISABLED !ENABLE(ASSERT)
#endif
#ifndef ASSERT_ARG_DISABLED
-#define ASSERT_ARG_DISABLED ASSERTIONS_DISABLED_DEFAULT
+#define ASSERT_ARG_DISABLED !ENABLE(ASSERT)
#endif
#ifndef FATAL_DISABLED
-#define FATAL_DISABLED ASSERTIONS_DISABLED_DEFAULT
+#define FATAL_DISABLED !ENABLE(ASSERT)
#endif
#ifndef ERROR_DISABLED
-#define ERROR_DISABLED ASSERTIONS_DISABLED_DEFAULT
+#define ERROR_DISABLED !ENABLE(ASSERT)
#endif
#ifndef LOG_DISABLED
-#define LOG_DISABLED ASSERTIONS_DISABLED_DEFAULT
+#define LOG_DISABLED !ENABLE(ASSERT)
#endif
/* WTF logging functions can process %@ in the format string to log a NSObject* but the printf format attribute
@@ -196,7 +198,7 @@ using WTF::FrameToNameScope;
#undef ASSERT
#endif
-#if ASSERT_ENABLED
+#if ENABLE(ASSERT)
#define ASSERT(assertion) \
(!(assertion) ? \
@@ -255,10 +257,12 @@ using WTF::FrameToNameScope;
#endif
-#if defined(ADDRESS_SANITIZER) || ASSERT_ENABLED
-#define SECURITY_ASSERT_ENABLED 1
+// Users must test "#if ENABLE(SECURITY_ASSERT)", which helps ensure
+// that code testing this macro has included this header.
+#if defined(ADDRESS_SANITIZER) || ENABLE(ASSERT)
+#define ENABLE_SECURITY_ASSERT 1
#else
-#define SECURITY_ASSERT_ENABLED 0
+#define ENABLE_SECURITY_ASSERT 0
#endif
/* ASSERT_WITH_MESSAGE */
@@ -369,7 +373,7 @@ static inline void UNREACHABLE_FOR_PLATFORM()
http://code.google.com/p/chromium/issues/entry?template=Security%20Bug
*/
-#if ASSERT_ENABLED
+#if ENABLE(ASSERT)
#define RELEASE_ASSERT(assertion) ASSERT(assertion)
#define RELEASE_ASSERT_WITH_MESSAGE(assertion, ...) ASSERT_WITH_MESSAGE(assertion, __VA_ARGS__)
#define RELEASE_ASSERT_NOT_REACHED() ASSERT_NOT_REACHED()

Powered by Google App Engine
This is Rietveld 408576698