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

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

Issue 425593002: Refactor trace_event_impl's SetEnabled to use TraceOptions. Propagate this through the whole stack. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address Nat's comments. Created 6 years, 4 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 <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 12 matching lines...) Expand all
23 class TracingUI; 23 class TracingUI;
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 base::debug::CategoryFilter& category_filter,
dsinclair 2014/07/30 14:25:26 Leave for a separate CL.
34 TracingController::Options options, 34 const base::debug::TraceOptions& trace_options,
35 const EnableRecordingDoneCallback& callback) OVERRIDE; 35 const EnableRecordingDoneCallback& callback) OVERRIDE;
36 virtual bool DisableRecording( 36 virtual bool DisableRecording(
37 const base::FilePath& result_file_path, 37 const base::FilePath& result_file_path,
38 const TracingFileResultCallback& callback) OVERRIDE; 38 const TracingFileResultCallback& callback) OVERRIDE;
39 virtual bool EnableMonitoring(const std::string& category_filter, 39 virtual bool EnableMonitoring(
40 TracingController::Options options, 40 const base::debug::CategoryFilter& category_filter,
41 const base::debug::TraceOptions& trace_options,
41 const EnableMonitoringDoneCallback& callback) OVERRIDE; 42 const EnableMonitoringDoneCallback& callback) OVERRIDE;
42 virtual bool DisableMonitoring( 43 virtual bool DisableMonitoring(
43 const DisableMonitoringDoneCallback& callback) OVERRIDE; 44 const DisableMonitoringDoneCallback& callback) OVERRIDE;
44 virtual void GetMonitoringStatus( 45 virtual void GetMonitoringStatus(
45 bool* out_enabled, 46 bool* out_enabled,
46 std::string* out_category_filter, 47 base::debug::CategoryFilter* out_category_filter,
47 TracingController::Options* out_options) OVERRIDE; 48 base::debug::TraceOptions* out_trace_options) OVERRIDE;
48 virtual bool CaptureMonitoringSnapshot( 49 virtual bool CaptureMonitoringSnapshot(
49 const base::FilePath& result_file_path, 50 const base::FilePath& result_file_path,
50 const TracingFileResultCallback& callback) OVERRIDE; 51 const TracingFileResultCallback& callback) OVERRIDE;
51 virtual bool GetTraceBufferPercentFull( 52 virtual bool GetTraceBufferPercentFull(
52 const GetTraceBufferPercentFullCallback& callback) OVERRIDE; 53 const GetTraceBufferPercentFullCallback& callback) OVERRIDE;
53 virtual bool SetWatchEvent(const std::string& category_name, 54 virtual bool SetWatchEvent(const std::string& category_name,
54 const std::string& event_name, 55 const std::string& event_name,
55 const WatchEventCallback& callback) OVERRIDE; 56 const WatchEventCallback& callback) OVERRIDE;
56 virtual bool CancelWatchEvent() OVERRIDE; 57 virtual bool CancelWatchEvent() OVERRIDE;
57 58
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 void OnCaptureMonitoringSnapshotAcked( 125 void OnCaptureMonitoringSnapshotAcked(
125 TraceMessageFilter* trace_message_filter); 126 TraceMessageFilter* trace_message_filter);
126 void OnMonitoringSnapshotFileClosed(); 127 void OnMonitoringSnapshotFileClosed();
127 128
128 void OnTraceBufferPercentFullReply( 129 void OnTraceBufferPercentFullReply(
129 TraceMessageFilter* trace_message_filter, 130 TraceMessageFilter* trace_message_filter,
130 float percent_full); 131 float percent_full);
131 132
132 void OnWatchEventMatched(); 133 void OnWatchEventMatched();
133 134
134 void SetEnabledOnFileThread(const std::string& category_filter, 135 void SetEnabledOnFileThread(
135 int mode, 136 const base::debug::CategoryFilter& category_filter,
136 int options, 137 int mode,
137 const base::Closure& callback); 138 const base::debug::TraceOptions& trace_options,
139 const base::Closure& callback);
138 void SetDisabledOnFileThread(const base::Closure& callback); 140 void SetDisabledOnFileThread(const base::Closure& callback);
139 void OnEnableRecordingDone(const std::string& category_filter, 141 void OnEnableRecordingDone(const base::debug::CategoryFilter& category_filter,
140 int trace_options, 142 const base::debug::TraceOptions& trace_options,
141 const EnableRecordingDoneCallback& callback); 143 const EnableRecordingDoneCallback& callback);
142 void OnDisableRecordingDone(const base::FilePath& result_file_path, 144 void OnDisableRecordingDone(const base::FilePath& result_file_path,
143 const TracingFileResultCallback& callback); 145 const TracingFileResultCallback& callback);
144 void OnEnableMonitoringDone(const std::string& category_filter, 146 void OnEnableMonitoringDone(
145 int trace_options, 147 const base::debug::CategoryFilter& category_filter,
146 const EnableMonitoringDoneCallback& callback); 148 const base::debug::TraceOptions& trace_options,
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_;
170 173
171 GetCategoriesDoneCallback pending_get_categories_done_callback_; 174 GetCategoriesDoneCallback pending_get_categories_done_callback_;
172 TracingFileResultCallback pending_disable_recording_done_callback_; 175 TracingFileResultCallback pending_disable_recording_done_callback_;
173 TracingFileResultCallback pending_capture_monitoring_snapshot_done_callback_; 176 TracingFileResultCallback pending_capture_monitoring_snapshot_done_callback_;
174 GetTraceBufferPercentFullCallback pending_trace_buffer_percent_full_callback_; 177 GetTraceBufferPercentFullCallback pending_trace_buffer_percent_full_callback_;
175 178
176 std::string watch_category_name_; 179 std::string watch_category_name_;
177 std::string watch_event_name_; 180 std::string watch_event_name_;
178 WatchEventCallback watch_event_callback_; 181 WatchEventCallback watch_event_callback_;
179 182
180 std::set<std::string> known_category_groups_; 183 std::set<std::string> known_category_groups_;
181 std::set<TracingUI*> tracing_uis_; 184 std::set<TracingUI*> tracing_uis_;
182 scoped_ptr<ResultFile> result_file_; 185 scoped_ptr<ResultFile> result_file_;
183 scoped_ptr<ResultFile> monitoring_snapshot_file_; 186 scoped_ptr<ResultFile> monitoring_snapshot_file_;
184 DISALLOW_COPY_AND_ASSIGN(TracingControllerImpl); 187 DISALLOW_COPY_AND_ASSIGN(TracingControllerImpl);
185 }; 188 };
186 189
187 } // namespace content 190 } // namespace content
188 191
189 #endif // CONTENT_BROWSER_TRACING_TRACING_CONTROLLER_IMPL_H_ 192 #endif // CONTENT_BROWSER_TRACING_TRACING_CONTROLLER_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698