| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_LEAK_TRACKER_H_ | 5 #ifndef BASE_LEAK_TRACKER_H_ |
| 6 #define BASE_LEAK_TRACKER_H_ | 6 #define BASE_LEAK_TRACKER_H_ |
| 7 | 7 |
| 8 // Temporarily enable LeakTracker in all builds (both | 8 // Only enable leak tracking in debug builds. |
| 9 // release and debug). This will have an impact on performance, but | 9 #ifndef NDEBUG |
| 10 // is intended to help track down a leak which reproduces on dev | |
| 11 // channel. | |
| 12 // | |
| 13 // TODO(eroman): Restore the old code which only enabled LeakTracker | |
| 14 // for debug builds. | |
| 15 // | |
| 16 // http://crbug.com/21199, http://crbug.com/18372 | |
| 17 #ifndef ENABLE_LEAK_TRACKER | |
| 18 #define ENABLE_LEAK_TRACKER | 10 #define ENABLE_LEAK_TRACKER |
| 19 #endif | 11 #endif |
| 20 | 12 |
| 21 #ifdef ENABLE_LEAK_TRACKER | 13 #ifdef ENABLE_LEAK_TRACKER |
| 22 #include "base/debug_util.h" | 14 #include "base/debug_util.h" |
| 23 #include "base/linked_list.h" | 15 #include "base/linked_list.h" |
| 24 #include "base/logging.h" | 16 #include "base/logging.h" |
| 25 #endif // ENABLE_LEAK_TRACKER | 17 #endif // ENABLE_LEAK_TRACKER |
| 26 | 18 |
| 27 // 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 |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 } | 122 } |
| 131 | 123 |
| 132 StackTrace allocation_stack_; | 124 StackTrace allocation_stack_; |
| 133 }; | 125 }; |
| 134 | 126 |
| 135 #endif // ENABLE_LEAK_TRACKER | 127 #endif // ENABLE_LEAK_TRACKER |
| 136 | 128 |
| 137 } // namespace base | 129 } // namespace base |
| 138 | 130 |
| 139 #endif // BASE_LEAK_TRACKER_H_ | 131 #endif // BASE_LEAK_TRACKER_H_ |
| OLD | NEW |