| 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 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 std::string& category_filter, |
| 41 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 std::string* 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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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(const std::string& category_filter, |
| 135 int mode, | 136 int mode, |
| 136 int options, | 137 base::debug::TraceOptions trace_options, |
| 137 const base::Closure& callback); | 138 const base::Closure& callback); |
| 138 void SetDisabledOnFileThread(const base::Closure& callback); | 139 void SetDisabledOnFileThread(const base::Closure& callback); |
| 139 void OnEnableRecordingDone(const std::string& category_filter, | 140 void OnEnableRecordingDone(const std::string& category_filter, |
| 140 int trace_options, | 141 base::debug::TraceOptions trace_options, |
| 141 const EnableRecordingDoneCallback& callback); | 142 const EnableRecordingDoneCallback& callback); |
| 142 void OnDisableRecordingDone(const base::FilePath& result_file_path, | 143 void OnDisableRecordingDone(const base::FilePath& result_file_path, |
| 143 const TracingFileResultCallback& callback); | 144 const TracingFileResultCallback& callback); |
| 144 void OnEnableMonitoringDone(const std::string& category_filter, | 145 void OnEnableMonitoringDone(const std::string& category_filter, |
| 145 int trace_options, | 146 base::debug::TraceOptions trace_options, |
| 146 const EnableMonitoringDoneCallback& callback); | 147 const EnableMonitoringDoneCallback& callback); |
| 147 void OnDisableMonitoringDone(const DisableMonitoringDoneCallback& callback); | 148 void OnDisableMonitoringDone(const DisableMonitoringDoneCallback& callback); |
| 148 | 149 |
| 149 void OnMonitoringStateChanged(bool is_monitoring); | 150 void OnMonitoringStateChanged(bool is_monitoring); |
| 150 | 151 |
| 151 TraceMessageFilterSet trace_message_filters_; | 152 TraceMessageFilterSet trace_message_filters_; |
| 152 | 153 |
| 153 // Pending acks for DisableRecording. | 154 // Pending acks for DisableRecording. |
| 154 int pending_disable_recording_ack_count_; | 155 int pending_disable_recording_ack_count_; |
| 155 TraceMessageFilterSet pending_disable_recording_filters_; | 156 TraceMessageFilterSet pending_disable_recording_filters_; |
| 156 // Pending acks for CaptureMonitoringSnapshot. | 157 // Pending acks for CaptureMonitoringSnapshot. |
| 157 int pending_capture_monitoring_snapshot_ack_count_; | 158 int pending_capture_monitoring_snapshot_ack_count_; |
| 158 TraceMessageFilterSet pending_capture_monitoring_filters_; | 159 TraceMessageFilterSet pending_capture_monitoring_filters_; |
| 159 // Pending acks for GetTraceBufferPercentFull. | 160 // Pending acks for GetTraceBufferPercentFull. |
| 160 int pending_trace_buffer_percent_full_ack_count_; | 161 int pending_trace_buffer_percent_full_ack_count_; |
| 161 TraceMessageFilterSet pending_trace_buffer_percent_full_filters_; | 162 TraceMessageFilterSet pending_trace_buffer_percent_full_filters_; |
| 162 float maximum_trace_buffer_percent_full_; | 163 float maximum_trace_buffer_percent_full_; |
| 163 | 164 |
| 164 #if defined(OS_CHROMEOS) || defined(OS_WIN) | 165 #if defined(OS_CHROMEOS) || defined(OS_WIN) |
| 165 bool is_system_tracing_; | 166 bool is_system_tracing_; |
| 166 #endif | 167 #endif |
| 167 bool is_recording_; | 168 bool is_recording_; |
| 168 bool is_monitoring_; | 169 bool is_monitoring_; |
| 169 TracingController::Options options_; | 170 base::debug::TraceOptions trace_options_; |
| 170 | 171 |
| 171 GetCategoriesDoneCallback pending_get_categories_done_callback_; | 172 GetCategoriesDoneCallback pending_get_categories_done_callback_; |
| 172 TracingFileResultCallback pending_disable_recording_done_callback_; | 173 TracingFileResultCallback pending_disable_recording_done_callback_; |
| 173 TracingFileResultCallback pending_capture_monitoring_snapshot_done_callback_; | 174 TracingFileResultCallback pending_capture_monitoring_snapshot_done_callback_; |
| 174 GetTraceBufferPercentFullCallback pending_trace_buffer_percent_full_callback_; | 175 GetTraceBufferPercentFullCallback pending_trace_buffer_percent_full_callback_; |
| 175 | 176 |
| 176 std::string watch_category_name_; | 177 std::string watch_category_name_; |
| 177 std::string watch_event_name_; | 178 std::string watch_event_name_; |
| 178 WatchEventCallback watch_event_callback_; | 179 WatchEventCallback watch_event_callback_; |
| 179 | 180 |
| 180 std::set<std::string> known_category_groups_; | 181 std::set<std::string> known_category_groups_; |
| 181 std::set<TracingUI*> tracing_uis_; | 182 std::set<TracingUI*> tracing_uis_; |
| 182 scoped_ptr<ResultFile> result_file_; | 183 scoped_ptr<ResultFile> result_file_; |
| 183 scoped_ptr<ResultFile> monitoring_snapshot_file_; | 184 scoped_ptr<ResultFile> monitoring_snapshot_file_; |
| 184 DISALLOW_COPY_AND_ASSIGN(TracingControllerImpl); | 185 DISALLOW_COPY_AND_ASSIGN(TracingControllerImpl); |
| 185 }; | 186 }; |
| 186 | 187 |
| 187 } // namespace content | 188 } // namespace content |
| 188 | 189 |
| 189 #endif // CONTENT_BROWSER_TRACING_TRACING_CONTROLLER_IMPL_H_ | 190 #endif // CONTENT_BROWSER_TRACING_TRACING_CONTROLLER_IMPL_H_ |
| OLD | NEW |