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

Unified Diff: base/lazy_instance.h

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/i18n/icu_util.cc ('k') | base/logging.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/lazy_instance.h
diff --git a/base/lazy_instance.h b/base/lazy_instance.h
index fd0321017df8f8ba6643f1326db2db581fd05ed5..9218bf3fb2a28e9c3f0c1757266be30d58cf17a6 100644
--- a/base/lazy_instance.h
+++ b/base/lazy_instance.h
@@ -55,7 +55,7 @@ namespace base {
template <typename Type>
struct DefaultLazyInstanceTraits {
static const bool kRegisterOnExit = true;
-#ifndef NDEBUG
+#if DCHECK_IS_ON()
static const bool kAllowedToAccessOnNonjoinableThread = false;
#endif
@@ -89,7 +89,7 @@ namespace internal {
template <typename Type>
struct LeakyLazyInstanceTraits {
static const bool kRegisterOnExit = false;
-#ifndef NDEBUG
+#if DCHECK_IS_ON()
static const bool kAllowedToAccessOnNonjoinableThread = true;
#endif
@@ -138,7 +138,7 @@ class LazyInstance {
}
Type* Pointer() {
-#ifndef NDEBUG
+#if DCHECK_IS_ON()
// Avoid making TLS lookup on release builds.
if (!Traits::kAllowedToAccessOnNonjoinableThread)
ThreadRestrictions::AssertSingletonAllowed();
« no previous file with comments | « base/i18n/icu_util.cc ('k') | base/logging.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698