| 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_DEBUG_LEAK_TRACKER_H_ | 5 #ifndef BASE_DEBUG_LEAK_TRACKER_H_ |
| 6 #define BASE_DEBUG_LEAK_TRACKER_H_ | 6 #define BASE_DEBUG_LEAK_TRACKER_H_ |
| 7 | 7 |
| 8 // Only enable leak tracking in debug builds. | 8 // Only enable leak tracking in debug builds. |
| 9 #ifndef NDEBUG | 9 #ifndef NDEBUG |
| 10 #define ENABLE_LEAK_TRACKER | 10 #define ENABLE_LEAK_TRACKER |
| 11 #endif | 11 #endif |
| 12 | 12 |
| 13 #ifdef ENABLE_LEAK_TRACKER | 13 #ifdef ENABLE_LEAK_TRACKER |
| 14 #include "base/containers/linked_list.h" |
| 14 #include "base/debug/stack_trace.h" | 15 #include "base/debug/stack_trace.h" |
| 15 #include "base/linked_list.h" | |
| 16 #include "base/logging.h" | 16 #include "base/logging.h" |
| 17 #endif // ENABLE_LEAK_TRACKER | 17 #endif // ENABLE_LEAK_TRACKER |
| 18 | 18 |
| 19 // LeakTracker is a helper to verify that all instances of a class | 19 // LeakTracker is a helper to verify that all instances of a class |
| 20 // have been destroyed. | 20 // have been destroyed. |
| 21 // | 21 // |
| 22 // It is particularly useful for classes that are bound to a single thread -- | 22 // It is particularly useful for classes that are bound to a single thread -- |
| 23 // before destroying that thread, one can check that there are no remaining | 23 // before destroying that thread, one can check that there are no remaining |
| 24 // instances of that class. | 24 // instances of that class. |
| 25 // | 25 // |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 | 127 |
| 128 StackTrace allocation_stack_; | 128 StackTrace allocation_stack_; |
| 129 }; | 129 }; |
| 130 | 130 |
| 131 #endif // ENABLE_LEAK_TRACKER | 131 #endif // ENABLE_LEAK_TRACKER |
| 132 | 132 |
| 133 } // namespace debug | 133 } // namespace debug |
| 134 } // namespace base | 134 } // namespace base |
| 135 | 135 |
| 136 #endif // BASE_DEBUG_LEAK_TRACKER_H_ | 136 #endif // BASE_DEBUG_LEAK_TRACKER_H_ |
| OLD | NEW |