| 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 var USER_MEDIA_TAB_ID = 'user-media-tab-id'; | 5 var USER_MEDIA_TAB_ID = 'user-media-tab-id'; |
| 6 | 6 |
| 7 var tabView = null; | 7 var tabView = null; |
| 8 var ssrcInfoManager = null; | 8 var ssrcInfoManager = null; |
| 9 var peerConnectionUpdateTable = null; | 9 var peerConnectionUpdateTable = null; |
| 10 var statsTable = null; | 10 var statsTable = null; |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 /** Sends a request to the browser to get peer connection statistics. */ | 110 /** Sends a request to the browser to get peer connection statistics. */ |
| 111 function requestStats() { | 111 function requestStats() { |
| 112 if (Object.keys(peerConnectionDataStore).length > 0) | 112 if (Object.keys(peerConnectionDataStore).length > 0) |
| 113 chrome.send('getAllStats'); | 113 chrome.send('getAllStats'); |
| 114 } | 114 } |
| 115 | 115 |
| 116 | 116 |
| 117 /** | 117 /** |
| 118 * A helper function for getting a peer connection element id. | 118 * A helper function for getting a peer connection element id. |
| 119 * | 119 * |
| 120 * @param {!Object.<string, number>} data The object containing the pid and lid | 120 * @param {!Object<string, number>} data The object containing the pid and lid |
| 121 * of the peer connection. | 121 * of the peer connection. |
| 122 * @return {string} The peer connection element id. | 122 * @return {string} The peer connection element id. |
| 123 */ | 123 */ |
| 124 function getPeerConnectionId(data) { | 124 function getPeerConnectionId(data) { |
| 125 return data.pid + '-' + data.lid; | 125 return data.pid + '-' + data.lid; |
| 126 } | 126 } |
| 127 | 127 |
| 128 | 128 |
| 129 /** | 129 /** |
| 130 * Extracts ssrc info from a setLocal/setRemoteDescription update. | 130 * Extracts ssrc info from a setLocal/setRemoteDescription update. |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 peerConnectionDataStore[peerConnectionElement.id].addUpdate(update); | 167 peerConnectionDataStore[peerConnectionElement.id].addUpdate(update); |
| 168 } | 168 } |
| 169 | 169 |
| 170 | 170 |
| 171 /** Browser message handlers. */ | 171 /** Browser message handlers. */ |
| 172 | 172 |
| 173 | 173 |
| 174 /** | 174 /** |
| 175 * Removes all information about a peer connection. | 175 * Removes all information about a peer connection. |
| 176 * | 176 * |
| 177 * @param {!Object.<string, number>} data The object containing the pid and lid | 177 * @param {!Object<string, number>} data The object containing the pid and lid |
| 178 * of a peer connection. | 178 * of a peer connection. |
| 179 */ | 179 */ |
| 180 function removePeerConnection(data) { | 180 function removePeerConnection(data) { |
| 181 var element = $(getPeerConnectionId(data)); | 181 var element = $(getPeerConnectionId(data)); |
| 182 if (element) { | 182 if (element) { |
| 183 delete peerConnectionDataStore[element.id]; | 183 delete peerConnectionDataStore[element.id]; |
| 184 tabView.removeTab(element.id); | 184 tabView.removeTab(element.id); |
| 185 } | 185 } |
| 186 } | 186 } |
| 187 | 187 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 */ | 220 */ |
| 221 function updatePeerConnection(data) { | 221 function updatePeerConnection(data) { |
| 222 var peerConnectionElement = $(getPeerConnectionId(data)); | 222 var peerConnectionElement = $(getPeerConnectionId(data)); |
| 223 addPeerConnectionUpdate(peerConnectionElement, data); | 223 addPeerConnectionUpdate(peerConnectionElement, data); |
| 224 } | 224 } |
| 225 | 225 |
| 226 | 226 |
| 227 /** | 227 /** |
| 228 * Adds the information of all peer connections created so far. | 228 * Adds the information of all peer connections created so far. |
| 229 * | 229 * |
| 230 * @param {Array.<!Object>} data An array of the information of all peer | 230 * @param {Array<!Object>} data An array of the information of all peer |
| 231 * connections. Each array item contains pid, lid, url, rtcConfiguration, | 231 * connections. Each array item contains pid, lid, url, rtcConfiguration, |
| 232 * constraints, and an array of updates as the log. | 232 * constraints, and an array of updates as the log. |
| 233 */ | 233 */ |
| 234 function updateAllPeerConnections(data) { | 234 function updateAllPeerConnections(data) { |
| 235 for (var i = 0; i < data.length; ++i) { | 235 for (var i = 0; i < data.length; ++i) { |
| 236 var peerConnection = addPeerConnection(data[i]); | 236 var peerConnection = addPeerConnection(data[i]); |
| 237 | 237 |
| 238 var log = data[i].log; | 238 var log = data[i].log; |
| 239 if (!log) | 239 if (!log) |
| 240 continue; | 240 continue; |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 328 dumpCreator.disableAecRecording(); | 328 dumpCreator.disableAecRecording(); |
| 329 } | 329 } |
| 330 | 330 |
| 331 | 331 |
| 332 /** | 332 /** |
| 333 * Set | 333 * Set |
| 334 */ | 334 */ |
| 335 function enableAecRecording() { | 335 function enableAecRecording() { |
| 336 dumpCreator.enableAecRecording(); | 336 dumpCreator.enableAecRecording(); |
| 337 } | 337 } |
| OLD | NEW |