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

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

Issue 2288473002: Implement Dump-on-DCHECK (via a new LogSeverity). (Closed)
Patch Set: Break out sub-component CLs Created 3 years, 11 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
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 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 // Expressions inside them are evaluated in debug builds only. 141 // Expressions inside them are evaluated in debug builds only.
142 // They are deprecated. We should use: 142 // They are deprecated. We should use:
143 // - DCHECK() for ASSERT() 143 // - DCHECK() for ASSERT()
144 // - NOTREACHED() for ASSERT_NOT_REACHED() 144 // - NOTREACHED() for ASSERT_NOT_REACHED()
145 #if OS(WIN) 145 #if OS(WIN)
146 // FIXME: Change to use something other than ASSERT to avoid this conflict with 146 // FIXME: Change to use something other than ASSERT to avoid this conflict with
147 // the underlying platform. 147 // the underlying platform.
148 #undef ASSERT 148 #undef ASSERT
149 #endif 149 #endif
150 150
151 #define DCHECK_AT(assertion, file, line) \ 151 #define DCHECK_AT(assertion, file, line) \
152 LAZY_STREAM(logging::LogMessage(file, line, #assertion).stream(), \ 152 LAZY_STREAM(logging::LogMessage(file, line, logging::LOG_DCHECK).stream(), \
153 DCHECK_IS_ON() ? !(assertion) : false) 153 DCHECK_IS_ON() ? !(assertion) : false) \
154 << "Check failed: " #assertion ". "
154 155
155 #if ENABLE(ASSERT) 156 #if ENABLE(ASSERT)
156 #define ASSERT(assertion) DCHECK(assertion) 157 #define ASSERT(assertion) DCHECK(assertion)
157 #define ASSERT_NOT_REACHED() NOTREACHED() 158 #define ASSERT_NOT_REACHED() NOTREACHED()
158 #else 159 #else
159 #define ASSERT(assertion) ((void)0) 160 #define ASSERT(assertion) ((void)0)
160 #define ASSERT_NOT_REACHED() ((void)0) 161 #define ASSERT_NOT_REACHED() ((void)0)
161 #endif 162 #endif
162 163
163 // Users must test "#if ENABLE(SECURITY_ASSERT)", which helps ensure 164 // Users must test "#if ENABLE(SECURITY_ASSERT)", which helps ensure
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 return static_cast<thisType&>(argument); \ 264 return static_cast<thisType&>(argument); \
264 } \ 265 } \
265 inline const thisType& to##thisType##OrDie(const argumentType& argument) { \ 266 inline const thisType& to##thisType##OrDie(const argumentType& argument) { \
266 CHECK(referencePredicate); \ 267 CHECK(referencePredicate); \
267 return static_cast<const thisType&>(argument); \ 268 return static_cast<const thisType&>(argument); \
268 } \ 269 } \
269 void to##thisType##OrDie(const thisType*); \ 270 void to##thisType##OrDie(const thisType*); \
270 void to##thisType##OrDie(const thisType&) 271 void to##thisType##OrDie(const thisType&)
271 272
272 #endif // WTF_Assertions_h 273 #endif // WTF_Assertions_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698