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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 // that contain a matching category. Having both included and excluded | 104 // that contain a matching category. Having both included and excluded |
105 // category patterns in the same list would not be supported. | 105 // category patterns in the same list would not be supported. |
106 // | 106 // |
107 // Examples: "test_MyTest*", | 107 // Examples: "test_MyTest*", |
108 // "test_MyTest*,test_OtherStuff", | 108 // "test_MyTest*,test_OtherStuff", |
109 // "-excluded_category1,-excluded_category2" | 109 // "-excluded_category1,-excluded_category2" |
110 // | 110 // |
111 // |options| controls what kind of tracing is enabled. | 111 // |options| controls what kind of tracing is enabled. |
112 typedef base::Callback<void()> EnableRecordingDoneCallback; | 112 typedef base::Callback<void()> EnableRecordingDoneCallback; |
113 virtual bool EnableRecording( | 113 virtual bool EnableRecording( |
114 const base::trace_event::CategoryFilter& category_filter, | 114 const base::trace_event::TraceConfig& trace_config, |
115 const base::trace_event::TraceOptions& trace_options, | |
116 const EnableRecordingDoneCallback& callback) = 0; | 115 const EnableRecordingDoneCallback& callback) = 0; |
117 | 116 |
118 // Stop recording on all processes. | 117 // Stop recording on all processes. |
119 // | 118 // |
120 // Child processes typically are caching trace data and only rarely flush | 119 // Child processes typically are caching trace data and only rarely flush |
121 // and send trace data back to the browser process. That is because it may be | 120 // and send trace data back to the browser process. That is because it may be |
122 // an expensive operation to send the trace data over IPC, and we would like | 121 // an expensive operation to send the trace data over IPC, and we would like |
123 // to avoid much runtime overhead of tracing. So, to end tracing, we must | 122 // to avoid much runtime overhead of tracing. So, to end tracing, we must |
124 // asynchronously ask all child processes to flush any pending trace data. | 123 // asynchronously ask all child processes to flush any pending trace data. |
125 // | 124 // |
(...skipping 15 matching lines...) Expand all Loading... |
141 // | 140 // |
142 // Once all child processes have acked to the EnableMonitoring request, | 141 // Once all child processes have acked to the EnableMonitoring request, |
143 // EnableMonitoringDoneCallback will be called back. | 142 // EnableMonitoringDoneCallback will be called back. |
144 // | 143 // |
145 // |category_filter| is a filter to control what category groups should be | 144 // |category_filter| is a filter to control what category groups should be |
146 // traced. | 145 // traced. |
147 // | 146 // |
148 // |options| controls what kind of tracing is enabled. | 147 // |options| controls what kind of tracing is enabled. |
149 typedef base::Callback<void()> EnableMonitoringDoneCallback; | 148 typedef base::Callback<void()> EnableMonitoringDoneCallback; |
150 virtual bool EnableMonitoring( | 149 virtual bool EnableMonitoring( |
151 const base::trace_event::CategoryFilter& category_filter, | 150 const base::trace_event::TraceConfig& trace_config, |
152 const base::trace_event::TraceOptions& trace_options, | |
153 const EnableMonitoringDoneCallback& callback) = 0; | 151 const EnableMonitoringDoneCallback& callback) = 0; |
154 | 152 |
155 // Stop monitoring on all processes. | 153 // Stop monitoring on all processes. |
156 // | 154 // |
157 // Once all child processes have acked to the DisableMonitoring request, | 155 // Once all child processes have acked to the DisableMonitoring request, |
158 // DisableMonitoringDoneCallback is called back. | 156 // DisableMonitoringDoneCallback is called back. |
159 typedef base::Callback<void()> DisableMonitoringDoneCallback; | 157 typedef base::Callback<void()> DisableMonitoringDoneCallback; |
160 virtual bool DisableMonitoring( | 158 virtual bool DisableMonitoring( |
161 const DisableMonitoringDoneCallback& callback) = 0; | 159 const DisableMonitoringDoneCallback& callback) = 0; |
162 | 160 |
163 // Get the current monitoring configuration. | 161 // Get the current monitoring configuration. |
164 virtual void GetMonitoringStatus( | 162 virtual void GetMonitoringStatus( |
165 bool* out_enabled, | 163 bool* out_enabled, |
166 base::trace_event::CategoryFilter* out_category_filter, | 164 base::trace_event::TraceConfig* out_trace_config) = 0; |
167 base::trace_event::TraceOptions* out_trace_options) = 0; | |
168 | 165 |
169 // Get the current monitoring traced data. | 166 // Get the current monitoring traced data. |
170 // | 167 // |
171 // Child processes typically are caching trace data and only rarely flush | 168 // Child processes typically are caching trace data and only rarely flush |
172 // and send trace data back to the browser process. That is because it may be | 169 // and send trace data back to the browser process. That is because it may be |
173 // an expensive operation to send the trace data over IPC, and we would like | 170 // an expensive operation to send the trace data over IPC, and we would like |
174 // to avoid much runtime overhead of tracing. So, to end tracing, we must | 171 // to avoid much runtime overhead of tracing. So, to end tracing, we must |
175 // asynchronously ask all child processes to flush any pending trace data. | 172 // asynchronously ask all child processes to flush any pending trace data. |
176 // | 173 // |
177 // Once all child processes have acked to the CaptureMonitoringSnapshot | 174 // Once all child processes have acked to the CaptureMonitoringSnapshot |
(...skipping 24 matching lines...) Expand all Loading... |
202 // watch event callback. | 199 // watch event callback. |
203 virtual bool CancelWatchEvent() = 0; | 200 virtual bool CancelWatchEvent() = 0; |
204 | 201 |
205 protected: | 202 protected: |
206 virtual ~TracingController() {} | 203 virtual ~TracingController() {} |
207 }; | 204 }; |
208 | 205 |
209 } // namespace content | 206 } // namespace content |
210 | 207 |
211 #endif // CONTENT_PUBLIC_BROWSER_TRACING_CONTROLLER_H_ | 208 #endif // CONTENT_PUBLIC_BROWSER_TRACING_CONTROLLER_H_ |
OLD | NEW |