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

Side by Side Diff: Source/wtf/Assertions.h

Issue 216313002: Introduce ASSERT_ENABLED macro. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/dom/TreeShared.h ('k') | Source/wtf/BloomFilter.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2003, 2006, 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2003, 2006, 2007 Apple Inc. All rights reserved.
3 * Copyright (C) 2013 Google Inc. All rights reserved. 3 * Copyright (C) 2013 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 #define ASSERTIONS_DISABLED_DEFAULT 0 50 #define ASSERTIONS_DISABLED_DEFAULT 0
51 #endif 51 #endif
52 52
53 #ifndef BACKTRACE_DISABLED 53 #ifndef BACKTRACE_DISABLED
54 #define BACKTRACE_DISABLED ASSERTIONS_DISABLED_DEFAULT 54 #define BACKTRACE_DISABLED ASSERTIONS_DISABLED_DEFAULT
55 #endif 55 #endif
56 56
57 #ifndef ASSERT_DISABLED 57 #ifndef ASSERT_DISABLED
58 #define ASSERT_DISABLED ASSERTIONS_DISABLED_DEFAULT 58 #define ASSERT_DISABLED ASSERTIONS_DISABLED_DEFAULT
59 #endif 59 #endif
60 #define ASSERT_ENABLED !ASSERT_DISABLED
60 61
61 #ifndef ASSERT_MSG_DISABLED 62 #ifndef ASSERT_MSG_DISABLED
62 #define ASSERT_MSG_DISABLED ASSERTIONS_DISABLED_DEFAULT 63 #define ASSERT_MSG_DISABLED ASSERTIONS_DISABLED_DEFAULT
63 #endif 64 #endif
64 65
65 #ifndef ASSERT_ARG_DISABLED 66 #ifndef ASSERT_ARG_DISABLED
66 #define ASSERT_ARG_DISABLED ASSERTIONS_DISABLED_DEFAULT 67 #define ASSERT_ARG_DISABLED ASSERTIONS_DISABLED_DEFAULT
67 #endif 68 #endif
68 69
69 #ifndef FATAL_DISABLED 70 #ifndef FATAL_DISABLED
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 231
231 #define RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(assertion) ASSERT_WITH_SECURITY _IMPLICATION(assertion) 232 #define RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(assertion) ASSERT_WITH_SECURITY _IMPLICATION(assertion)
232 233
233 #else 234 #else
234 235
235 #define ASSERT_WITH_SECURITY_IMPLICATION(assertion) ASSERT(assertion) 236 #define ASSERT_WITH_SECURITY_IMPLICATION(assertion) ASSERT(assertion)
236 #define RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(assertion) RELEASE_ASSERT(asser tion) 237 #define RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(assertion) RELEASE_ASSERT(asser tion)
237 238
238 #endif 239 #endif
239 240
240 #if defined(ADDRESS_SANITIZER) || !ASSERT_DISABLED 241 #if defined(ADDRESS_SANITIZER) || ASSERT_ENABLED
241 #define SECURITY_ASSERT_ENABLED 1 242 #define SECURITY_ASSERT_ENABLED 1
242 #else 243 #else
243 #define SECURITY_ASSERT_ENABLED 0 244 #define SECURITY_ASSERT_ENABLED 0
244 #endif 245 #endif
245 246
246 /* ASSERT_WITH_MESSAGE */ 247 /* ASSERT_WITH_MESSAGE */
247 248
248 #if ASSERT_MSG_DISABLED 249 #if ASSERT_MSG_DISABLED
249 #define ASSERT_WITH_MESSAGE(assertion, ...) ((void)0) 250 #define ASSERT_WITH_MESSAGE(assertion, ...) ((void)0)
250 #else 251 #else
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
381 } \ 382 } \
382 inline const thisType& to##thisType(const argumentType& argumentName) \ 383 inline const thisType& to##thisType(const argumentType& argumentName) \
383 { \ 384 { \
384 ASSERT_WITH_SECURITY_IMPLICATION(referencePredicate); \ 385 ASSERT_WITH_SECURITY_IMPLICATION(referencePredicate); \
385 return static_cast<const thisType&>(argumentName); \ 386 return static_cast<const thisType&>(argumentName); \
386 } \ 387 } \
387 void to##thisType(const thisType*); \ 388 void to##thisType(const thisType*); \
388 void to##thisType(const thisType&) 389 void to##thisType(const thisType&)
389 390
390 #endif /* WTF_Assertions_h */ 391 #endif /* WTF_Assertions_h */
OLDNEW
« no previous file with comments | « Source/core/dom/TreeShared.h ('k') | Source/wtf/BloomFilter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698