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

Unified Diff: chrome/browser/media/webrtc_logging_handler_host.h

Issue 1650133002: Start and stop RTC event logs from private extension API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
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);
};

Powered by Google App Engine
This is Rietveld 408576698