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

Unified Diff: base/threading/thread_restrictions.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/threading/thread_checker_unittest.cc ('k') | base/threading/thread_restrictions.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/threading/thread_restrictions.h
diff --git a/base/threading/thread_restrictions.h b/base/threading/thread_restrictions.h
index 0f3ad30e4ee3928bfe6813354bfda776e14c916e..30f787b1c4fc02d1436bd23b404c88f107739aca 100644
--- a/base/threading/thread_restrictions.h
+++ b/base/threading/thread_restrictions.h
@@ -6,15 +6,9 @@
#define BASE_THREADING_THREAD_RESTRICTIONS_H_
#include "base/base_export.h"
+#include "base/logging.h"
#include "base/macros.h"
-// See comment at top of thread_checker.h
-#if (!defined(NDEBUG) || defined(DCHECK_ALWAYS_ON))
-#define ENABLE_THREAD_RESTRICTIONS 1
-#else
-#define ENABLE_THREAD_RESTRICTIONS 0
-#endif
-
class BrowserProcessImpl;
class HistogramSynchronizer;
class NativeBackendKWallet;
@@ -151,7 +145,7 @@ class BASE_EXPORT ThreadRestrictions {
DISALLOW_COPY_AND_ASSIGN(ScopedAllowSingleton);
};
-#if ENABLE_THREAD_RESTRICTIONS
+#if DCHECK_IS_ON()
// Set whether the current thread to make IO calls.
// Threads start out in the *allowed* state.
// Returns the previous value.
@@ -240,7 +234,7 @@ class BASE_EXPORT ThreadRestrictions {
friend class views::ScreenMus;
// END USAGE THAT NEEDS TO BE FIXED.
-#if ENABLE_THREAD_RESTRICTIONS
+#if DCHECK_IS_ON()
static bool SetWaitAllowed(bool allowed);
#else
static bool SetWaitAllowed(bool allowed) { return true; }
« no previous file with comments | « base/threading/thread_checker_unittest.cc ('k') | base/threading/thread_restrictions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698