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 <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 const base::trace_event::MemoryDumpRequestArgs& args, | 112 const base::trace_event::MemoryDumpRequestArgs& args, |
113 const base::trace_event::MemoryDumpCallback& callback); | 113 const base::trace_event::MemoryDumpCallback& callback); |
114 ~QueuedMemoryDumpRequest(); | 114 ~QueuedMemoryDumpRequest(); |
115 const base::trace_event::MemoryDumpRequestArgs args; | 115 const base::trace_event::MemoryDumpRequestArgs args; |
116 const base::trace_event::MemoryDumpCallback callback; | 116 const base::trace_event::MemoryDumpCallback callback; |
117 }; | 117 }; |
118 | 118 |
119 TracingControllerImpl(); | 119 TracingControllerImpl(); |
120 ~TracingControllerImpl() override; | 120 ~TracingControllerImpl() override; |
121 | 121 |
122 bool can_start_tracing() const { | 122 bool can_start_tracing() const { return !enabled_tracing_modes_; } |
123 return !is_tracing_; | |
124 } | |
125 | 123 |
126 bool can_stop_tracing() const { | 124 bool can_stop_tracing() const { |
127 return is_tracing_ && !trace_data_sink_.get(); | 125 return enabled_tracing_modes_ && !trace_data_sink_.get(); |
128 } | 126 } |
129 | 127 |
130 bool can_start_monitoring() const { | 128 bool can_start_monitoring() const { |
131 return !is_monitoring_; | 129 return !is_monitoring_; |
132 } | 130 } |
133 | 131 |
134 bool can_stop_monitoring() const { | 132 bool can_stop_monitoring() const { |
135 return is_monitoring_ && !monitoring_data_sink_.get(); | 133 return is_monitoring_ && !monitoring_data_sink_.get(); |
136 } | 134 } |
137 | 135 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 uint64_t dump_guid, | 172 uint64_t dump_guid, |
175 bool success); | 173 bool success); |
176 | 174 |
177 // Callback of MemoryDumpManager::CreateProcessDump(). | 175 // Callback of MemoryDumpManager::CreateProcessDump(). |
178 void OnBrowserProcessMemoryDumpDone(uint64_t dump_guid, bool success); | 176 void OnBrowserProcessMemoryDumpDone(uint64_t dump_guid, bool success); |
179 | 177 |
180 void FinalizeGlobalMemoryDumpIfAllProcessesReplied(); | 178 void FinalizeGlobalMemoryDumpIfAllProcessesReplied(); |
181 | 179 |
182 void SetEnabledOnFileThread( | 180 void SetEnabledOnFileThread( |
183 const base::trace_event::TraceConfig& trace_config, | 181 const base::trace_event::TraceConfig& trace_config, |
184 int mode, | |
185 const base::Closure& callback); | 182 const base::Closure& callback); |
186 void SetDisabledOnFileThread(const base::Closure& callback); | 183 void SetDisabledOnFileThread(const base::Closure& callback); |
187 void OnAllTracingAgentsStarted(); | 184 void OnAllTracingAgentsStarted(); |
188 void StopTracingAfterClockSync(); | 185 void StopTracingAfterClockSync(); |
189 void OnStopTracingDone(); | 186 void OnStopTracingDone(); |
190 | 187 |
191 // Issue clock sync markers to the tracing agents. | 188 // Issue clock sync markers to the tracing agents. |
192 void IssueClockSyncMarker(); | 189 void IssueClockSyncMarker(); |
193 void OnClockSyncMarkerRecordedByAgent( | 190 void OnClockSyncMarkerRecordedByAgent( |
194 const std::string& sync_id, | 191 const std::string& sync_id, |
(...skipping 26 matching lines...) Expand all Loading... |
221 // Pending acks for memory RequestGlobalDumpPoint. | 218 // Pending acks for memory RequestGlobalDumpPoint. |
222 int pending_memory_dump_ack_count_; | 219 int pending_memory_dump_ack_count_; |
223 int failed_memory_dump_count_; | 220 int failed_memory_dump_count_; |
224 TraceMessageFilterSet pending_memory_dump_filters_; | 221 TraceMessageFilterSet pending_memory_dump_filters_; |
225 std::list<QueuedMemoryDumpRequest> queued_memory_dump_requests_; | 222 std::list<QueuedMemoryDumpRequest> queued_memory_dump_requests_; |
226 | 223 |
227 std::vector<base::trace_event::TracingAgent*> additional_tracing_agents_; | 224 std::vector<base::trace_event::TracingAgent*> additional_tracing_agents_; |
228 int pending_clock_sync_ack_count_; | 225 int pending_clock_sync_ack_count_; |
229 base::OneShotTimer clock_sync_timer_; | 226 base::OneShotTimer clock_sync_timer_; |
230 | 227 |
231 bool is_tracing_; | 228 uint8_t enabled_tracing_modes_; |
232 bool is_monitoring_; | 229 bool is_monitoring_; |
233 | 230 |
234 GetCategoriesDoneCallback pending_get_categories_done_callback_; | 231 GetCategoriesDoneCallback pending_get_categories_done_callback_; |
235 GetTraceBufferUsageCallback pending_trace_buffer_usage_callback_; | 232 GetTraceBufferUsageCallback pending_trace_buffer_usage_callback_; |
236 | 233 |
237 base::ObserverList<TraceMessageFilterObserver> | 234 base::ObserverList<TraceMessageFilterObserver> |
238 trace_message_filter_observers_; | 235 trace_message_filter_observers_; |
239 | 236 |
240 std::set<std::string> known_category_groups_; | 237 std::set<std::string> known_category_groups_; |
241 std::set<TracingUI*> tracing_uis_; | 238 std::set<TracingUI*> tracing_uis_; |
242 scoped_refptr<TraceDataSink> trace_data_sink_; | 239 scoped_refptr<TraceDataSink> trace_data_sink_; |
243 scoped_refptr<TraceDataSink> monitoring_data_sink_; | 240 scoped_refptr<TraceDataSink> monitoring_data_sink_; |
244 std::unique_ptr<base::DictionaryValue> metadata_; | 241 std::unique_ptr<base::DictionaryValue> metadata_; |
245 | 242 |
246 DISALLOW_COPY_AND_ASSIGN(TracingControllerImpl); | 243 DISALLOW_COPY_AND_ASSIGN(TracingControllerImpl); |
247 }; | 244 }; |
248 | 245 |
249 } // namespace content | 246 } // namespace content |
250 | 247 |
251 #endif // CONTENT_BROWSER_TRACING_TRACING_CONTROLLER_IMPL_H_ | 248 #endif // CONTENT_BROWSER_TRACING_TRACING_CONTROLLER_IMPL_H_ |
OLD | NEW |