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..7c4743095a1b88f86ece32dd784797426817cdfe 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,7 +35,7 @@ class WebRtcEventLogHandler |
// Key used to attach the handler to the RenderProcessHost. |
static const char kWebRtcEventLogHandlerKey[]; |
- explicit WebRtcEventLogHandler(Profile* profile); |
+ WebRtcEventLogHandler(int host_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|. |
@@ -50,6 +51,13 @@ class WebRtcEventLogHandler |
const RecordingDoneCallback& callback, |
const RecordingErrorCallback& error_callback); |
+ // Starts an RTC event log for each peerconnection on the specified |host|. |
Henrik Grunell
2016/05/10 08:44:56
It's not clear to me how this function relates to
Ivo-OOO until feb 6
2016/05/12 13:23:23
Yes it does, I will add a comment to clarify that.
Henrik Grunell
2016/05/13 09:05:30
I also don't understand why one can specify either
|
+ // 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(content::RenderProcessHost* host, |
+ 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,18 @@ 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(content::RenderProcessHost* host); |
+ |
+ // Signal that a PeerConnection was added to the RenderProcessHost |
+ // identified by |render_id|. |
+ void OnPeerConnectionAdded(int render_id, int local_id); |
dcheng
2016/05/10 06:48:17
Nit: Call this |process_id| to be consistent with
Ivo-OOO until feb 6
2016/05/12 13:23:23
Good idea, done. I changed the argument to the con
|
+ |
+ // Signal that a PeerConnection was removed from the RenderProcessHost |
+ // identified by |render_id|. |
+ void OnPeerConnectionRemoved(int render_id, int local_id); |
+ |
private: |
friend class base::RefCountedThreadSafe<WebRtcEventLogHandler>; |
virtual ~WebRtcEventLogHandler(); |
@@ -84,6 +104,16 @@ class WebRtcEventLogHandler |
// 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_lid_; |
Henrik Grunell
2016/05/10 08:44:56
Write out what "l" stands for. (local?)
Ivo-OOO until feb 6
2016/05/12 13:23:23
Done.
|
+ |
+ // Number of log files that can be created. |
+ int number_log_files_; |
Henrik Grunell
2016/05/10 08:44:56
So, this is the max number of files allowed? If so
Ivo-OOO until feb 6
2016/05/12 13:23:23
This is the not the maximum, but the number of fil
Henrik Grunell
2016/05/13 09:05:30
I think it's clearer to have this variable count t
|
+ |
// This counter allows saving each log in a separate file. |
uint64_t current_rtc_event_log_id_; |