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

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

Issue 482333003: Reland r290125: Close all active PeerConnections upon OS suspend (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove semi Created 6 years, 4 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
« no previous file with comments | « content/renderer/media/peer_connection_tracker.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 5aac78c3fd50bceb41dfbdc590b656b7862295d2..5476f115bcb7b2093fe5801dafb61cc36da4333f 100644
--- a/content/renderer/media/peer_connection_tracker.cc
+++ b/content/renderer/media/peer_connection_tracker.cc
@@ -278,6 +278,7 @@ bool PeerConnectionTracker::OnControlMessageReceived(
bool handled = true;
IPC_BEGIN_MESSAGE_MAP(PeerConnectionTracker, message)
IPC_MESSAGE_HANDLER(PeerConnectionTracker_GetAllStats, OnGetAllStats)
+ IPC_MESSAGE_HANDLER(PeerConnectionTracker_OnSuspend, OnSuspend)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
return handled;
@@ -297,6 +298,13 @@ void PeerConnectionTracker::OnGetAllStats() {
}
}
+void PeerConnectionTracker::OnSuspend() {
+ for (PeerConnectionIdMap::iterator it = peer_connection_id_map_.begin();
+ it != peer_connection_id_map_.end(); ++it) {
+ it->first->stop();
+ }
+}
+
void PeerConnectionTracker::RegisterPeerConnection(
RTCPeerConnectionHandler* pc_handler,
const webrtc::PeerConnectionInterface::RTCConfiguration& config,
« no previous file with comments | « content/renderer/media/peer_connection_tracker.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698