| Index: chrome/browser/media/webrtc_event_log_handler.h
|
| diff --git a/chrome/browser/media/webrtc_event_log_handler.h b/chrome/browser/media/webrtc_event_log_handler.h
|
| index 33eaa5cf1a1263304f4e88d9936932e22732be65..10cf2640dbb36a9811cf28b4bf46283f7365ad49 100644
|
| --- a/chrome/browser/media/webrtc_event_log_handler.h
|
| +++ b/chrome/browser/media/webrtc_event_log_handler.h
|
| @@ -8,6 +8,7 @@
|
| #include <stddef.h>
|
| #include <stdint.h>
|
|
|
| +#include <set>
|
| #include <string>
|
|
|
| #include "base/callback.h"
|
| @@ -34,10 +35,11 @@ class WebRtcEventLogHandler
|
| // Key used to attach the handler to the RenderProcessHost.
|
| static const char kWebRtcEventLogHandlerKey[];
|
|
|
| - explicit WebRtcEventLogHandler(Profile* profile);
|
| + WebRtcEventLogHandler(int process_id, Profile* profile);
|
|
|
| - // Starts an RTC event log. The call writes the most recent events to a
|
| - // file and then starts logging events for the given |delay|.
|
| + // Starts an RTC event log for each peerconnection on the specified |host|.
|
| + // The call writes the most recent events to a file and then starts logging
|
| + // events for the given |delay|.
|
| // If |delay| is zero, the logging will continue until
|
| // StopWebRtcEventLogging()
|
| // is explicitly invoked.
|
| @@ -50,6 +52,12 @@ class WebRtcEventLogHandler
|
| const RecordingDoneCallback& callback,
|
| const RecordingErrorCallback& error_callback);
|
|
|
| + // Starts an RTC event log for each peerconnection on the specified |host|.
|
| + // A base file_path can be supplied, which will be extended to include several
|
| + // identifiers to ensure uniqueness. If a recording was already in progress,
|
| + // this call will be ignored.
|
| + void StartWebRtcEventLogging(const base::FilePath& file_path);
|
| +
|
| // Stops an RTC event log. |callback| is invoked once recording
|
| // stops. If no recording was in progress, |error_callback| is invoked instead
|
| // of |callback|.
|
| @@ -57,6 +65,16 @@ class WebRtcEventLogHandler
|
| const RecordingDoneCallback& callback,
|
| const RecordingErrorCallback& error_callback);
|
|
|
| + // Stops an RTC event log for each peerconnection on the specified |host|.
|
| + // If no recording was in progress, this call has no effect.
|
| + void StopWebRtcEventLogging();
|
| +
|
| + // Signal that a PeerConnection was added to the RenderProcessHost.
|
| + void OnPeerConnectionAdded(int connection_id);
|
| +
|
| + // Signal that a PeerConnection was removed from the RenderProcessHost.
|
| + void OnPeerConnectionRemoved(int connection_id);
|
| +
|
| private:
|
| friend class base::RefCountedThreadSafe<WebRtcEventLogHandler>;
|
| virtual ~WebRtcEventLogHandler();
|
| @@ -78,12 +96,25 @@ class WebRtcEventLogHandler
|
| const RecordingErrorCallback& error_callback,
|
| const base::FilePath& log_directory);
|
|
|
| + // The process id of our rendere process.
|
| + const int render_process_id;
|
| +
|
| // The profile associated with our renderer process.
|
| Profile* const profile_;
|
|
|
| // Must be accessed on the UI thread.
|
| bool is_rtc_event_logging_in_progress_;
|
|
|
| + // In case new PeerConnections are created during logging, the path is needed
|
| + // to enable logging for them.
|
| + base::FilePath base_file_path_;
|
| +
|
| + // The local identifiers of all the currently active PeerConnections.
|
| + std::set<int> active_peer_connection_local_id_;
|
| +
|
| + // Number of active log files that have been opened.
|
| + int number_active_log_files_;
|
| +
|
| // This counter allows saving each log in a separate file.
|
| uint64_t current_rtc_event_log_id_;
|
|
|
|
|