| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_TRACE_EVENT_MEMORY_H_ | 5 #ifndef BASE_TRACE_EVENT_TRACE_EVENT_MEMORY_H_ |
| 6 #define BASE_DEBUG_TRACE_EVENT_MEMORY_H_ | 6 #define BASE_TRACE_EVENT_TRACE_EVENT_MEMORY_H_ |
| 7 | 7 |
| 8 #include "base/base_export.h" | 8 #include "base/base_export.h" |
| 9 #include "base/debug/trace_event_impl.h" | |
| 10 #include "base/gtest_prod_util.h" | 9 #include "base/gtest_prod_util.h" |
| 11 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| 12 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
| 13 #include "base/timer/timer.h" | 12 #include "base/timer/timer.h" |
| 13 #include "base/trace_event/trace_event_impl.h" |
| 14 | 14 |
| 15 // TODO(jamescook): Windows support for memory tracing. | 15 // TODO(jamescook): Windows support for memory tracing. |
| 16 #if !defined(NO_TCMALLOC) && !defined(OS_NACL) && \ | 16 #if !defined(NO_TCMALLOC) && !defined(OS_NACL) && \ |
| 17 (defined(OS_LINUX) || defined(OS_ANDROID)) | 17 (defined(OS_LINUX) || defined(OS_ANDROID)) |
| 18 #define TCMALLOC_TRACE_MEMORY_SUPPORTED 1 | 18 #define TCMALLOC_TRACE_MEMORY_SUPPORTED 1 |
| 19 #endif | 19 #endif |
| 20 | 20 |
| 21 namespace base { | 21 namespace base { |
| 22 | 22 |
| 23 class MessageLoopProxy; | 23 class MessageLoopProxy; |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 base::debug::ScopedTraceMemory INTERNAL_TRACE_MEMORY_ID(category, name); | 162 base::debug::ScopedTraceMemory INTERNAL_TRACE_MEMORY_ID(category, name); |
| 163 #else | 163 #else |
| 164 #define INTERNAL_TRACE_MEMORY(category, name) | 164 #define INTERNAL_TRACE_MEMORY(category, name) |
| 165 #endif // defined(TRACE_MEMORY_SUPPORTED) | 165 #endif // defined(TRACE_MEMORY_SUPPORTED) |
| 166 | 166 |
| 167 // A special trace name that allows us to ignore memory allocations inside | 167 // A special trace name that allows us to ignore memory allocations inside |
| 168 // the memory dump system itself. The allocations are recorded, but the | 168 // the memory dump system itself. The allocations are recorded, but the |
| 169 // visualizer skips them. Must match the value in heap.js. | 169 // visualizer skips them. Must match the value in heap.js. |
| 170 #define TRACE_MEMORY_IGNORE "trace-memory-ignore" | 170 #define TRACE_MEMORY_IGNORE "trace-memory-ignore" |
| 171 | 171 |
| 172 #endif // BASE_DEBUG_TRACE_EVENT_MEMORY_H_ | 172 #endif // BASE_TRACE_EVENT_TRACE_EVENT_MEMORY_H_ |
| OLD | NEW |