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

Side by Side Diff: content/renderer/media/peer_connection_tracker.h

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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_RENDERER_MEDIA_PEERCONNECTION_TRACKER_H_ 5 #ifndef CONTENT_RENDERER_MEDIA_PEERCONNECTION_TRACKER_H_
6 #define CONTENT_RENDERER_MEDIA_PEERCONNECTION_TRACKER_H_ 6 #define CONTENT_RENDERER_MEDIA_PEERCONNECTION_TRACKER_H_
7 7
8 #include <map> 8 #include <map>
9 9
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 const blink::WebUserMediaRequest& user_media_request); 156 const blink::WebUserMediaRequest& user_media_request);
157 157
158 private: 158 private:
159 // Assign a local ID to a peer connection so that the browser process can 159 // Assign a local ID to a peer connection so that the browser process can
160 // uniquely identify a peer connection in the renderer process. 160 // uniquely identify a peer connection in the renderer process.
161 int GetNextLocalID(); 161 int GetNextLocalID();
162 162
163 // IPC Message handler for getting all stats. 163 // IPC Message handler for getting all stats.
164 void OnGetAllStats(); 164 void OnGetAllStats();
165 165
166 // Called when the browser process reports a suspend event from the OS.
167 void OnSuspend();
168
166 void SendPeerConnectionUpdate(RTCPeerConnectionHandler* pc_handler, 169 void SendPeerConnectionUpdate(RTCPeerConnectionHandler* pc_handler,
167 const std::string& callback_type, 170 const std::string& callback_type,
168 const std::string& value); 171 const std::string& value);
169 172
170 // This map stores the local ID assigned to each RTCPeerConnectionHandler. 173 // This map stores the local ID assigned to each RTCPeerConnectionHandler.
171 typedef std::map<RTCPeerConnectionHandler*, int> PeerConnectionIdMap; 174 typedef std::map<RTCPeerConnectionHandler*, int> PeerConnectionIdMap;
172 PeerConnectionIdMap peer_connection_id_map_; 175 PeerConnectionIdMap peer_connection_id_map_;
173 176
174 // This keeps track of the next available local ID. 177 // This keeps track of the next available local ID.
175 int next_lid_; 178 int next_lid_;
176 179
177 DISALLOW_COPY_AND_ASSIGN(PeerConnectionTracker); 180 DISALLOW_COPY_AND_ASSIGN(PeerConnectionTracker);
178 }; 181 };
179 182
180 } // namespace content 183 } // namespace content
181 184
182 #endif // CONTENT_RENDERER_MEDIA_PEERCONNECTION_TRACKER_H_ 185 #endif // CONTENT_RENDERER_MEDIA_PEERCONNECTION_TRACKER_H_
OLDNEW
« no previous file with comments | « content/common/media/peer_connection_tracker_messages.h ('k') | content/renderer/media/peer_connection_tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698