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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 #include <stdarg.h> | 43 #include <stdarg.h> |
44 | 44 |
45 #if OS(WIN) | 45 #if OS(WIN) |
46 #include <windows.h> | 46 #include <windows.h> |
47 #endif | 47 #endif |
48 | 48 |
49 #ifndef LOG_DISABLED | 49 #ifndef LOG_DISABLED |
50 #define LOG_DISABLED !DCHECK_IS_ON() | 50 #define LOG_DISABLED !DCHECK_IS_ON() |
51 #endif | 51 #endif |
52 | 52 |
53 // These helper functions are always declared, but not necessarily always | |
54 // defined if the corresponding function is disabled. | |
55 | |
56 WTF_EXPORT void WTFReportAssertionFailure(const char* file, | |
57 int line, | |
58 const char* function, | |
59 const char* assertion); | |
60 // WTFLogAlways() is deprecated. crbug.com/638849 | 53 // WTFLogAlways() is deprecated. crbug.com/638849 |
61 WTF_EXPORT PRINTF_FORMAT(1, 2) void WTFLogAlways(const char* format, ...); | 54 WTF_EXPORT PRINTF_FORMAT(1, 2) void WTFLogAlways(const char* format, ...); |
62 WTF_EXPORT void WTFReportBacktrace(int framesToShow = 31); | |
63 | 55 |
64 namespace WTF { | 56 namespace WTF { |
65 | 57 |
66 #if LOG_DISABLED | 58 #if LOG_DISABLED |
67 | 59 |
68 #define WTF_CREATE_SCOPED_LOGGER(...) ((void)0) | 60 #define WTF_CREATE_SCOPED_LOGGER(...) ((void)0) |
69 #define WTF_CREATE_SCOPED_LOGGER_IF(...) ((void)0) | 61 #define WTF_CREATE_SCOPED_LOGGER_IF(...) ((void)0) |
70 #define WTF_APPEND_SCOPED_LOGGER(...) ((void)0) | 62 #define WTF_APPEND_SCOPED_LOGGER(...) ((void)0) |
71 | 63 |
72 #else | 64 #else |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 return static_cast<thisType&>(argument); \ | 249 return static_cast<thisType&>(argument); \ |
258 } \ | 250 } \ |
259 inline const thisType& to##thisType##OrDie(const argumentType& argument) { \ | 251 inline const thisType& to##thisType##OrDie(const argumentType& argument) { \ |
260 CHECK(referencePredicate); \ | 252 CHECK(referencePredicate); \ |
261 return static_cast<const thisType&>(argument); \ | 253 return static_cast<const thisType&>(argument); \ |
262 } \ | 254 } \ |
263 void to##thisType##OrDie(const thisType*); \ | 255 void to##thisType##OrDie(const thisType*); \ |
264 void to##thisType##OrDie(const thisType&) | 256 void to##thisType##OrDie(const thisType&) |
265 | 257 |
266 #endif // WTF_Assertions_h | 258 #endif // WTF_Assertions_h |
OLD | NEW |