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

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

Issue 2288473002: Implement Dump-on-DCHECK (via a new LogSeverity). (Closed)
Patch Set: Pull the Official Windows build default in, and 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
« no previous file with comments | « build/config/dcheck_always_on.gni ('k') | third_party/WebKit/Source/wtf/AssertionsTest.cpp » ('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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 // Expressions inside them are evaluated in debug builds only. 127 // Expressions inside them are evaluated in debug builds only.
128 // They are deprecated. We should use: 128 // They are deprecated. We should use:
129 // - DCHECK() for ASSERT() 129 // - DCHECK() for ASSERT()
130 // - NOTREACHED() for ASSERT_NOT_REACHED() 130 // - NOTREACHED() for ASSERT_NOT_REACHED()
131 #if OS(WIN) 131 #if OS(WIN)
132 // FIXME: Change to use something other than ASSERT to avoid this conflict with 132 // FIXME: Change to use something other than ASSERT to avoid this conflict with
133 // the underlying platform. 133 // the underlying platform.
134 #undef ASSERT 134 #undef ASSERT
135 #endif 135 #endif
136 136
137 #define DCHECK_AT(assertion, file, line) \ 137 #define DCHECK_AT(assertion, file, line) \
138 LAZY_STREAM(logging::LogMessage(file, line, #assertion).stream(), \ 138 LAZY_STREAM(logging::LogMessage(file, line, logging::LOG_DCHECK).stream(), \
139 DCHECK_IS_ON() ? !(assertion) : false) 139 DCHECK_IS_ON() ? !(assertion) : false) \
140 << "Check failed: " #assertion ". "
140 141
141 #if DCHECK_IS_ON() 142 #if DCHECK_IS_ON()
142 #define ASSERT(assertion) DCHECK(assertion) 143 #define ASSERT(assertion) DCHECK(assertion)
143 #define ASSERT_NOT_REACHED() NOTREACHED() 144 #define ASSERT_NOT_REACHED() NOTREACHED()
144 #else 145 #else
145 #define ASSERT(assertion) ((void)0) 146 #define ASSERT(assertion) ((void)0)
146 #define ASSERT_NOT_REACHED() ((void)0) 147 #define ASSERT_NOT_REACHED() ((void)0)
147 #endif 148 #endif
148 149
149 // Users must test "#if ENABLE(SECURITY_ASSERT)", which helps ensure 150 // Users must test "#if ENABLE(SECURITY_ASSERT)", which helps ensure
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 return static_cast<thisType&>(argument); \ 250 return static_cast<thisType&>(argument); \
250 } \ 251 } \
251 inline const thisType& to##thisType##OrDie(const argumentType& argument) { \ 252 inline const thisType& to##thisType##OrDie(const argumentType& argument) { \
252 CHECK(referencePredicate); \ 253 CHECK(referencePredicate); \
253 return static_cast<const thisType&>(argument); \ 254 return static_cast<const thisType&>(argument); \
254 } \ 255 } \
255 void to##thisType##OrDie(const thisType*); \ 256 void to##thisType##OrDie(const thisType*); \
256 void to##thisType##OrDie(const thisType&) 257 void to##thisType##OrDie(const thisType&)
257 258
258 #endif // WTF_Assertions_h 259 #endif // WTF_Assertions_h
OLDNEW
« no previous file with comments | « build/config/dcheck_always_on.gni ('k') | third_party/WebKit/Source/wtf/AssertionsTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698