| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 CHROME_BROWSER_MEDIA_WEBRTC_LOGGING_HANDLER_HOST_H_ | 5 #ifndef CHROME_BROWSER_MEDIA_WEBRTC_LOGGING_HANDLER_HOST_H_ |
| 6 #define CHROME_BROWSER_MEDIA_WEBRTC_LOGGING_HANDLER_HOST_H_ | 6 #define CHROME_BROWSER_MEDIA_WEBRTC_LOGGING_HANDLER_HOST_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 class WebRtcLoggingHandlerHost : public content::BrowserMessageFilter { | 79 class WebRtcLoggingHandlerHost : public content::BrowserMessageFilter { |
| 80 public: | 80 public: |
| 81 typedef base::Callback<void(bool, const std::string&)> GenericDoneCallback; | 81 typedef base::Callback<void(bool, const std::string&)> GenericDoneCallback; |
| 82 typedef base::Callback<void(bool, const std::string&, const std::string&)> | 82 typedef base::Callback<void(bool, const std::string&, const std::string&)> |
| 83 UploadDoneCallback; | 83 UploadDoneCallback; |
| 84 typedef base::Callback<void(const std::string&)> | 84 typedef base::Callback<void(const std::string&)> |
| 85 AudioDebugRecordingsErrorCallback; | 85 AudioDebugRecordingsErrorCallback; |
| 86 typedef base::Callback<void(const std::string&, bool, bool)> | 86 typedef base::Callback<void(const std::string&, bool, bool)> |
| 87 AudioDebugRecordingsCallback; | 87 AudioDebugRecordingsCallback; |
| 88 | 88 |
| 89 WebRtcLoggingHandlerHost(Profile* profile, WebRtcLogUploader* log_uploader); | 89 WebRtcLoggingHandlerHost(int render_process_id, |
| 90 Profile* profile, |
| 91 WebRtcLogUploader* log_uploader); |
| 90 | 92 |
| 91 // Sets meta data that will be uploaded along with the log and also written | 93 // Sets meta data that will be uploaded along with the log and also written |
| 92 // in the beginning of the log. Must be called on the IO thread before calling | 94 // in the beginning of the log. Must be called on the IO thread before calling |
| 93 // StartLogging. | 95 // StartLogging. |
| 94 void SetMetaData(scoped_ptr<MetaDataMap> meta_data, | 96 void SetMetaData(scoped_ptr<MetaDataMap> meta_data, |
| 95 const GenericDoneCallback& callback); | 97 const GenericDoneCallback& callback); |
| 96 | 98 |
| 97 // Opens a log and starts logging. Must be called on the IO thread. | 99 // Opens a log and starts logging. Must be called on the IO thread. |
| 98 void StartLogging(const GenericDoneCallback& callback); | 100 void StartLogging(const GenericDoneCallback& callback); |
| 99 | 101 |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 bool OnMessageReceived(const IPC::Message& message) override; | 207 bool OnMessageReceived(const IPC::Message& message) override; |
| 206 | 208 |
| 207 // Handles log message requests from renderer process. | 209 // Handles log message requests from renderer process. |
| 208 void OnAddLogMessages(const std::vector<WebRtcLoggingMessageData>& messages); | 210 void OnAddLogMessages(const std::vector<WebRtcLoggingMessageData>& messages); |
| 209 void OnLoggingStoppedInRenderer(); | 211 void OnLoggingStoppedInRenderer(); |
| 210 | 212 |
| 211 void LogInitialInfoOnFileThread(const GenericDoneCallback& callback); | 213 void LogInitialInfoOnFileThread(const GenericDoneCallback& callback); |
| 212 void LogInitialInfoOnIOThread(const net::NetworkInterfaceList& network_list, | 214 void LogInitialInfoOnIOThread(const net::NetworkInterfaceList& network_list, |
| 213 const GenericDoneCallback& callback); | 215 const GenericDoneCallback& callback); |
| 214 | 216 |
| 217 void EnableBrowserProcessLoggingOnUIThread(); |
| 218 void DisableBrowserProcessLoggingOnUIThread(); |
| 219 |
| 215 // Called after stopping RTP dumps. | 220 // Called after stopping RTP dumps. |
| 216 void StoreLogContinue(const std::string& log_id, | 221 void StoreLogContinue(const std::string& log_id, |
| 217 const GenericDoneCallback& callback); | 222 const GenericDoneCallback& callback); |
| 218 | 223 |
| 219 // Writes a formatted log |message| to the |circular_buffer_|. | 224 // Writes a formatted log |message| to the |circular_buffer_|. |
| 220 void LogToCircularBuffer(const std::string& message); | 225 void LogToCircularBuffer(const std::string& message); |
| 221 | 226 |
| 222 // Gets the log directory path for |profile_| and ensure it exists. Must be | 227 // Gets the log directory path for |profile_| and ensure it exists. Must be |
| 223 // called on the FILE thread. | 228 // called on the FILE thread. |
| 224 base::FilePath GetLogDirectoryAndEnsureExists(); | 229 base::FilePath GetLogDirectoryAndEnsureExists(); |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 318 // A pointer to the log uploader that's shared for all profiles. | 323 // A pointer to the log uploader that's shared for all profiles. |
| 319 // Ownership lies with the browser process. | 324 // Ownership lies with the browser process. |
| 320 WebRtcLogUploader* const log_uploader_; | 325 WebRtcLogUploader* const log_uploader_; |
| 321 | 326 |
| 322 // Must be accessed on the UI thread. | 327 // Must be accessed on the UI thread. |
| 323 bool is_audio_debug_recordings_in_progress_; | 328 bool is_audio_debug_recordings_in_progress_; |
| 324 | 329 |
| 325 // This counter allows saving each debug recording in separate files. | 330 // This counter allows saving each debug recording in separate files. |
| 326 uint64_t current_audio_debug_recordings_id_; | 331 uint64_t current_audio_debug_recordings_id_; |
| 327 | 332 |
| 333 // The render process ID this object belongs to. |
| 334 int render_process_id_; |
| 335 |
| 328 DISALLOW_COPY_AND_ASSIGN(WebRtcLoggingHandlerHost); | 336 DISALLOW_COPY_AND_ASSIGN(WebRtcLoggingHandlerHost); |
| 329 }; | 337 }; |
| 330 | 338 |
| 331 #endif // CHROME_BROWSER_MEDIA_WEBRTC_LOGGING_HANDLER_HOST_H_ | 339 #endif // CHROME_BROWSER_MEDIA_WEBRTC_LOGGING_HANDLER_HOST_H_ |
| OLD | NEW |