| OLD | NEW |
| 1 /** | 1 /** |
| 2 * Copyright 2016 The Chromium Authors. All rights reserved. | 2 * Copyright 2016 The Chromium Authors. All rights reserved. |
| 3 * Use of this source code is governed by a BSD-style license that can be | 3 * Use of this source code is governed by a BSD-style license that can be |
| 4 * found in the LICENSE file. | 4 * found in the LICENSE file. |
| 5 */ | 5 */ |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * Maps "RTCStats.type" values to descriptions of whitelisted (allowed to be | 8 * Maps "RTCStats.type" values to descriptions of whitelisted (allowed to be |
| 9 * exposed to the web) RTCStats-derived dictionaries described below. | 9 * exposed to the web) RTCStats-derived dictionaries described below. |
| 10 * @private | 10 * @private |
| 11 */ | 11 */ |
| 12 var gStatsWhitelist = new Map(); | 12 var gStatsWhitelist = new Map(); |
| 13 | 13 |
| 14 /** | 14 /** |
| 15 * RTCRTPStreamStats | 15 * RTCRTPStreamStats |
| 16 * https://w3c.github.io/webrtc-stats/#streamstats-dict* | 16 * https://w3c.github.io/webrtc-stats/#streamstats-dict* |
| 17 * @private | 17 * @private |
| 18 */ | 18 */ |
| 19 var kRTCRTPStreamStats = new RTCStats_(null, { | 19 var kRTCRTPStreamStats = new RTCStats_(null, { |
| 20 ssrc: 'string', | 20 ssrc: 'string', |
| 21 associateStatsId: 'string', | 21 associateStatsId: 'string', |
| 22 isRemote: 'boolean', | 22 isRemote: 'boolean', |
| 23 mediaType: 'string', | 23 mediaType: 'string', |
| 24 trackId: 'string', |
| 25 // TODO(hbos): As soon as |mediaTrackId| has been renamed to |trackId|, remove |
| 26 // this line. crbug.com/657854 |
| 24 mediaTrackId: 'string', | 27 mediaTrackId: 'string', |
| 25 transportId: 'string', | 28 transportId: 'string', |
| 26 codecId: 'string', | 29 codecId: 'string', |
| 27 firCount: 'number', | 30 firCount: 'number', |
| 28 pliCount: 'number', | 31 pliCount: 'number', |
| 29 nackCount: 'number', | 32 nackCount: 'number', |
| 30 sliCount: 'number', | 33 sliCount: 'number', |
| 31 qpSum: 'number', | 34 qpSum: 'number', |
| 32 }); | 35 }); |
| 33 | 36 |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 gStatsWhitelist.set('outbound-rtp', kRTCOutboundRTPStreamStats); | 89 gStatsWhitelist.set('outbound-rtp', kRTCOutboundRTPStreamStats); |
| 87 | 90 |
| 88 /* | 91 /* |
| 89 * RTCPeerConnectionStats | 92 * RTCPeerConnectionStats |
| 90 * https://w3c.github.io/webrtc-stats/#pcstats-dict* | 93 * https://w3c.github.io/webrtc-stats/#pcstats-dict* |
| 91 * @private | 94 * @private |
| 92 */ | 95 */ |
| 93 var kRTCPeerConnectionStats = new RTCStats_(null, { | 96 var kRTCPeerConnectionStats = new RTCStats_(null, { |
| 94 dataChannelsOpened: 'number', | 97 dataChannelsOpened: 'number', |
| 95 dataChannelsClosed: 'number', | 98 dataChannelsClosed: 'number', |
| 99 dataChannelsRequested: 'number', |
| 100 dataChannelsAccepted: 'number', |
| 96 }); | 101 }); |
| 97 gStatsWhitelist.set('peer-connection', kRTCPeerConnectionStats); | 102 gStatsWhitelist.set('peer-connection', kRTCPeerConnectionStats); |
| 98 | 103 |
| 99 /* | 104 /* |
| 100 * RTCMediaStreamStats | 105 * RTCMediaStreamStats |
| 101 * https://w3c.github.io/webrtc-stats/#msstats-dict* | 106 * https://w3c.github.io/webrtc-stats/#msstats-dict* |
| 102 * @private | 107 * @private |
| 103 */ | 108 */ |
| 104 var kRTCMediaStreamStats = new RTCStats_(null, { | 109 var kRTCMediaStreamStats = new RTCStats_(null, { |
| 105 streamIdentifier: 'string', | 110 streamIdentifier: 'string', |
| 106 trackIds: 'sequence_string', | 111 trackIds: 'sequence_string', |
| 107 }); | 112 }); |
| 108 gStatsWhitelist.set('stream', kRTCMediaStreamStats); | 113 gStatsWhitelist.set('stream', kRTCMediaStreamStats); |
| 109 | 114 |
| 110 /* | 115 /* |
| 111 * RTCMediaStreamTrackStats | 116 * RTCMediaStreamTrackStats |
| 112 * https://w3c.github.io/webrtc-stats/#mststats-dict* | 117 * https://w3c.github.io/webrtc-stats/#mststats-dict* |
| 113 * @private | 118 * @private |
| 114 */ | 119 */ |
| 115 var kRTCMediaStreamTrackStats = new RTCStats_(null, { | 120 var kRTCMediaStreamTrackStats = new RTCStats_(null, { |
| 116 trackIdentifier: 'string', | 121 trackIdentifier: 'string', |
| 117 remoteSource: 'boolean', | 122 remoteSource: 'boolean', |
| 118 ended: 'boolean', | 123 ended: 'boolean', |
| 119 detached: 'boolean', | 124 detached: 'boolean', |
| 125 kind: 'string', |
| 126 // TODO(hbos): As soon as |ssrcIds| has been removed, remove this line. |
| 127 // crbug.com/659137 |
| 120 ssrcIds: 'sequence_string', | 128 ssrcIds: 'sequence_string', |
| 121 frameWidth: 'number', | 129 frameWidth: 'number', |
| 122 frameHeight: 'number', | 130 frameHeight: 'number', |
| 123 framesPerSecond: 'number', | 131 framesPerSecond: 'number', |
| 124 framesSent: 'number', | 132 framesSent: 'number', |
| 125 framesReceived: 'number', | 133 framesReceived: 'number', |
| 126 framesDecoded: 'number', | 134 framesDecoded: 'number', |
| 127 framesDropped: 'number', | 135 framesDropped: 'number', |
| 128 framesCorrupted: 'number', | 136 framesCorrupted: 'number', |
| 129 partialFramesLost: 'number', | 137 partialFramesLost: 'number', |
| (...skipping 23 matching lines...) Expand all Loading... |
| 153 | 161 |
| 154 /* | 162 /* |
| 155 * RTCTransportStats | 163 * RTCTransportStats |
| 156 * https://w3c.github.io/webrtc-stats/#transportstats-dict* | 164 * https://w3c.github.io/webrtc-stats/#transportstats-dict* |
| 157 * @private | 165 * @private |
| 158 */ | 166 */ |
| 159 var kRTCTransportStats = new RTCStats_(null, { | 167 var kRTCTransportStats = new RTCStats_(null, { |
| 160 bytesSent: 'number', | 168 bytesSent: 'number', |
| 161 bytesReceived: 'number', | 169 bytesReceived: 'number', |
| 162 rtcpTransportStatsId: 'string', | 170 rtcpTransportStatsId: 'string', |
| 171 dtlsState: 'string', |
| 172 // TODO(hbos): As soon as |activeConnection| has been replaced by |dtlsState|, |
| 173 // remove this line. crbug.com/653873 |
| 163 activeConnection: 'boolean', | 174 activeConnection: 'boolean', |
| 164 selectedCandidatePairId: 'string', | 175 selectedCandidatePairId: 'string', |
| 165 localCertificateId: 'string', | 176 localCertificateId: 'string', |
| 166 remoteCertificateId: 'string', | 177 remoteCertificateId: 'string', |
| 167 }); | 178 }); |
| 168 gStatsWhitelist.set('transport', kRTCTransportStats); | 179 gStatsWhitelist.set('transport', kRTCTransportStats); |
| 169 | 180 |
| 170 /* | 181 /* |
| 171 * RTCIceCandidateStats | 182 * RTCIceCandidateStats |
| 172 * https://w3c.github.io/webrtc-stats/#icecandidate-dict* | 183 * https://w3c.github.io/webrtc-stats/#icecandidate-dict* |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 357 if (typeof(element) !== elementType) { | 368 if (typeof(element) !== elementType) { |
| 358 throw failTest('stats.' + propertyName + ' should have a different ' + | 369 throw failTest('stats.' + propertyName + ' should have a different ' + |
| 359 'type according to the whitelist (an element of the array has ' + | 370 'type according to the whitelist (an element of the array has ' + |
| 360 'the incorrect type): ' + JSON.stringify(stats[propertyName]) + | 371 'the incorrect type): ' + JSON.stringify(stats[propertyName]) + |
| 361 ' vs ' + whitelistedStats[propertyName]); | 372 ' vs ' + whitelistedStats[propertyName]); |
| 362 } | 373 } |
| 363 } | 374 } |
| 364 } | 375 } |
| 365 } | 376 } |
| 366 } | 377 } |
| OLD | NEW |