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

Unified Diff: content/renderer/media/peer_connection_tracker.cc

Issue 1855193002: Move the call to enable the WebRTC event log from PeerConnectionFactory to PeerConnection. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added CONTENT_EXPORT to WebRTCEventLogHost. Created 4 years, 5 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: content/renderer/media/peer_connection_tracker.cc
diff --git a/content/renderer/media/peer_connection_tracker.cc b/content/renderer/media/peer_connection_tracker.cc
index efeb029e6651d5ea75845bb6a462d94e9c746565..c76674bde73cbdab54e5e00e6e53aa7016e5ab21 100644
--- a/content/renderer/media/peer_connection_tracker.cc
+++ b/content/renderer/media/peer_connection_tracker.cc
@@ -343,6 +343,8 @@ bool PeerConnectionTracker::OnControlMessageReceived(
IPC_BEGIN_MESSAGE_MAP(PeerConnectionTracker, message)
IPC_MESSAGE_HANDLER(PeerConnectionTracker_GetAllStats, OnGetAllStats)
IPC_MESSAGE_HANDLER(PeerConnectionTracker_OnSuspend, OnSuspend)
+ IPC_MESSAGE_HANDLER(PeerConnectionTracker_StartEventLog, OnStartEventLog)
+ IPC_MESSAGE_HANDLER(PeerConnectionTracker_StopEventLog, OnStopEventLog)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
return handled;
@@ -380,6 +382,36 @@ void PeerConnectionTracker::OnSuspend() {
}
}
+void PeerConnectionTracker::OnStartEventLog(int peer_connection_id,
+ IPC::PlatformFileForTransit file) {
+ DCHECK(main_thread_.CalledOnValidThread());
+ for (auto& it : peer_connection_id_map_) {
+ if (it.second == peer_connection_id) {
+#if defined(OS_ANDROID)
+ // A lower maximum filesize is used on Android because storage space is
+ // more scarce on mobile. This upper limit applies to each peerconnection
+ // individually, so the total amount of used storage can be a multiple of
+ // this.
+ const int64_t kMaxFilesizeBytes = 10000000;
+#else
+ const int64_t kMaxFilesizeBytes = 60000000;
+#endif
+ it.first->StartEventLog(file, kMaxFilesizeBytes);
+ return;
+ }
+ }
+}
+
+void PeerConnectionTracker::OnStopEventLog(int peer_connection_id) {
+ DCHECK(main_thread_.CalledOnValidThread());
+ for (auto& it : peer_connection_id_map_) {
+ if (it.second == peer_connection_id) {
+ it.first->StopEventLog();
+ return;
+ }
+ }
+}
+
void PeerConnectionTracker::RegisterPeerConnection(
RTCPeerConnectionHandler* pc_handler,
const webrtc::PeerConnectionInterface::RTCConfiguration& config,
« no previous file with comments | « content/renderer/media/peer_connection_tracker.h ('k') | content/renderer/media/rtc_peer_connection_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698