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

Unified Diff: Source/wtf/Assertions.h

Issue 331793004: Delete ASSERT_DISABLED (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add missing include Created 6 years, 6 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
« no previous file with comments | « Source/platform/mac/BlockExceptions.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/wtf/Assertions.h
diff --git a/Source/wtf/Assertions.h b/Source/wtf/Assertions.h
index ca91dd2bcf039897f93153a6b7e186ac617cf999..7f57c8951f51632f4d236417e06572928ea85454 100644
--- a/Source/wtf/Assertions.h
+++ b/Source/wtf/Assertions.h
@@ -54,10 +54,10 @@
#define BACKTRACE_DISABLED ASSERTIONS_DISABLED_DEFAULT
#endif
-#ifndef ASSERT_DISABLED
-#define ASSERT_DISABLED ASSERTIONS_DISABLED_DEFAULT
+#ifndef ASSERT_ENABLED
+// Notice the not below:
+#define ASSERT_ENABLED !ASSERTIONS_DISABLED_DEFAULT
#endif
-#define ASSERT_ENABLED !ASSERT_DISABLED
#ifndef ASSERT_MSG_DISABLED
#define ASSERT_MSG_DISABLED ASSERTIONS_DISABLED_DEFAULT
@@ -179,16 +179,7 @@ WTF_EXPORT void WTFInstallReportBacktraceOnCrashHook();
#undef ASSERT
#endif
-#if ASSERT_DISABLED
-
-#define ASSERT(assertion) ((void)0)
-#define ASSERT_AT(assertion, file, line, function) ((void)0)
-#define ASSERT_NOT_REACHED() ((void)0)
-#define NO_RETURN_DUE_TO_ASSERT
-
-#define ASSERT_UNUSED(variable, assertion) ((void)variable)
-
-#else
+#if ASSERT_ENABLED
#define ASSERT(assertion) \
(!(assertion) ? \
@@ -211,6 +202,15 @@ WTF_EXPORT void WTFInstallReportBacktraceOnCrashHook();
#define NO_RETURN_DUE_TO_ASSERT NO_RETURN_DUE_TO_CRASH
+#else
+
+#define ASSERT(assertion) ((void)0)
+#define ASSERT_AT(assertion, file, line, function) ((void)0)
+#define ASSERT_NOT_REACHED() ((void)0)
+#define NO_RETURN_DUE_TO_ASSERT
+
+#define ASSERT_UNUSED(variable, assertion) ((void)variable)
+
#endif
/* ASSERT_WITH_SECURITY_IMPLICATION / RELEASE_ASSERT_WITH_SECURITY_IMPLICATION
@@ -352,14 +352,14 @@ static inline void UNREACHABLE_FOR_PLATFORM()
http://code.google.com/p/chromium/issues/entry?template=Security%20Bug
*/
-#if ASSERT_DISABLED
-#define RELEASE_ASSERT(assertion) (UNLIKELY(!(assertion)) ? (IMMEDIATE_CRASH()) : (void)0)
-#define RELEASE_ASSERT_WITH_MESSAGE(assertion, ...) RELEASE_ASSERT(assertion)
-#define RELEASE_ASSERT_NOT_REACHED() IMMEDIATE_CRASH()
-#else
+#if ASSERT_ENABLED
#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()
+#else
+#define RELEASE_ASSERT(assertion) (UNLIKELY(!(assertion)) ? (IMMEDIATE_CRASH()) : (void)0)
+#define RELEASE_ASSERT_WITH_MESSAGE(assertion, ...) RELEASE_ASSERT(assertion)
+#define RELEASE_ASSERT_NOT_REACHED() IMMEDIATE_CRASH()
#endif
/* DEFINE_COMPARISON_OPERATORS_WITH_REFERENCES */
« no previous file with comments | « Source/platform/mac/BlockExceptions.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698