| OLD | NEW |
| 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 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 const blink::WebUserMediaRequest& user_media_request); | 154 const blink::WebUserMediaRequest& user_media_request); |
| 155 | 155 |
| 156 private: | 156 private: |
| 157 // Assign a local ID to a peer connection so that the browser process can | 157 // Assign a local ID to a peer connection so that the browser process can |
| 158 // uniquely identify a peer connection in the renderer process. | 158 // uniquely identify a peer connection in the renderer process. |
| 159 int GetNextLocalID(); | 159 int GetNextLocalID(); |
| 160 | 160 |
| 161 // IPC Message handler for getting all stats. | 161 // IPC Message handler for getting all stats. |
| 162 void OnGetAllStats(); | 162 void OnGetAllStats(); |
| 163 | 163 |
| 164 // Called when the browser process reports a suspend event from the OS. | |
| 165 void OnSuspend(); | |
| 166 | |
| 167 void SendPeerConnectionUpdate(RTCPeerConnectionHandler* pc_handler, | 164 void SendPeerConnectionUpdate(RTCPeerConnectionHandler* pc_handler, |
| 168 const std::string& callback_type, | 165 const std::string& callback_type, |
| 169 const std::string& value); | 166 const std::string& value); |
| 170 | 167 |
| 171 // This map stores the local ID assigned to each RTCPeerConnectionHandler. | 168 // This map stores the local ID assigned to each RTCPeerConnectionHandler. |
| 172 typedef std::map<RTCPeerConnectionHandler*, int> PeerConnectionIdMap; | 169 typedef std::map<RTCPeerConnectionHandler*, int> PeerConnectionIdMap; |
| 173 PeerConnectionIdMap peer_connection_id_map_; | 170 PeerConnectionIdMap peer_connection_id_map_; |
| 174 | 171 |
| 175 // This keeps track of the next available local ID. | 172 // This keeps track of the next available local ID. |
| 176 int next_lid_; | 173 int next_lid_; |
| 177 | 174 |
| 178 DISALLOW_COPY_AND_ASSIGN(PeerConnectionTracker); | 175 DISALLOW_COPY_AND_ASSIGN(PeerConnectionTracker); |
| 179 }; | 176 }; |
| 180 | 177 |
| 181 } // namespace content | 178 } // namespace content |
| 182 | 179 |
| 183 #endif // CONTENT_RENDERER_MEDIA_PEERCONNECTION_TRACKER_H_ | 180 #endif // CONTENT_RENDERER_MEDIA_PEERCONNECTION_TRACKER_H_ |
| OLD | NEW |