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

Unified Diff: base/i18n/icu_util.cc

Issue 2163023002: Unify usage of logging/assert macros in base/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix base/android/build_info.cc compile Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/android/build_info.cc ('k') | base/lazy_instance.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/i18n/icu_util.cc
diff --git a/base/i18n/icu_util.cc b/base/i18n/icu_util.cc
index 30876f42f4204480881b575a61fe9863eb90dd70..124336b684ab283da9714f1c8b055bdfda397d56 100644
--- a/base/i18n/icu_util.cc
+++ b/base/i18n/icu_util.cc
@@ -48,13 +48,13 @@ namespace i18n {
namespace {
#if !defined(OS_NACL)
-#if !defined(NDEBUG)
+#if DCHECK_IS_ON()
// Assert that we are not called more than once. Even though calling this
// function isn't harmful (ICU can handle it), being called twice probably
// indicates a programming error.
bool g_check_called_once = true;
bool g_called_once = false;
-#endif // !defined(NDEBUG)
+#endif // DCHECK_IS_ON()
#if ICU_UTIL_DATA_IMPL == ICU_UTIL_DATA_FILE
@@ -201,7 +201,7 @@ bool InitializeICUWithFileDescriptorInternal(
bool InitializeICUWithFileDescriptor(
PlatformFile data_fd,
const MemoryMappedFile::Region& data_region) {
-#if !defined(NDEBUG)
+#if DCHECK_IS_ON()
DCHECK(!g_check_called_once || !g_called_once);
g_called_once = true;
#endif
@@ -222,7 +222,7 @@ const uint8_t* GetRawIcuMemory() {
bool InitializeICUFromRawMemory(const uint8_t* raw_memory) {
#if !defined(COMPONENT_BUILD)
-#if !defined(NDEBUG)
+#if DCHECK_IS_ON()
DCHECK(!g_check_called_once || !g_called_once);
g_called_once = true;
#endif
@@ -238,7 +238,7 @@ bool InitializeICUFromRawMemory(const uint8_t* raw_memory) {
#endif // ICU_UTIL_DATA_IMPL == ICU_UTIL_DATA_FILE
bool InitializeICU() {
-#if !defined(NDEBUG)
+#if DCHECK_IS_ON()
DCHECK(!g_check_called_once || !g_called_once);
g_called_once = true;
#endif
@@ -307,7 +307,7 @@ bool InitializeICU() {
#endif // !defined(OS_NACL)
void AllowMultipleInitializeCallsForTesting() {
-#if !defined(NDEBUG) && !defined(OS_NACL)
+#if DCHECK_IS_ON() && !defined(OS_NACL)
g_check_called_once = false;
#endif
}
« no previous file with comments | « base/android/build_info.cc ('k') | base/lazy_instance.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698