| 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 | 5 |
| 6 /** | 6 /** |
| 7 * The data of a peer connection update. | 7 * The data of a peer connection update. |
| 8 * @param {number} pid The id of the renderer. | 8 * @param {number} pid The id of the renderer. |
| 9 * @param {number} lid The id of the peer conneciton inside a renderer. | 9 * @param {number} lid The id of the peer conneciton inside a renderer. |
| 10 * @param {string} type The type of the update. | 10 * @param {string} type The type of the update. |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 iceConnectionStateChange: 'iceconnectionstatechange', | 92 iceConnectionStateChange: 'iceconnectionstatechange', |
| 93 onIceCandidate: 'icecandidate', | 93 onIceCandidate: 'icecandidate', |
| 94 stop: 'close' | 94 stop: 'close' |
| 95 }[update.type] || update.type; | 95 }[update.type] || update.type; |
| 96 | 96 |
| 97 if (update.value.length == 0) { | 97 if (update.value.length == 0) { |
| 98 row.innerHTML += '<td>' + type + '</td>'; | 98 row.innerHTML += '<td>' + type + '</td>'; |
| 99 return; | 99 return; |
| 100 } | 100 } |
| 101 | 101 |
| 102 if (update.type === 'onIceCandidate' || |
| 103 update.type === 'addIceCandidate') { |
| 104 // extract ICE candidate type from the field following typ. |
| 105 var candidateType = update.value.match( |
| 106 /(?: typ )(host|srflx|relay)/)[1]; |
| 107 if (candidateType) { |
| 108 type += ' (' + candidateType + ')'; |
| 109 } |
| 110 } |
| 102 row.innerHTML += '<td><details><summary>' + type + | 111 row.innerHTML += '<td><details><summary>' + type + |
| 103 '</summary></details></td>'; | 112 '</summary></details></td>'; |
| 104 | 113 |
| 105 var valueContainer = document.createElement('pre'); | 114 var valueContainer = document.createElement('pre'); |
| 106 var details = row.cells[1].childNodes[0]; | 115 var details = row.cells[1].childNodes[0]; |
| 107 details.appendChild(valueContainer); | 116 details.appendChild(valueContainer); |
| 108 | 117 |
| 109 var value = update.value; | 118 var value = update.value; |
| 110 // map internal names and values to names and events from the | 119 // map internal names and values to names and events from the |
| 111 // specification. This is a display change which shall not | 120 // specification. This is a display change which shall not |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 tableContainer.appendChild(tableElement); | 171 tableContainer.appendChild(tableElement); |
| 163 tableElement.innerHTML = '<tr><th>Time</th>' + | 172 tableElement.innerHTML = '<tr><th>Time</th>' + |
| 164 '<th class="update-log-header-event">Event</th></tr>'; | 173 '<th class="update-log-header-event">Event</th></tr>'; |
| 165 } | 174 } |
| 166 return tableElement; | 175 return tableElement; |
| 167 } | 176 } |
| 168 }; | 177 }; |
| 169 | 178 |
| 170 return PeerConnectionUpdateTable; | 179 return PeerConnectionUpdateTable; |
| 171 })(); | 180 })(); |
| OLD | NEW |