Index: chrome/browser/media/webrtc_logging_handler_host.h |
diff --git a/chrome/browser/media/webrtc_logging_handler_host.h b/chrome/browser/media/webrtc_logging_handler_host.h |
index 446d93c546fffd209f4422829c3fdf345f896c45..30d09cf0d05d55089eab94821257b206ac033482 100644 |
--- a/chrome/browser/media/webrtc_logging_handler_host.h |
+++ b/chrome/browser/media/webrtc_logging_handler_host.h |
@@ -82,9 +82,9 @@ class WebRtcLoggingHandlerHost : public content::BrowserMessageFilter { |
typedef base::Callback<void(bool, const std::string&, const std::string&)> |
UploadDoneCallback; |
typedef base::Callback<void(const std::string&)> |
- AudioDebugRecordingsErrorCallback; |
+ TimeLimitedRecordingErrorCallback; |
typedef base::Callback<void(const std::string&, bool, bool)> |
- AudioDebugRecordingsCallback; |
+ TimeLimitedRecordingCallback; |
WebRtcLoggingHandlerHost(Profile* profile, WebRtcLogUploader* log_uploader); |
@@ -164,16 +164,38 @@ class WebRtcLoggingHandlerHost : public content::BrowserMessageFilter { |
void StartAudioDebugRecordings( |
content::RenderProcessHost* host, |
base::TimeDelta delay, |
- const AudioDebugRecordingsCallback& callback, |
- const AudioDebugRecordingsErrorCallback& error_callback); |
+ const TimeLimitedRecordingCallback& callback, |
+ const TimeLimitedRecordingErrorCallback& error_callback); |
// Stops an audio debug recording. |callback| is invoked once recording |
// stops. If no recording was in progress, |error_callback| is invoked instead |
// of |callback|. |
void StopAudioDebugRecordings( |
content::RenderProcessHost* host, |
- const AudioDebugRecordingsCallback& callback, |
- const AudioDebugRecordingsErrorCallback& error_callback); |
+ const TimeLimitedRecordingCallback& callback, |
+ const TimeLimitedRecordingErrorCallback& error_callback); |
+ |
+ // Starts an RTC event log. The call writes the most recent events to a |
Henrik Grunell
2016/02/01 13:58:13
This class was originally only for the WebRTC nati
terelius1
2016/02/16 20:09:12
Done.
|
+ // file and then starts logging events for the given |delay|. |
+ // If |delay| is zero, the logging will continue until StopRtcEventLogging() |
+ // is explicitly invoked. |
+ // |callback| is invoked once recording stops. If |delay| is zero |
+ // |callback| is invoked once recording starts. |
+ // If a recording was already in progress, |error_callback| is invoked instead |
+ // of |callback|. |
+ void StartRtcEventLogging( |
+ content::RenderProcessHost* host, |
+ base::TimeDelta delay, |
+ const TimeLimitedRecordingCallback& callback, |
+ const TimeLimitedRecordingErrorCallback& error_callback); |
+ |
+ // Stops an RTC event log. |callback| is invoked once recording |
+ // stops. If no recording was in progress, |error_callback| is invoked instead |
+ // of |callback|. |
+ void StopRtcEventLogging( |
+ content::RenderProcessHost* host, |
+ const TimeLimitedRecordingCallback& callback, |
+ const TimeLimitedRecordingErrorCallback& error_callback); |
private: |
// States used for protecting from function calls made at non-allowed points |
@@ -265,8 +287,8 @@ class WebRtcLoggingHandlerHost : public content::BrowserMessageFilter { |
void DoStartAudioDebugRecordings( |
content::RenderProcessHost* host, |
base::TimeDelta delay, |
- const AudioDebugRecordingsCallback& callback, |
- const AudioDebugRecordingsErrorCallback& error_callback, |
+ const TimeLimitedRecordingCallback& callback, |
+ const TimeLimitedRecordingErrorCallback& error_callback, |
const base::FilePath& log_directory); |
// Helper for stopping audio debug recordings. |
@@ -274,8 +296,25 @@ class WebRtcLoggingHandlerHost : public content::BrowserMessageFilter { |
content::RenderProcessHost* host, |
bool is_manual_stop, |
uint64_t audio_debug_recordings_id, |
- const AudioDebugRecordingsCallback& callback, |
- const AudioDebugRecordingsErrorCallback& error_callback, |
+ const TimeLimitedRecordingCallback& callback, |
+ const TimeLimitedRecordingErrorCallback& error_callback, |
+ const base::FilePath& log_directory); |
+ |
+ // Helper for starting RTC event logs. |
+ void DoStartRtcEventLogging( |
+ content::RenderProcessHost* host, |
+ base::TimeDelta delay, |
+ const TimeLimitedRecordingCallback& callback, |
+ const TimeLimitedRecordingErrorCallback& error_callback, |
+ const base::FilePath& log_directory); |
+ |
+ // Helper for stopping RTC event logs. |
+ void DoStopRtcEventLogging( |
+ content::RenderProcessHost* host, |
+ bool is_manual_stop, |
+ uint64_t audio_debug_recordings_id, |
+ const TimeLimitedRecordingCallback& callback, |
+ const TimeLimitedRecordingErrorCallback& error_callback, |
const base::FilePath& log_directory); |
scoped_ptr<WebRtcLogBuffer> log_buffer_; |
@@ -325,6 +364,12 @@ class WebRtcLoggingHandlerHost : public content::BrowserMessageFilter { |
// This counter allows saving each debug recording in separate files. |
uint64_t current_audio_debug_recordings_id_; |
+ // Must be accessed on the UI thread. |
+ bool is_rtc_event_logging_in_progress_; |
+ |
+ // This counter allows saving each log in a separate file. |
+ uint64_t current_rtc_event_log_id_; |
+ |
DISALLOW_COPY_AND_ASSIGN(WebRtcLoggingHandlerHost); |
}; |