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

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

Issue 2466873002: Enable FILTERING_MODE for tracing if event filters were given in config (Closed)
Patch Set: Rebase and add TODO. Created 3 years, 9 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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 void AddTraceMessageFilterObserver(TraceMessageFilterObserver* observer); 95 void AddTraceMessageFilterObserver(TraceMessageFilterObserver* observer);
96 void RemoveTraceMessageFilterObserver(TraceMessageFilterObserver* observer); 96 void RemoveTraceMessageFilterObserver(TraceMessageFilterObserver* observer);
97 97
98 private: 98 private:
99 friend struct base::LazyInstanceTraitsBase<TracingControllerImpl>; 99 friend struct base::LazyInstanceTraitsBase<TracingControllerImpl>;
100 friend class TraceMessageFilter; 100 friend class TraceMessageFilter;
101 101
102 TracingControllerImpl(); 102 TracingControllerImpl();
103 ~TracingControllerImpl() override; 103 ~TracingControllerImpl() override;
104 104
105 bool can_start_tracing() const { 105 bool can_start_tracing() const { return !enabled_tracing_modes_; }
106 return !is_tracing_;
107 }
108 106
109 bool can_stop_tracing() const { 107 bool can_stop_tracing() const {
110 return is_tracing_ && !trace_data_sink_.get(); 108 return enabled_tracing_modes_ && !trace_data_sink_.get();
111 } 109 }
112 110
113 bool can_start_monitoring() const { 111 bool can_start_monitoring() const {
114 return !is_monitoring_; 112 return !is_monitoring_;
115 } 113 }
116 114
117 bool can_stop_monitoring() const { 115 bool can_stop_monitoring() const {
118 return is_monitoring_ && !monitoring_data_sink_.get(); 116 return is_monitoring_ && !monitoring_data_sink_.get();
119 } 117 }
120 118
(...skipping 26 matching lines...) Expand all
147 void OnEndAgentTracingAcked( 145 void OnEndAgentTracingAcked(
148 const std::string& agent_name, 146 const std::string& agent_name,
149 const std::string& events_label, 147 const std::string& events_label,
150 const scoped_refptr<base::RefCountedString>& events_str_ptr); 148 const scoped_refptr<base::RefCountedString>& events_str_ptr);
151 149
152 void OnTraceLogStatusReply(TraceMessageFilter* trace_message_filter, 150 void OnTraceLogStatusReply(TraceMessageFilter* trace_message_filter,
153 const base::trace_event::TraceLogStatus& status); 151 const base::trace_event::TraceLogStatus& status);
154 152
155 void SetEnabledOnFileThread( 153 void SetEnabledOnFileThread(
156 const base::trace_event::TraceConfig& trace_config, 154 const base::trace_event::TraceConfig& trace_config,
157 int mode,
158 const base::Closure& callback); 155 const base::Closure& callback);
159 void SetDisabledOnFileThread(const base::Closure& callback); 156 void SetDisabledOnFileThread(const base::Closure& callback);
160 void OnAllTracingAgentsStarted(); 157 void OnAllTracingAgentsStarted();
161 void StopTracingAfterClockSync(); 158 void StopTracingAfterClockSync();
162 void OnStopTracingDone(); 159 void OnStopTracingDone();
163 160
164 // Issue clock sync markers to the tracing agents. 161 // Issue clock sync markers to the tracing agents.
165 void IssueClockSyncMarker(); 162 void IssueClockSyncMarker();
166 void OnClockSyncMarkerRecordedByAgent( 163 void OnClockSyncMarkerRecordedByAgent(
167 const std::string& sync_id, 164 const std::string& sync_id,
(...skipping 20 matching lines...) Expand all
188 // Pending acks for GetTraceLogStatus. 185 // Pending acks for GetTraceLogStatus.
189 int pending_trace_log_status_ack_count_; 186 int pending_trace_log_status_ack_count_;
190 TraceMessageFilterSet pending_trace_log_status_filters_; 187 TraceMessageFilterSet pending_trace_log_status_filters_;
191 float maximum_trace_buffer_usage_; 188 float maximum_trace_buffer_usage_;
192 size_t approximate_event_count_; 189 size_t approximate_event_count_;
193 190
194 std::vector<base::trace_event::TracingAgent*> additional_tracing_agents_; 191 std::vector<base::trace_event::TracingAgent*> additional_tracing_agents_;
195 int pending_clock_sync_ack_count_; 192 int pending_clock_sync_ack_count_;
196 base::OneShotTimer clock_sync_timer_; 193 base::OneShotTimer clock_sync_timer_;
197 194
198 bool is_tracing_; 195 uint8_t enabled_tracing_modes_;
199 bool is_monitoring_; 196 bool is_monitoring_;
200 197
201 GetCategoriesDoneCallback pending_get_categories_done_callback_; 198 GetCategoriesDoneCallback pending_get_categories_done_callback_;
202 GetTraceBufferUsageCallback pending_trace_buffer_usage_callback_; 199 GetTraceBufferUsageCallback pending_trace_buffer_usage_callback_;
203 200
204 base::ObserverList<TraceMessageFilterObserver> 201 base::ObserverList<TraceMessageFilterObserver>
205 trace_message_filter_observers_; 202 trace_message_filter_observers_;
206 203
207 std::set<std::string> known_category_groups_; 204 std::set<std::string> known_category_groups_;
208 std::set<TracingUI*> tracing_uis_; 205 std::set<TracingUI*> tracing_uis_;
209 scoped_refptr<TraceDataSink> trace_data_sink_; 206 scoped_refptr<TraceDataSink> trace_data_sink_;
210 scoped_refptr<TraceDataSink> monitoring_data_sink_; 207 scoped_refptr<TraceDataSink> monitoring_data_sink_;
211 std::unique_ptr<base::DictionaryValue> metadata_; 208 std::unique_ptr<base::DictionaryValue> metadata_;
212 209
213 DISALLOW_COPY_AND_ASSIGN(TracingControllerImpl); 210 DISALLOW_COPY_AND_ASSIGN(TracingControllerImpl);
214 }; 211 };
215 212
216 } // namespace content 213 } // namespace content
217 214
218 #endif // CONTENT_BROWSER_TRACING_TRACING_CONTROLLER_IMPL_H_ 215 #endif // CONTENT_BROWSER_TRACING_TRACING_CONTROLLER_IMPL_H_
OLDNEW
« no previous file with comments | « components/tracing/common/trace_startup.cc ('k') | content/browser/tracing/tracing_controller_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698