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

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

Issue 577483002: Close all active PeerConnections upon OS suspend (relanding r290125 and r291213) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix crashing Created 6 years, 3 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 c4f10e5e88434578a57b989c5ddc17d8e48b7f73..8e368b4e564cf9283cb6792af8fb30b6f5a75d03 100644
--- a/content/renderer/media/peer_connection_tracker.cc
+++ b/content/renderer/media/peer_connection_tracker.cc
@@ -279,6 +279,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;
@@ -298,6 +299,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->CloseClientPeerConnection();
+ }
+}
+
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