| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_TRACE_EVENT_HEAP_PROFILER_ALLOCATION_CONTEXT_H_ | 5 #ifndef BASE_TRACE_EVENT_HEAP_PROFILER_ALLOCATION_CONTEXT_H_ |
| 6 #define BASE_TRACE_EVENT_HEAP_PROFILER_ALLOCATION_CONTEXT_H_ | 6 #define BASE_TRACE_EVENT_HEAP_PROFILER_ALLOCATION_CONTEXT_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| 11 #include "base/base_export.h" | 11 #include "base/base_export.h" |
| 12 #include "base/containers/hash_tables.h" | 12 #include "base/containers/hash_tables.h" |
| 13 | 13 |
| 14 #define NEW_TRACE_FORMAT |
| 15 |
| 14 namespace base { | 16 namespace base { |
| 15 namespace trace_event { | 17 namespace trace_event { |
| 16 | 18 |
| 17 // When heap profiling is enabled, tracing keeps track of the allocation | 19 // When heap profiling is enabled, tracing keeps track of the allocation |
| 18 // context for each allocation intercepted. It is generated by the | 20 // context for each allocation intercepted. It is generated by the |
| 19 // |AllocationContextTracker| which keeps stacks of context in TLS. | 21 // |AllocationContextTracker| which keeps stacks of context in TLS. |
| 20 // The tracker is initialized lazily. | 22 // The tracker is initialized lazily. |
| 21 | 23 |
| 22 // The backtrace in the allocation context is a snapshot of the stack. For now, | 24 // The backtrace in the allocation context is a snapshot of the stack. For now, |
| 23 // this is the pseudo stack where frames are created by trace event macros. In | 25 // this is the pseudo stack where frames are created by trace event macros. In |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 }; | 124 }; |
| 123 | 125 |
| 124 template <> | 126 template <> |
| 125 struct BASE_EXPORT hash<base::trace_event::AllocationContext> { | 127 struct BASE_EXPORT hash<base::trace_event::AllocationContext> { |
| 126 size_t operator()(const base::trace_event::AllocationContext& context) const; | 128 size_t operator()(const base::trace_event::AllocationContext& context) const; |
| 127 }; | 129 }; |
| 128 | 130 |
| 129 } // BASE_HASH_NAMESPACE | 131 } // BASE_HASH_NAMESPACE |
| 130 | 132 |
| 131 #endif // BASE_TRACE_EVENT_HEAP_PROFILER_ALLOCATION_CONTEXT_H_ | 133 #endif // BASE_TRACE_EVENT_HEAP_PROFILER_ALLOCATION_CONTEXT_H_ |
| OLD | NEW |