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

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

Issue 2544443002: Add a comment that CHECK should not be used until the performance issue is fixed. (Closed)
Patch Set: Created 4 years 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
« no previous file with comments | « no previous file | no next file » | 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 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 #else 204 #else
205 #define SECURITY_DCHECK(condition) ((void)0) 205 #define SECURITY_DCHECK(condition) ((void)0)
206 #define SECURITY_CHECK(condition) CHECK(condition) 206 #define SECURITY_CHECK(condition) CHECK(condition)
207 #endif 207 #endif
208 208
209 // RELEASE_ASSERT 209 // RELEASE_ASSERT
210 // Use in places where failure of an assertion indicates a definite security 210 // Use in places where failure of an assertion indicates a definite security
211 // vulnerability from which execution must not continue even in a release build. 211 // vulnerability from which execution must not continue even in a release build.
212 // Please sure to file bugs for these failures using the security template: 212 // Please sure to file bugs for these failures using the security template:
213 // http://code.google.com/p/chromium/issues/entry?template=Security%20Bug 213 // http://code.google.com/p/chromium/issues/entry?template=Security%20Bug
214 // RELEASE_ASSERT is deprecated. We should use CHECK() instead. 214 //
215 // WARNING: CHECK is slower than RELEASE_ASSERT on MSVC. We should not replace
216 // RELEASE_ASSERT with CHECK until the performance issue is fixed
217 // (crbug.com/596760).
215 #if ENABLE(ASSERT) 218 #if ENABLE(ASSERT)
216 #define RELEASE_ASSERT(assertion) ASSERT(assertion) 219 #define RELEASE_ASSERT(assertion) ASSERT(assertion)
217 #elif defined(ADDRESS_SANITIZER) 220 #elif defined(ADDRESS_SANITIZER)
218 #define RELEASE_ASSERT(condition) SECURITY_CHECK(condition) 221 #define RELEASE_ASSERT(condition) SECURITY_CHECK(condition)
219 #else 222 #else
220 #define RELEASE_ASSERT(assertion) \ 223 #define RELEASE_ASSERT(assertion) \
221 (UNLIKELY(!(assertion)) ? (IMMEDIATE_CRASH()) : (void)0) 224 (UNLIKELY(!(assertion)) ? (IMMEDIATE_CRASH()) : (void)0)
222 #endif 225 #endif
223 226
224 // DEFINE_COMPARISON_OPERATORS_WITH_REFERENCES 227 // DEFINE_COMPARISON_OPERATORS_WITH_REFERENCES
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 return static_cast<thisType&>(argument); \ 291 return static_cast<thisType&>(argument); \
289 } \ 292 } \
290 inline const thisType& to##thisType##OrDie(const argumentType& argument) { \ 293 inline const thisType& to##thisType##OrDie(const argumentType& argument) { \
291 CHECK(referencePredicate); \ 294 CHECK(referencePredicate); \
292 return static_cast<const thisType&>(argument); \ 295 return static_cast<const thisType&>(argument); \
293 } \ 296 } \
294 void to##thisType##OrDie(const thisType*); \ 297 void to##thisType##OrDie(const thisType*); \
295 void to##thisType##OrDie(const thisType&) 298 void to##thisType##OrDie(const thisType&)
296 299
297 #endif // WTF_Assertions_h 300 #endif // WTF_Assertions_h
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698