OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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_BROWSER_TRACING_TRACING_CONTROLLER_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_TRACING_TRACING_CONTROLLER_IMPL_H_ |
6 #define CONTENT_BROWSER_TRACING_TRACING_CONTROLLER_IMPL_H_ | 6 #define CONTENT_BROWSER_TRACING_TRACING_CONTROLLER_IMPL_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/lazy_instance.h" | 12 #include "base/lazy_instance.h" |
| 13 #include "base/time/time.h" |
13 #include "base/trace_event/memory_dump_manager.h" | 14 #include "base/trace_event/memory_dump_manager.h" |
14 #include "base/trace_event/tracing_agent.h" | 15 #include "base/trace_event/tracing_agent.h" |
15 #include "content/public/browser/tracing_controller.h" | 16 #include "content/public/browser/tracing_controller.h" |
16 | 17 |
17 namespace base { | 18 namespace base { |
18 class RefCountedString; | 19 class RefCountedString; |
19 class RefCountedMemory; | 20 class RefCountedMemory; |
20 } | 21 } |
21 | 22 |
22 namespace content { | 23 namespace content { |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 void OnWatchEventMatched(); | 158 void OnWatchEventMatched(); |
158 | 159 |
159 void SetEnabledOnFileThread( | 160 void SetEnabledOnFileThread( |
160 const base::trace_event::TraceConfig& trace_config, | 161 const base::trace_event::TraceConfig& trace_config, |
161 int mode, | 162 int mode, |
162 const base::Closure& callback); | 163 const base::Closure& callback); |
163 void SetDisabledOnFileThread(const base::Closure& callback); | 164 void SetDisabledOnFileThread(const base::Closure& callback); |
164 void OnStartAgentTracingDone( | 165 void OnStartAgentTracingDone( |
165 const base::trace_event::TraceConfig& trace_config, | 166 const base::trace_event::TraceConfig& trace_config, |
166 const StartTracingDoneCallback& callback); | 167 const StartTracingDoneCallback& callback); |
| 168 void StopTracingAfterClockSync(); |
167 void OnStopTracingDone(); | 169 void OnStopTracingDone(); |
168 void OnStartMonitoringDone( | 170 void OnStartMonitoringDone( |
169 const base::trace_event::TraceConfig& trace_config, | 171 const base::trace_event::TraceConfig& trace_config, |
170 const StartMonitoringDoneCallback& callback); | 172 const StartMonitoringDoneCallback& callback); |
171 void OnStopMonitoringDone(const StopMonitoringDoneCallback& callback); | 173 void OnStopMonitoringDone(const StopMonitoringDoneCallback& callback); |
172 | 174 |
173 void OnMonitoringStateChanged(bool is_monitoring); | 175 void OnMonitoringStateChanged(bool is_monitoring); |
174 | 176 |
| 177 int GetUniqueClockSyncID(); |
175 // Issue clock sync markers to the tracing agents. | 178 // Issue clock sync markers to the tracing agents. |
176 void IssueClockSyncMarker(); | 179 void IssueClockSyncMarker(); |
| 180 void OnClockSyncMarkerRecordedByAgent( |
| 181 int sync_id, |
| 182 const base::TimeTicks& issue_ts, |
| 183 const base::TimeTicks& issue_end_ts); |
177 | 184 |
178 typedef std::set<scoped_refptr<TraceMessageFilter>> TraceMessageFilterSet; | 185 typedef std::set<scoped_refptr<TraceMessageFilter>> TraceMessageFilterSet; |
179 TraceMessageFilterSet trace_message_filters_; | 186 TraceMessageFilterSet trace_message_filters_; |
180 | 187 |
181 // Pending acks for StopTracing. | 188 // Pending acks for StopTracing. |
182 int pending_stop_tracing_ack_count_; | 189 int pending_stop_tracing_ack_count_; |
183 TraceMessageFilterSet pending_stop_tracing_filters_; | 190 TraceMessageFilterSet pending_stop_tracing_filters_; |
184 | 191 |
185 // Pending acks for CaptureMonitoringSnapshot. | 192 // Pending acks for CaptureMonitoringSnapshot. |
186 int pending_capture_monitoring_snapshot_ack_count_; | 193 int pending_capture_monitoring_snapshot_ack_count_; |
187 TraceMessageFilterSet pending_capture_monitoring_filters_; | 194 TraceMessageFilterSet pending_capture_monitoring_filters_; |
188 | 195 |
189 // Pending acks for GetTraceLogStatus. | 196 // Pending acks for GetTraceLogStatus. |
190 int pending_trace_log_status_ack_count_; | 197 int pending_trace_log_status_ack_count_; |
191 TraceMessageFilterSet pending_trace_log_status_filters_; | 198 TraceMessageFilterSet pending_trace_log_status_filters_; |
192 float maximum_trace_buffer_usage_; | 199 float maximum_trace_buffer_usage_; |
193 size_t approximate_event_count_; | 200 size_t approximate_event_count_; |
194 | 201 |
195 // Pending acks for memory RequestGlobalDumpPoint. | 202 // Pending acks for memory RequestGlobalDumpPoint. |
196 int pending_memory_dump_ack_count_; | 203 int pending_memory_dump_ack_count_; |
197 int failed_memory_dump_count_; | 204 int failed_memory_dump_count_; |
198 TraceMessageFilterSet pending_memory_dump_filters_; | 205 TraceMessageFilterSet pending_memory_dump_filters_; |
199 uint64 pending_memory_dump_guid_; | 206 uint64 pending_memory_dump_guid_; |
200 base::trace_event::MemoryDumpCallback pending_memory_dump_callback_; | 207 base::trace_event::MemoryDumpCallback pending_memory_dump_callback_; |
201 | 208 |
202 StartTracingDoneCallback start_tracing_done_callback_; | 209 StartTracingDoneCallback start_tracing_done_callback_; |
203 std::vector<base::trace_event::TracingAgent*> additional_tracing_agents_; | 210 std::vector<base::trace_event::TracingAgent*> additional_tracing_agents_; |
| 211 int clock_sync_id_; |
| 212 int pending_clock_sync_ack_count_; |
| 213 base::OneShotTimer clock_sync_timer_; |
204 | 214 |
205 bool is_tracing_; | 215 bool is_tracing_; |
206 bool is_monitoring_; | 216 bool is_monitoring_; |
207 | 217 |
208 GetCategoriesDoneCallback pending_get_categories_done_callback_; | 218 GetCategoriesDoneCallback pending_get_categories_done_callback_; |
209 GetTraceBufferUsageCallback pending_trace_buffer_usage_callback_; | 219 GetTraceBufferUsageCallback pending_trace_buffer_usage_callback_; |
210 | 220 |
211 std::string watch_category_name_; | 221 std::string watch_category_name_; |
212 std::string watch_event_name_; | 222 std::string watch_event_name_; |
213 WatchEventCallback watch_event_callback_; | 223 WatchEventCallback watch_event_callback_; |
214 | 224 |
215 base::ObserverList<TraceMessageFilterObserver> | 225 base::ObserverList<TraceMessageFilterObserver> |
216 trace_message_filter_observers_; | 226 trace_message_filter_observers_; |
217 | 227 |
218 std::set<std::string> known_category_groups_; | 228 std::set<std::string> known_category_groups_; |
219 std::set<TracingUI*> tracing_uis_; | 229 std::set<TracingUI*> tracing_uis_; |
220 scoped_refptr<TraceDataSink> trace_data_sink_; | 230 scoped_refptr<TraceDataSink> trace_data_sink_; |
221 scoped_refptr<TraceDataSink> monitoring_data_sink_; | 231 scoped_refptr<TraceDataSink> monitoring_data_sink_; |
222 | 232 |
223 DISALLOW_COPY_AND_ASSIGN(TracingControllerImpl); | 233 DISALLOW_COPY_AND_ASSIGN(TracingControllerImpl); |
224 }; | 234 }; |
225 | 235 |
226 } // namespace content | 236 } // namespace content |
227 | 237 |
228 #endif // CONTENT_BROWSER_TRACING_TRACING_CONTROLLER_IMPL_H_ | 238 #endif // CONTENT_BROWSER_TRACING_TRACING_CONTROLLER_IMPL_H_ |
OLD | NEW |