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 // Classes deriving from NonThreadSafe may need to supress MSVC warning 4275: |
| 10 // non dll-interface class 'Bar' used as base for dll-interface class 'Foo'. |
| 11 // There is a specific macro to do it: NON_EXPORTED_BASE(), defined in |
| 12 // compiler_specific.h |
| 13 #include "base/compiler_specific.h" |
| 14 |
9 #ifndef NDEBUG | 15 #ifndef NDEBUG |
10 #include "base/threading/non_thread_safe_impl.h" | 16 #include "base/threading/non_thread_safe_impl.h" |
11 #endif | 17 #endif |
12 | 18 |
13 namespace base { | 19 namespace base { |
14 | 20 |
15 // Do nothing implementation of NonThreadSafe, for release mode. | 21 // Do nothing implementation of NonThreadSafe, for release mode. |
16 // | 22 // |
17 // Note: You should almost always use the NonThreadSafe class to get | 23 // Note: You should almost always use the NonThreadSafe class to get |
18 // the right version of the class for your build configuration. | 24 // the right version of the class for your build configuration. |
(...skipping 29 matching lines...) Expand all Loading... |
48 class NonThreadSafe : public NonThreadSafeImpl { | 54 class NonThreadSafe : public NonThreadSafeImpl { |
49 }; | 55 }; |
50 #else | 56 #else |
51 class NonThreadSafe : public NonThreadSafeDoNothing { | 57 class NonThreadSafe : public NonThreadSafeDoNothing { |
52 }; | 58 }; |
53 #endif // NDEBUG | 59 #endif // NDEBUG |
54 | 60 |
55 } // namespace base | 61 } // namespace base |
56 | 62 |
57 #endif // BASE_NON_THREAD_SAFE_H_ | 63 #endif // BASE_NON_THREAD_SAFE_H_ |
OLD | NEW |