| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_THREAD_CHECKER_H_ | 5 #ifndef BASE_THREADING_THREAD_CHECKER_H_ |
| 6 #define BASE_THREADING_THREAD_CHECKER_H_ | 6 #define BASE_THREADING_THREAD_CHECKER_H_ |
| 7 | 7 |
| 8 #include "base/compiler_specific.h" |
| 8 #include "base/logging.h" | 9 #include "base/logging.h" |
| 9 #include "base/threading/thread_checker_impl.h" | 10 #include "base/threading/thread_checker_impl.h" |
| 10 | 11 |
| 11 // ThreadChecker is a helper class used to help verify that some methods of a | 12 // ThreadChecker is a helper class used to help verify that some methods of a |
| 12 // class are called from the same thread (for thread-affinity). | 13 // class are called from the same thread (for thread-affinity). |
| 13 // | 14 // |
| 14 // Use the macros below instead of the ThreadChecker directly so that the unused | 15 // Use the macros below instead of the ThreadChecker directly so that the unused |
| 15 // member doesn't result in an extra byte (four when padded) per instance in | 16 // member doesn't result in an extra byte (four when padded) per instance in |
| 16 // production. | 17 // production. |
| 17 // | 18 // |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 class ThreadChecker : public ThreadCheckerImpl { | 93 class ThreadChecker : public ThreadCheckerImpl { |
| 93 }; | 94 }; |
| 94 #else | 95 #else |
| 95 class ThreadChecker : public ThreadCheckerDoNothing { | 96 class ThreadChecker : public ThreadCheckerDoNothing { |
| 96 }; | 97 }; |
| 97 #endif // DCHECK_IS_ON() | 98 #endif // DCHECK_IS_ON() |
| 98 | 99 |
| 99 } // namespace base | 100 } // namespace base |
| 100 | 101 |
| 101 #endif // BASE_THREADING_THREAD_CHECKER_H_ | 102 #endif // BASE_THREADING_THREAD_CHECKER_H_ |
| OLD | NEW |