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 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 // request, TracingFileResultCallback will be called back with a file that | 154 // request, TracingFileResultCallback will be called back with a file that |
155 // contains the traced data. | 155 // contains the traced data. |
156 // | 156 // |
157 // If |trace_data_sink| is not null, it will receive chunks of trace data | 157 // If |trace_data_sink| is not null, it will receive chunks of trace data |
158 // as a comma-separated sequences of JSON-stringified events, followed by | 158 // as a comma-separated sequences of JSON-stringified events, followed by |
159 // a notification that the trace collection is finished. | 159 // a notification that the trace collection is finished. |
160 virtual bool CaptureMonitoringSnapshot( | 160 virtual bool CaptureMonitoringSnapshot( |
161 const scoped_refptr<TraceDataSink>& trace_data_sink) = 0; | 161 const scoped_refptr<TraceDataSink>& trace_data_sink) = 0; |
162 | 162 |
163 // Get the maximum across processes of trace buffer percent full state. | 163 // Get the maximum across processes of trace buffer percent full state. |
164 // When the TraceBufferPercentFull value is determined, the callback is | 164 // When the TraceBufferUsage value is determined, the callback is |
165 // called. | 165 // called. |
166 typedef base::Callback<void(float)> GetTraceBufferPercentFullCallback; | 166 typedef base::Callback<void(float, size_t)> GetTraceBufferUsageCallback; |
167 virtual bool GetTraceBufferPercentFull( | 167 virtual bool GetTraceBufferUsage( |
168 const GetTraceBufferPercentFullCallback& callback) = 0; | 168 const GetTraceBufferUsageCallback& callback) = 0; |
169 | 169 |
170 // |callback| will will be called every time the given event occurs on any | 170 // |callback| will will be called every time the given event occurs on any |
171 // process. | 171 // process. |
172 typedef base::Callback<void()> WatchEventCallback; | 172 typedef base::Callback<void()> WatchEventCallback; |
173 virtual bool SetWatchEvent(const std::string& category_name, | 173 virtual bool SetWatchEvent(const std::string& category_name, |
174 const std::string& event_name, | 174 const std::string& event_name, |
175 const WatchEventCallback& callback) = 0; | 175 const WatchEventCallback& callback) = 0; |
176 | 176 |
177 // Cancel the watch event. If tracing is enabled, this may race with the | 177 // Cancel the watch event. If tracing is enabled, this may race with the |
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 |