Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Side by Side Diff: content/browser/tracing/tracing_controller_impl.h

Issue 1614063005: Adds a callback to TracingAgent::StartAgentTracing() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 const WatchEventCallback& callback) override; 58 const WatchEventCallback& callback) override;
59 bool CancelWatchEvent() override; 59 bool CancelWatchEvent() override;
60 bool IsTracing() const override; 60 bool IsTracing() const override;
61 61
62 void RegisterTracingUI(TracingUI* tracing_ui); 62 void RegisterTracingUI(TracingUI* tracing_ui);
63 void UnregisterTracingUI(TracingUI* tracing_ui); 63 void UnregisterTracingUI(TracingUI* tracing_ui);
64 64
65 // base::trace_event::TracingAgent implementation. 65 // base::trace_event::TracingAgent implementation.
66 std::string GetTracingAgentName() override; 66 std::string GetTracingAgentName() override;
67 std::string GetTraceEventLabel() override; 67 std::string GetTraceEventLabel() override;
68 bool StartAgentTracing( 68 void StartAgentTracing(const base::trace_event::TraceConfig& trace_config,
69 const base::trace_event::TraceConfig& trace_config) override; 69 const StartAgentTracingCallback& callback) override;
70 void StopAgentTracing(const StopAgentTracingCallback& callback) override; 70 void StopAgentTracing(const StopAgentTracingCallback& callback) override;
71 bool SupportsExplicitClockSync() override; 71 bool SupportsExplicitClockSync() override;
72 void RecordClockSyncMarker( 72 void RecordClockSyncMarker(
73 int sync_id, 73 int sync_id,
74 const RecordClockSyncMarkerCallback& callback) override; 74 const RecordClockSyncMarkerCallback& callback) override;
75 75
76 // base::trace_event::MemoryDumpManagerDelegate implementation. 76 // base::trace_event::MemoryDumpManagerDelegate implementation.
77 void RequestGlobalMemoryDump( 77 void RequestGlobalMemoryDump(
78 const base::trace_event::MemoryDumpRequestArgs& args, 78 const base::trace_event::MemoryDumpRequestArgs& args,
79 const base::trace_event::MemoryDumpCallback& callback) override; 79 const base::trace_event::MemoryDumpCallback& callback) override;
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 129
130 // Callback of TraceLog::Flush() for the local trace. 130 // Callback of TraceLog::Flush() for the local trace.
131 void OnLocalTraceDataCollected( 131 void OnLocalTraceDataCollected(
132 const scoped_refptr<base::RefCountedString>& events_str_ptr, 132 const scoped_refptr<base::RefCountedString>& events_str_ptr,
133 bool has_more_events); 133 bool has_more_events);
134 // Callback of TraceLog::FlushMonitoring() for the local trace. 134 // Callback of TraceLog::FlushMonitoring() for the local trace.
135 void OnLocalMonitoringTraceDataCollected( 135 void OnLocalMonitoringTraceDataCollected(
136 const scoped_refptr<base::RefCountedString>& events_str_ptr, 136 const scoped_refptr<base::RefCountedString>& events_str_ptr,
137 bool has_more_events); 137 bool has_more_events);
138 138
139 // Adds the tracing agent with the specified agent name to the list of
140 // additional tracing agents.
141 void AddTracingAgent(const std::string& agent_name);
142
143 void OnStartAgentTracingAcked(const std::string& agent_name, bool success);
144
139 void OnStopTracingAcked( 145 void OnStopTracingAcked(
140 TraceMessageFilter* trace_message_filter, 146 TraceMessageFilter* trace_message_filter,
141 const std::vector<std::string>& known_category_groups); 147 const std::vector<std::string>& known_category_groups);
142 148
143 void OnEndAgentTracingAcked( 149 void OnEndAgentTracingAcked(
144 const std::string& agent_name, 150 const std::string& agent_name,
145 const std::string& events_label, 151 const std::string& events_label,
146 const scoped_refptr<base::RefCountedString>& events_str_ptr); 152 const scoped_refptr<base::RefCountedString>& events_str_ptr);
147 153
148 void OnCaptureMonitoringSnapshotAcked( 154 void OnCaptureMonitoringSnapshotAcked(
(...skipping 10 matching lines...) Expand all
159 165
160 void FinalizeGlobalMemoryDumpIfAllProcessesReplied(); 166 void FinalizeGlobalMemoryDumpIfAllProcessesReplied();
161 167
162 void OnWatchEventMatched(); 168 void OnWatchEventMatched();
163 169
164 void SetEnabledOnFileThread( 170 void SetEnabledOnFileThread(
165 const base::trace_event::TraceConfig& trace_config, 171 const base::trace_event::TraceConfig& trace_config,
166 int mode, 172 int mode,
167 const base::Closure& callback); 173 const base::Closure& callback);
168 void SetDisabledOnFileThread(const base::Closure& callback); 174 void SetDisabledOnFileThread(const base::Closure& callback);
169 void OnStartAgentTracingDone( 175 void OnAllTracingAgentsStarted();
170 const base::trace_event::TraceConfig& trace_config);
171 void StopTracingAfterClockSync(); 176 void StopTracingAfterClockSync();
172 void OnStopTracingDone(); 177 void OnStopTracingDone();
173 void OnStartMonitoringDone( 178 void OnStartMonitoringDone(
174 const base::trace_event::TraceConfig& trace_config, 179 const base::trace_event::TraceConfig& trace_config,
175 const StartMonitoringDoneCallback& callback); 180 const StartMonitoringDoneCallback& callback);
176 void OnStopMonitoringDone(const StopMonitoringDoneCallback& callback); 181 void OnStopMonitoringDone(const StopMonitoringDoneCallback& callback);
177 182
178 void OnMonitoringStateChanged(bool is_monitoring); 183 void OnMonitoringStateChanged(bool is_monitoring);
179 184
180 int GetUniqueClockSyncID(); 185 int GetUniqueClockSyncID();
181 // Issue clock sync markers to the tracing agents. 186 // Issue clock sync markers to the tracing agents.
182 void IssueClockSyncMarker(); 187 void IssueClockSyncMarker();
183 void OnClockSyncMarkerRecordedByAgent( 188 void OnClockSyncMarkerRecordedByAgent(
184 int sync_id, 189 int sync_id,
185 const base::TimeTicks& issue_ts, 190 const base::TimeTicks& issue_ts,
186 const base::TimeTicks& issue_end_ts); 191 const base::TimeTicks& issue_end_ts);
187 192
188 typedef std::set<scoped_refptr<TraceMessageFilter>> TraceMessageFilterSet; 193 typedef std::set<scoped_refptr<TraceMessageFilter>> TraceMessageFilterSet;
189 TraceMessageFilterSet trace_message_filters_; 194 TraceMessageFilterSet trace_message_filters_;
190 195
196 // Pending acks for StartTracing.
197 int pending_start_tracing_ack_count_;
198 base::OneShotTimer start_tracing_timer_;
199 StartTracingDoneCallback start_tracing_done_callback_;
200 scoped_ptr<base::trace_event::TraceConfig> start_tracing_trace_config_;
201
191 // Pending acks for StopTracing. 202 // Pending acks for StopTracing.
192 int pending_stop_tracing_ack_count_; 203 int pending_stop_tracing_ack_count_;
193 TraceMessageFilterSet pending_stop_tracing_filters_; 204 TraceMessageFilterSet pending_stop_tracing_filters_;
194 205
195 // Pending acks for CaptureMonitoringSnapshot. 206 // Pending acks for CaptureMonitoringSnapshot.
196 int pending_capture_monitoring_snapshot_ack_count_; 207 int pending_capture_monitoring_snapshot_ack_count_;
197 TraceMessageFilterSet pending_capture_monitoring_filters_; 208 TraceMessageFilterSet pending_capture_monitoring_filters_;
198 209
199 // Pending acks for GetTraceLogStatus. 210 // Pending acks for GetTraceLogStatus.
200 int pending_trace_log_status_ack_count_; 211 int pending_trace_log_status_ack_count_;
201 TraceMessageFilterSet pending_trace_log_status_filters_; 212 TraceMessageFilterSet pending_trace_log_status_filters_;
202 float maximum_trace_buffer_usage_; 213 float maximum_trace_buffer_usage_;
203 size_t approximate_event_count_; 214 size_t approximate_event_count_;
204 215
205 // Pending acks for memory RequestGlobalDumpPoint. 216 // Pending acks for memory RequestGlobalDumpPoint.
206 int pending_memory_dump_ack_count_; 217 int pending_memory_dump_ack_count_;
207 int failed_memory_dump_count_; 218 int failed_memory_dump_count_;
208 TraceMessageFilterSet pending_memory_dump_filters_; 219 TraceMessageFilterSet pending_memory_dump_filters_;
209 uint64_t pending_memory_dump_guid_; 220 uint64_t pending_memory_dump_guid_;
210 base::trace_event::MemoryDumpCallback pending_memory_dump_callback_; 221 base::trace_event::MemoryDumpCallback pending_memory_dump_callback_;
211 222
212 StartTracingDoneCallback start_tracing_done_callback_;
213 std::vector<base::trace_event::TracingAgent*> additional_tracing_agents_; 223 std::vector<base::trace_event::TracingAgent*> additional_tracing_agents_;
214 int clock_sync_id_; 224 int clock_sync_id_;
215 int pending_clock_sync_ack_count_; 225 int pending_clock_sync_ack_count_;
216 base::OneShotTimer clock_sync_timer_; 226 base::OneShotTimer clock_sync_timer_;
217 227
218 bool is_tracing_; 228 bool is_tracing_;
219 bool is_monitoring_; 229 bool is_monitoring_;
220 230
221 GetCategoriesDoneCallback pending_get_categories_done_callback_; 231 GetCategoriesDoneCallback pending_get_categories_done_callback_;
222 GetTraceBufferUsageCallback pending_trace_buffer_usage_callback_; 232 GetTraceBufferUsageCallback pending_trace_buffer_usage_callback_;
223 233
224 std::string watch_category_name_; 234 std::string watch_category_name_;
225 std::string watch_event_name_; 235 std::string watch_event_name_;
226 WatchEventCallback watch_event_callback_; 236 WatchEventCallback watch_event_callback_;
227 237
228 base::ObserverList<TraceMessageFilterObserver> 238 base::ObserverList<TraceMessageFilterObserver>
229 trace_message_filter_observers_; 239 trace_message_filter_observers_;
230 240
231 std::set<std::string> known_category_groups_; 241 std::set<std::string> known_category_groups_;
232 std::set<TracingUI*> tracing_uis_; 242 std::set<TracingUI*> tracing_uis_;
233 scoped_refptr<TraceDataSink> trace_data_sink_; 243 scoped_refptr<TraceDataSink> trace_data_sink_;
234 scoped_refptr<TraceDataSink> monitoring_data_sink_; 244 scoped_refptr<TraceDataSink> monitoring_data_sink_;
235 245
236 DISALLOW_COPY_AND_ASSIGN(TracingControllerImpl); 246 DISALLOW_COPY_AND_ASSIGN(TracingControllerImpl);
237 }; 247 };
238 248
239 } // namespace content 249 } // namespace content
240 250
241 #endif // CONTENT_BROWSER_TRACING_TRACING_CONTROLLER_IMPL_H_ 251 #endif // CONTENT_BROWSER_TRACING_TRACING_CONTROLLER_IMPL_H_
OLDNEW
« no previous file with comments | « content/browser/tracing/power_tracing_agent.cc ('k') | content/browser/tracing/tracing_controller_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698