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

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

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

Powered by Google App Engine
This is Rietveld 408576698