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

Side by Side Diff: third_party/WebKit/public/platform/WebCommon.h

Issue 1851293002: Remove BLINK_ASSERT() and BLINK_ASSERT_NOT_REACHED() macros. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 #define BLINK_COMMON_EXPORT __attribute__((visibility("default"))) 66 #define BLINK_COMMON_EXPORT __attribute__((visibility("default")))
67 #endif 67 #endif
68 #else // defined(COMPONENT_BUILD) 68 #else // defined(COMPONENT_BUILD)
69 #define BLINK_EXPORT 69 #define BLINK_EXPORT
70 #define BLINK_PLATFORM_EXPORT 70 #define BLINK_PLATFORM_EXPORT
71 #define BLINK_COMMON_EXPORT 71 #define BLINK_COMMON_EXPORT
72 #endif 72 #endif
73 73
74 74
75 // ----------------------------------------------------------------------------- 75 // -----------------------------------------------------------------------------
76 // Assertions
77
78 #include "base/logging.h"
tkent 2016/04/03 22:59:06 WebCommon.h shouldn't include base/logging.h. Eac
haraken 2016/04/03 23:53:46 This is a tricky part since core/, modules/ and we
kotenkov 2016/04/04 07:46:34 There already exists such a file: wtf/Assertions.h
tkent 2016/04/04 09:03:17 Right. So, I think using base/logging.h directly
79
80 // -----------------------------------------------------------------------------
76 // Basic types 81 // Basic types
77 82
78 #include <stddef.h> // For size_t 83 #include <stddef.h> // For size_t
79 #include <stdint.h> // For int32_t 84 #include <stdint.h> // For int32_t
80 85
81 namespace blink { 86 namespace blink {
82 87
83 // UTF-32 character type 88 // UTF-32 character type
84 typedef int32_t WebUChar32; 89 typedef int32_t WebUChar32;
85 90
86 // UTF-16 character type 91 // UTF-16 character type
87 #if defined(WIN32) 92 #if defined(WIN32)
88 typedef wchar_t WebUChar; 93 typedef wchar_t WebUChar;
89 #else 94 #else
90 typedef unsigned short WebUChar; 95 typedef unsigned short WebUChar;
91 #endif 96 #endif
92 97
93 // Latin-1 character type 98 // Latin-1 character type
94 typedef unsigned char WebLChar; 99 typedef unsigned char WebLChar;
95 100
96 // -----------------------------------------------------------------------------
97 // Assertions
98
99 BLINK_COMMON_EXPORT void failedAssertion(const char* file, int line, const char* function, const char* assertion);
tkent 2016/04/03 22:59:06 We should remove failedAssertion() implementation
100
101 } // namespace blink 101 } // namespace blink
102 102
103 // Ideally, only use inside the public directory but outside of INSIDE_BLINK blo cks. (Otherwise use WTF's ASSERT.)
104 #if defined(NDEBUG)
105 #define BLINK_ASSERT(assertion) ((void)0)
106 #else
107 #define BLINK_ASSERT(assertion) do { \
108 if (!(assertion)) \
109 failedAssertion(__FILE__, __LINE__, __FUNCTION__, #assertion); \
110 } while (0)
111 #endif 103 #endif
112
113 #define BLINK_ASSERT_NOT_REACHED() BLINK_ASSERT(0)
114
115 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/public/platform/WebBlobRegistry.h ('k') | third_party/WebKit/public/platform/WebCryptoAlgorithmParams.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698