Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(109)

Side by Side Diff: base/trace_event/trace_event_memory.h

Issue 1355063004: Template methods on Timer classes instead of the classes themselves. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: timer: fixcaller Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 // Ensures the observer starts and stops tracing on the primary thread. 66 // Ensures the observer starts and stops tracing on the primary thread.
67 scoped_refptr<SingleThreadTaskRunner> task_runner_; 67 scoped_refptr<SingleThreadTaskRunner> task_runner_;
68 68
69 // Pointers to tcmalloc heap profiling functions. Allows this class to use 69 // Pointers to tcmalloc heap profiling functions. Allows this class to use
70 // tcmalloc functions without introducing a dependency from base to tcmalloc. 70 // tcmalloc functions without introducing a dependency from base to tcmalloc.
71 HeapProfilerStartFunction heap_profiler_start_function_; 71 HeapProfilerStartFunction heap_profiler_start_function_;
72 HeapProfilerStopFunction heap_profiler_stop_function_; 72 HeapProfilerStopFunction heap_profiler_stop_function_;
73 GetHeapProfileFunction get_heap_profile_function_; 73 GetHeapProfileFunction get_heap_profile_function_;
74 74
75 // Timer to schedule memory profile dumps. 75 // Timer to schedule memory profile dumps.
76 RepeatingTimer<TraceMemoryController> dump_timer_; 76 RepeatingTimer dump_timer_;
77 77
78 WeakPtrFactory<TraceMemoryController> weak_factory_; 78 WeakPtrFactory<TraceMemoryController> weak_factory_;
79 79
80 DISALLOW_COPY_AND_ASSIGN(TraceMemoryController); 80 DISALLOW_COPY_AND_ASSIGN(TraceMemoryController);
81 }; 81 };
82 82
83 ////////////////////////////////////////////////////////////////////////////// 83 //////////////////////////////////////////////////////////////////////////////
84 84
85 // A scoped context for memory tracing. Pushes the name onto a stack for 85 // A scoped context for memory tracing. Pushes the name onto a stack for
86 // recording by tcmalloc heap profiling. 86 // recording by tcmalloc heap profiling.
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
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_
OLDNEW
« no previous file with comments | « base/trace_event/memory_dump_manager.h ('k') | base/trace_event/trace_event_system_stats_monitor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698