Chromium Code Reviews| Index: third_party/WebKit/Source/wtf/StdLibExtras.h |
| diff --git a/third_party/WebKit/Source/wtf/StdLibExtras.h b/third_party/WebKit/Source/wtf/StdLibExtras.h |
| index 885f9ddfefeb6986d1271e251d66b59711ec1e8a..8a9a9383d5ae87ecb776ad699dcb04f207d2323a 100644 |
| --- a/third_party/WebKit/Source/wtf/StdLibExtras.h |
| +++ b/third_party/WebKit/Source/wtf/StdLibExtras.h |
| @@ -33,7 +33,7 @@ |
| #include "wtf/TypeTraits.h" |
| #include <cstddef> |
| -#if ENABLE(ASSERT) |
| +#if DCHECK_IS_ON() |
| #include "wtf/Noncopyable.h" |
| #include "wtf/Threading.h" |
| @@ -49,8 +49,13 @@ class WTF_EXPORT StaticLocalVerifier { |
| // Make sure that this 1) is safely initialized, 2) keeps being called |
| // on the same thread, or 3) is called within |
| // AtomicallyInitializedStatic (i.e. with a lock held). |
| - return m_safelyInitialized || m_thread == WTF::currentThread() || |
| - WTF::isAtomicallyInitializedStaticMutexLockHeld(); |
| + return m_safelyInitialized || m_thread == WTF::currentThread() |
| +#if DCHECK_IS_ON() |
|
Yuta Kitamura
2016/12/06 09:22:02
We are already within DCHECK_IS_ON block. Why do y
Alexander Alekseev
2016/12/06 09:51:02
Sorry, I first updated this block and then the out
|
| + || WTF::isAtomicallyInitializedStaticMutexLockHeld(); |
| +#else |
| + /* Presubmit check prohibits bare ';'.*/ |
| + || false; |
| +#endif |
| } |
| private: |
| @@ -90,7 +95,7 @@ class StaticLocalWrapper<T, true> { |
| } |
| }; |
| -#if ENABLE(ASSERT) |
| +#if DCHECK_IS_ON() |
| #define DEFINE_STATIC_LOCAL_CHECK_THREADSAFE_ACCESS(Name) \ |
| static StaticLocalVerifier Name##StaticLocalVerifier; \ |
| ASSERT(Name##StaticLocalVerifier.isNotRacy()) |