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 CONTENT_PUBLIC_BROWSER_TRACING_CONTROLLER_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_TRACING_CONTROLLER_H_ |
6 #define CONTENT_PUBLIC_BROWSER_TRACING_CONTROLLER_H_ | 6 #define CONTENT_PUBLIC_BROWSER_TRACING_CONTROLLER_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 // that contain a matching category. Having both included and excluded | 80 // that contain a matching category. Having both included and excluded |
81 // category patterns in the same list would not be supported. | 81 // category patterns in the same list would not be supported. |
82 // | 82 // |
83 // Examples: "test_MyTest*", | 83 // Examples: "test_MyTest*", |
84 // "test_MyTest*,test_OtherStuff", | 84 // "test_MyTest*,test_OtherStuff", |
85 // "-excluded_category1,-excluded_category2" | 85 // "-excluded_category1,-excluded_category2" |
86 // | 86 // |
87 // |options| controls what kind of tracing is enabled. | 87 // |options| controls what kind of tracing is enabled. |
88 typedef base::Callback<void()> EnableRecordingDoneCallback; | 88 typedef base::Callback<void()> EnableRecordingDoneCallback; |
89 virtual bool EnableRecording( | 89 virtual bool EnableRecording( |
90 const base::debug::CategoryFilter& category_filter, | 90 const base::trace_event::CategoryFilter& category_filter, |
91 const base::debug::TraceOptions& trace_options, | 91 const base::trace_event::TraceOptions& trace_options, |
92 const EnableRecordingDoneCallback& callback) = 0; | 92 const EnableRecordingDoneCallback& callback) = 0; |
93 | 93 |
94 // Stop recording on all processes. | 94 // Stop recording on all processes. |
95 // | 95 // |
96 // Child processes typically are caching trace data and only rarely flush | 96 // Child processes typically are caching trace data and only rarely flush |
97 // and send trace data back to the browser process. That is because it may be | 97 // and send trace data back to the browser process. That is because it may be |
98 // an expensive operation to send the trace data over IPC, and we would like | 98 // an expensive operation to send the trace data over IPC, and we would like |
99 // to avoid much runtime overhead of tracing. So, to end tracing, we must | 99 // to avoid much runtime overhead of tracing. So, to end tracing, we must |
100 // asynchronously ask all child processes to flush any pending trace data. | 100 // asynchronously ask all child processes to flush any pending trace data. |
101 // | 101 // |
(...skipping 15 matching lines...) Expand all Loading... |
117 // | 117 // |
118 // Once all child processes have acked to the EnableMonitoring request, | 118 // Once all child processes have acked to the EnableMonitoring request, |
119 // EnableMonitoringDoneCallback will be called back. | 119 // EnableMonitoringDoneCallback will be called back. |
120 // | 120 // |
121 // |category_filter| is a filter to control what category groups should be | 121 // |category_filter| is a filter to control what category groups should be |
122 // traced. | 122 // traced. |
123 // | 123 // |
124 // |options| controls what kind of tracing is enabled. | 124 // |options| controls what kind of tracing is enabled. |
125 typedef base::Callback<void()> EnableMonitoringDoneCallback; | 125 typedef base::Callback<void()> EnableMonitoringDoneCallback; |
126 virtual bool EnableMonitoring( | 126 virtual bool EnableMonitoring( |
127 const base::debug::CategoryFilter& category_filter, | 127 const base::trace_event::CategoryFilter& category_filter, |
128 const base::debug::TraceOptions& trace_options, | 128 const base::trace_event::TraceOptions& trace_options, |
129 const EnableMonitoringDoneCallback& callback) = 0; | 129 const EnableMonitoringDoneCallback& callback) = 0; |
130 | 130 |
131 // Stop monitoring on all processes. | 131 // Stop monitoring on all processes. |
132 // | 132 // |
133 // Once all child processes have acked to the DisableMonitoring request, | 133 // Once all child processes have acked to the DisableMonitoring request, |
134 // DisableMonitoringDoneCallback is called back. | 134 // DisableMonitoringDoneCallback is called back. |
135 typedef base::Callback<void()> DisableMonitoringDoneCallback; | 135 typedef base::Callback<void()> DisableMonitoringDoneCallback; |
136 virtual bool DisableMonitoring( | 136 virtual bool DisableMonitoring( |
137 const DisableMonitoringDoneCallback& callback) = 0; | 137 const DisableMonitoringDoneCallback& callback) = 0; |
138 | 138 |
139 // Get the current monitoring configuration. | 139 // Get the current monitoring configuration. |
140 virtual void GetMonitoringStatus( | 140 virtual void GetMonitoringStatus( |
141 bool* out_enabled, | 141 bool* out_enabled, |
142 base::debug::CategoryFilter* out_category_filter, | 142 base::trace_event::CategoryFilter* out_category_filter, |
143 base::debug::TraceOptions* out_trace_options) = 0; | 143 base::trace_event::TraceOptions* out_trace_options) = 0; |
144 | 144 |
145 // Get the current monitoring traced data. | 145 // Get the current monitoring traced data. |
146 // | 146 // |
147 // Child processes typically are caching trace data and only rarely flush | 147 // Child processes typically are caching trace data and only rarely flush |
148 // and send trace data back to the browser process. That is because it may be | 148 // and send trace data back to the browser process. That is because it may be |
149 // an expensive operation to send the trace data over IPC, and we would like | 149 // an expensive operation to send the trace data over IPC, and we would like |
150 // to avoid much runtime overhead of tracing. So, to end tracing, we must | 150 // to avoid much runtime overhead of tracing. So, to end tracing, we must |
151 // asynchronously ask all child processes to flush any pending trace data. | 151 // asynchronously ask all child processes to flush any pending trace data. |
152 // | 152 // |
153 // Once all child processes have acked to the CaptureMonitoringSnapshot | 153 // Once all child processes have acked to the CaptureMonitoringSnapshot |
(...skipping 24 matching lines...) Expand all Loading... |
178 // watch event callback. | 178 // watch event callback. |
179 virtual bool CancelWatchEvent() = 0; | 179 virtual bool CancelWatchEvent() = 0; |
180 | 180 |
181 protected: | 181 protected: |
182 virtual ~TracingController() {} | 182 virtual ~TracingController() {} |
183 }; | 183 }; |
184 | 184 |
185 } // namespace content | 185 } // namespace content |
186 | 186 |
187 #endif // CONTENT_PUBLIC_BROWSER_TRACING_CONTROLLER_H_ | 187 #endif // CONTENT_PUBLIC_BROWSER_TRACING_CONTROLLER_H_ |
OLD | NEW |