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> |
(...skipping 13 matching lines...) Expand all Loading... | |
24 | 24 |
25 class TracingControllerImpl : public TracingController { | 25 class TracingControllerImpl : public TracingController { |
26 public: | 26 public: |
27 static TracingControllerImpl* GetInstance(); | 27 static TracingControllerImpl* GetInstance(); |
28 | 28 |
29 // TracingController implementation. | 29 // TracingController implementation. |
30 virtual bool GetCategories( | 30 virtual bool GetCategories( |
31 const GetCategoriesDoneCallback& callback) OVERRIDE; | 31 const GetCategoriesDoneCallback& callback) OVERRIDE; |
32 virtual bool EnableRecording( | 32 virtual bool EnableRecording( |
33 const std::string& category_filter, | 33 const std::string& category_filter, |
34 TracingController::Options options, | 34 base::debug::TraceOptions trace_options, |
35 bool enable_systrace, | |
dsinclair
2014/07/28 18:52:36
I find this bool makes the call sites a lot harder
nednguyen
2014/07/28 20:27:22
I think the distinction here is tracing option is
nednguyen
2014/07/29 19:33:20
Added enable_systrace to TraceOptions.
| |
35 const EnableRecordingDoneCallback& callback) OVERRIDE; | 36 const EnableRecordingDoneCallback& callback) OVERRIDE; |
36 virtual bool DisableRecording( | 37 virtual bool DisableRecording( |
37 const base::FilePath& result_file_path, | 38 const base::FilePath& result_file_path, |
38 const TracingFileResultCallback& callback) OVERRIDE; | 39 const TracingFileResultCallback& callback) OVERRIDE; |
39 virtual bool EnableMonitoring(const std::string& category_filter, | 40 virtual bool EnableMonitoring( |
40 TracingController::Options options, | 41 const std::string& category_filter, |
42 base::debug::TraceOptions trace_options, | |
41 const EnableMonitoringDoneCallback& callback) OVERRIDE; | 43 const EnableMonitoringDoneCallback& callback) OVERRIDE; |
42 virtual bool DisableMonitoring( | 44 virtual bool DisableMonitoring( |
43 const DisableMonitoringDoneCallback& callback) OVERRIDE; | 45 const DisableMonitoringDoneCallback& callback) OVERRIDE; |
44 virtual void GetMonitoringStatus( | 46 virtual void GetMonitoringStatus( |
45 bool* out_enabled, | 47 bool* out_enabled, |
46 std::string* out_category_filter, | 48 std::string* out_category_filter, |
47 TracingController::Options* out_options) OVERRIDE; | 49 base::debug::TraceOptions* out_trace_options, |
50 bool* out_enable_systrace) OVERRIDE; | |
48 virtual bool CaptureMonitoringSnapshot( | 51 virtual bool CaptureMonitoringSnapshot( |
49 const base::FilePath& result_file_path, | 52 const base::FilePath& result_file_path, |
50 const TracingFileResultCallback& callback) OVERRIDE; | 53 const TracingFileResultCallback& callback) OVERRIDE; |
51 virtual bool GetTraceBufferPercentFull( | 54 virtual bool GetTraceBufferPercentFull( |
52 const GetTraceBufferPercentFullCallback& callback) OVERRIDE; | 55 const GetTraceBufferPercentFullCallback& callback) OVERRIDE; |
53 virtual bool SetWatchEvent(const std::string& category_name, | 56 virtual bool SetWatchEvent(const std::string& category_name, |
54 const std::string& event_name, | 57 const std::string& event_name, |
55 const WatchEventCallback& callback) OVERRIDE; | 58 const WatchEventCallback& callback) OVERRIDE; |
56 virtual bool CancelWatchEvent() OVERRIDE; | 59 virtual bool CancelWatchEvent() OVERRIDE; |
57 | 60 |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
126 void OnMonitoringSnapshotFileClosed(); | 129 void OnMonitoringSnapshotFileClosed(); |
127 | 130 |
128 void OnTraceBufferPercentFullReply( | 131 void OnTraceBufferPercentFullReply( |
129 TraceMessageFilter* trace_message_filter, | 132 TraceMessageFilter* trace_message_filter, |
130 float percent_full); | 133 float percent_full); |
131 | 134 |
132 void OnWatchEventMatched(); | 135 void OnWatchEventMatched(); |
133 | 136 |
134 void SetEnabledOnFileThread(const std::string& category_filter, | 137 void SetEnabledOnFileThread(const std::string& category_filter, |
135 int mode, | 138 int mode, |
136 int options, | 139 base::debug::TraceOptions trace_options, |
137 const base::Closure& callback); | 140 const base::Closure& callback); |
138 void SetDisabledOnFileThread(const base::Closure& callback); | 141 void SetDisabledOnFileThread(const base::Closure& callback); |
139 void OnEnableRecordingDone(const std::string& category_filter, | 142 void OnEnableRecordingDone(const std::string& category_filter, |
140 int trace_options, | 143 base::debug::TraceOptions trace_options, |
141 const EnableRecordingDoneCallback& callback); | 144 const EnableRecordingDoneCallback& callback); |
142 void OnDisableRecordingDone(const base::FilePath& result_file_path, | 145 void OnDisableRecordingDone(const base::FilePath& result_file_path, |
143 const TracingFileResultCallback& callback); | 146 const TracingFileResultCallback& callback); |
144 void OnEnableMonitoringDone(const std::string& category_filter, | 147 void OnEnableMonitoringDone(const std::string& category_filter, |
145 int trace_options, | 148 base::debug::TraceOptions trace_options, |
146 const EnableMonitoringDoneCallback& callback); | 149 const EnableMonitoringDoneCallback& callback); |
147 void OnDisableMonitoringDone(const DisableMonitoringDoneCallback& callback); | 150 void OnDisableMonitoringDone(const DisableMonitoringDoneCallback& callback); |
148 | 151 |
149 void OnMonitoringStateChanged(bool is_monitoring); | 152 void OnMonitoringStateChanged(bool is_monitoring); |
150 | 153 |
151 TraceMessageFilterSet trace_message_filters_; | 154 TraceMessageFilterSet trace_message_filters_; |
152 | 155 |
153 // Pending acks for DisableRecording. | 156 // Pending acks for DisableRecording. |
154 int pending_disable_recording_ack_count_; | 157 int pending_disable_recording_ack_count_; |
155 TraceMessageFilterSet pending_disable_recording_filters_; | 158 TraceMessageFilterSet pending_disable_recording_filters_; |
156 // Pending acks for CaptureMonitoringSnapshot. | 159 // Pending acks for CaptureMonitoringSnapshot. |
157 int pending_capture_monitoring_snapshot_ack_count_; | 160 int pending_capture_monitoring_snapshot_ack_count_; |
158 TraceMessageFilterSet pending_capture_monitoring_filters_; | 161 TraceMessageFilterSet pending_capture_monitoring_filters_; |
159 // Pending acks for GetTraceBufferPercentFull. | 162 // Pending acks for GetTraceBufferPercentFull. |
160 int pending_trace_buffer_percent_full_ack_count_; | 163 int pending_trace_buffer_percent_full_ack_count_; |
161 TraceMessageFilterSet pending_trace_buffer_percent_full_filters_; | 164 TraceMessageFilterSet pending_trace_buffer_percent_full_filters_; |
162 float maximum_trace_buffer_percent_full_; | 165 float maximum_trace_buffer_percent_full_; |
163 | 166 |
164 #if defined(OS_CHROMEOS) || defined(OS_WIN) | 167 #if defined(OS_CHROMEOS) || defined(OS_WIN) |
165 bool is_system_tracing_; | 168 bool is_system_tracing_; |
166 #endif | 169 #endif |
167 bool is_recording_; | 170 bool is_recording_; |
168 bool is_monitoring_; | 171 bool is_monitoring_; |
169 TracingController::Options options_; | 172 base::debug::TraceOptions trace_options_; |
173 bool enable_systrace_; | |
170 | 174 |
171 GetCategoriesDoneCallback pending_get_categories_done_callback_; | 175 GetCategoriesDoneCallback pending_get_categories_done_callback_; |
172 TracingFileResultCallback pending_disable_recording_done_callback_; | 176 TracingFileResultCallback pending_disable_recording_done_callback_; |
173 TracingFileResultCallback pending_capture_monitoring_snapshot_done_callback_; | 177 TracingFileResultCallback pending_capture_monitoring_snapshot_done_callback_; |
174 GetTraceBufferPercentFullCallback pending_trace_buffer_percent_full_callback_; | 178 GetTraceBufferPercentFullCallback pending_trace_buffer_percent_full_callback_; |
175 | 179 |
176 std::string watch_category_name_; | 180 std::string watch_category_name_; |
177 std::string watch_event_name_; | 181 std::string watch_event_name_; |
178 WatchEventCallback watch_event_callback_; | 182 WatchEventCallback watch_event_callback_; |
179 | 183 |
180 std::set<std::string> known_category_groups_; | 184 std::set<std::string> known_category_groups_; |
181 std::set<TracingUI*> tracing_uis_; | 185 std::set<TracingUI*> tracing_uis_; |
182 scoped_ptr<ResultFile> result_file_; | 186 scoped_ptr<ResultFile> result_file_; |
183 scoped_ptr<ResultFile> monitoring_snapshot_file_; | 187 scoped_ptr<ResultFile> monitoring_snapshot_file_; |
184 DISALLOW_COPY_AND_ASSIGN(TracingControllerImpl); | 188 DISALLOW_COPY_AND_ASSIGN(TracingControllerImpl); |
185 }; | 189 }; |
186 | 190 |
187 } // namespace content | 191 } // namespace content |
188 | 192 |
189 #endif // CONTENT_BROWSER_TRACING_TRACING_CONTROLLER_IMPL_H_ | 193 #endif // CONTENT_BROWSER_TRACING_TRACING_CONTROLLER_IMPL_H_ |
OLD | NEW |