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_SYSTEM_STATS_MONITOR_H_ | 5 #ifndef BASE_TRACE_EVENT_TRACE_EVENT_SYSTEM_STATS_MONITOR_H_ |
6 #define BASE_TRACE_EVENT_TRACE_EVENT_SYSTEM_STATS_MONITOR_H_ | 6 #define BASE_TRACE_EVENT_TRACE_EVENT_SYSTEM_STATS_MONITOR_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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 bool IsTimerRunningForTest() const; | 49 bool IsTimerRunningForTest() const; |
50 | 50 |
51 void StartProfiling(); | 51 void StartProfiling(); |
52 | 52 |
53 void StopProfiling(); | 53 void StopProfiling(); |
54 | 54 |
55 // Ensures the observer starts and stops tracing on the primary thread. | 55 // Ensures the observer starts and stops tracing on the primary thread. |
56 scoped_refptr<SingleThreadTaskRunner> task_runner_; | 56 scoped_refptr<SingleThreadTaskRunner> task_runner_; |
57 | 57 |
58 // Timer to schedule system profile dumps. | 58 // Timer to schedule system profile dumps. |
59 RepeatingTimer<TraceEventSystemStatsMonitor> dump_timer_; | 59 RepeatingTimer dump_timer_; |
60 | 60 |
61 WeakPtrFactory<TraceEventSystemStatsMonitor> weak_factory_; | 61 WeakPtrFactory<TraceEventSystemStatsMonitor> weak_factory_; |
62 | 62 |
63 DISALLOW_COPY_AND_ASSIGN(TraceEventSystemStatsMonitor); | 63 DISALLOW_COPY_AND_ASSIGN(TraceEventSystemStatsMonitor); |
64 }; | 64 }; |
65 | 65 |
66 // Converts system memory profiling stats in |input| to | 66 // Converts system memory profiling stats in |input| to |
67 // trace event compatible JSON and appends to |output|. Visible for testing. | 67 // trace event compatible JSON and appends to |output|. Visible for testing. |
68 BASE_EXPORT void AppendSystemProfileAsTraceFormat(const SystemMetrics& | 68 BASE_EXPORT void AppendSystemProfileAsTraceFormat(const SystemMetrics& |
69 system_stats, | 69 system_stats, |
70 std::string* output); | 70 std::string* output); |
71 | 71 |
72 } // namespace trace_event | 72 } // namespace trace_event |
73 } // namespace base | 73 } // namespace base |
74 | 74 |
75 #endif // BASE_TRACE_EVENT_TRACE_EVENT_SYSTEM_STATS_MONITOR_H_ | 75 #endif // BASE_TRACE_EVENT_TRACE_EVENT_SYSTEM_STATS_MONITOR_H_ |
OLD | NEW |