| 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_TRACE_EVENT_TRACE_EVENT_MEMORY_H_ | 5 #ifndef BASE_TRACE_EVENT_TRACE_EVENT_MEMORY_H_ |
| 6 #define BASE_TRACE_EVENT_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/gtest_prod_util.h" | 9 #include "base/gtest_prod_util.h" |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 typedef char* (*GetHeapProfileFunction)(); | 36 typedef char* (*GetHeapProfileFunction)(); |
| 37 | 37 |
| 38 // |task_runner| must be a task runner for the primary thread for the client | 38 // |task_runner| must be a task runner for the primary thread for the client |
| 39 // process, e.g. the UI thread in a browser. The function pointers must be | 39 // process, e.g. the UI thread in a browser. The function pointers must be |
| 40 // pointers to tcmalloc heap profiling functions; by avoiding direct calls to | 40 // pointers to tcmalloc heap profiling functions; by avoiding direct calls to |
| 41 // these functions we avoid a dependency on third_party/tcmalloc from base. | 41 // these functions we avoid a dependency on third_party/tcmalloc from base. |
| 42 TraceMemoryController(scoped_refptr<SingleThreadTaskRunner> task_runner, | 42 TraceMemoryController(scoped_refptr<SingleThreadTaskRunner> task_runner, |
| 43 HeapProfilerStartFunction heap_profiler_start_function, | 43 HeapProfilerStartFunction heap_profiler_start_function, |
| 44 HeapProfilerStopFunction heap_profiler_stop_function, | 44 HeapProfilerStopFunction heap_profiler_stop_function, |
| 45 GetHeapProfileFunction get_heap_profile_function); | 45 GetHeapProfileFunction get_heap_profile_function); |
| 46 virtual ~TraceMemoryController(); | 46 ~TraceMemoryController() override; |
| 47 | 47 |
| 48 // base::trace_event::TraceLog::EnabledStateChangedObserver overrides: | 48 // base::trace_event::TraceLog::EnabledStateChangedObserver overrides: |
| 49 void OnTraceLogEnabled() override; | 49 void OnTraceLogEnabled() override; |
| 50 void OnTraceLogDisabled() override; | 50 void OnTraceLogDisabled() override; |
| 51 | 51 |
| 52 // Starts heap memory profiling. | 52 // Starts heap memory profiling. |
| 53 void StartProfiling(); | 53 void StartProfiling(); |
| 54 | 54 |
| 55 // Captures a heap profile. | 55 // Captures a heap profile. |
| 56 void DumpMemoryProfile(); | 56 void DumpMemoryProfile(); |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 #else | 162 #else |
| 163 #define INTERNAL_TRACE_MEMORY(category, name) | 163 #define INTERNAL_TRACE_MEMORY(category, name) |
| 164 #endif // defined(TRACE_MEMORY_SUPPORTED) | 164 #endif // defined(TRACE_MEMORY_SUPPORTED) |
| 165 | 165 |
| 166 // A special trace name that allows us to ignore memory allocations inside | 166 // A special trace name that allows us to ignore memory allocations inside |
| 167 // the memory dump system itself. The allocations are recorded, but the | 167 // the memory dump system itself. The allocations are recorded, but the |
| 168 // visualizer skips them. Must match the value in heap.js. | 168 // visualizer skips them. Must match the value in heap.js. |
| 169 #define TRACE_MEMORY_IGNORE "trace-memory-ignore" | 169 #define TRACE_MEMORY_IGNORE "trace-memory-ignore" |
| 170 | 170 |
| 171 #endif // BASE_TRACE_EVENT_TRACE_EVENT_MEMORY_H_ | 171 #endif // BASE_TRACE_EVENT_TRACE_EVENT_MEMORY_H_ |
| OLD | NEW |