| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef BASE_THREADING_NON_THREAD_SAFE_H_ | 5 #ifndef BASE_THREADING_NON_THREAD_SAFE_H_ |
| 6 #define BASE_THREADING_NON_THREAD_SAFE_H_ | 6 #define BASE_THREADING_NON_THREAD_SAFE_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #ifndef NDEBUG | 9 #ifndef NDEBUG |
| 10 #include "base/threading/non_thread_safe_impl.h" | 10 #include "base/threading/non_thread_safe_impl.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 // public: | 38 // public: |
| 39 // void Foo() { | 39 // void Foo() { |
| 40 // DCHECK(CalledOnValidThread()); | 40 // DCHECK(CalledOnValidThread()); |
| 41 // ... (do stuff) ... | 41 // ... (do stuff) ... |
| 42 // } | 42 // } |
| 43 // } | 43 // } |
| 44 // | 44 // |
| 45 // In Release mode, CalledOnValidThread will always return true. | 45 // In Release mode, CalledOnValidThread will always return true. |
| 46 // | 46 // |
| 47 #ifndef NDEBUG | 47 #ifndef NDEBUG |
| 48 class BASE_API NonThreadSafe : public NonThreadSafeImpl { | 48 class NonThreadSafe : public NonThreadSafeImpl { |
| 49 }; | 49 }; |
| 50 #else | 50 #else |
| 51 class NonThreadSafe : public NonThreadSafeDoNothing { | 51 class NonThreadSafe : public NonThreadSafeDoNothing { |
| 52 }; | 52 }; |
| 53 #endif // NDEBUG | 53 #endif // NDEBUG |
| 54 | 54 |
| 55 } // namespace base | 55 } // namespace base |
| 56 | 56 |
| 57 #endif // BASE_NON_THREAD_SAFE_H_ | 57 #endif // BASE_NON_THREAD_SAFE_H_ |
| OLD | NEW |