OLD | NEW |
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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 // Users must test "#if ENABLE(ASSERT)", which helps ensure that code | 49 // Users must test "#if ENABLE(ASSERT)", which helps ensure that code |
50 // testing this macro has included this header. | 50 // testing this macro has included this header. |
51 #ifndef ENABLE_ASSERT | 51 #ifndef ENABLE_ASSERT |
52 #define ENABLE_ASSERT DCHECK_IS_ON() | 52 #define ENABLE_ASSERT DCHECK_IS_ON() |
53 #endif | 53 #endif |
54 | 54 |
55 #ifndef LOG_DISABLED | 55 #ifndef LOG_DISABLED |
56 #define LOG_DISABLED !ENABLE(ASSERT) | 56 #define LOG_DISABLED !ENABLE(ASSERT) |
57 #endif | 57 #endif |
58 | 58 |
59 // These helper functions are always declared, but not necessarily always | |
60 // defined if the corresponding function is disabled. | |
61 | |
62 WTF_EXPORT void WTFReportAssertionFailure(const char* file, | |
63 int line, | |
64 const char* function, | |
65 const char* assertion); | |
66 // WTFLogAlways() is deprecated. crbug.com/638849 | 59 // WTFLogAlways() is deprecated. crbug.com/638849 |
67 WTF_EXPORT PRINTF_FORMAT(1, 2) void WTFLogAlways(const char* format, ...); | 60 WTF_EXPORT PRINTF_FORMAT(1, 2) void WTFLogAlways(const char* format, ...); |
68 WTF_EXPORT void WTFReportBacktrace(int framesToShow = 31); | |
69 | 61 |
70 namespace WTF { | 62 namespace WTF { |
71 | 63 |
72 #if LOG_DISABLED | 64 #if LOG_DISABLED |
73 | 65 |
74 #define WTF_CREATE_SCOPED_LOGGER(...) ((void)0) | 66 #define WTF_CREATE_SCOPED_LOGGER(...) ((void)0) |
75 #define WTF_CREATE_SCOPED_LOGGER_IF(...) ((void)0) | 67 #define WTF_CREATE_SCOPED_LOGGER_IF(...) ((void)0) |
76 #define WTF_APPEND_SCOPED_LOGGER(...) ((void)0) | 68 #define WTF_APPEND_SCOPED_LOGGER(...) ((void)0) |
77 | 69 |
78 #else | 70 #else |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 return static_cast<thisType&>(argument); \ | 255 return static_cast<thisType&>(argument); \ |
264 } \ | 256 } \ |
265 inline const thisType& to##thisType##OrDie(const argumentType& argument) { \ | 257 inline const thisType& to##thisType##OrDie(const argumentType& argument) { \ |
266 CHECK(referencePredicate); \ | 258 CHECK(referencePredicate); \ |
267 return static_cast<const thisType&>(argument); \ | 259 return static_cast<const thisType&>(argument); \ |
268 } \ | 260 } \ |
269 void to##thisType##OrDie(const thisType*); \ | 261 void to##thisType##OrDie(const thisType*); \ |
270 void to##thisType##OrDie(const thisType&) | 262 void to##thisType##OrDie(const thisType&) |
271 | 263 |
272 #endif // WTF_Assertions_h | 264 #endif // WTF_Assertions_h |
OLD | NEW |