| 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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 return; | 99 return; |
| 100 } | 100 } |
| 101 | 101 |
| 102 row.innerHTML += '<td><details><summary>' + type + | 102 row.innerHTML += '<td><details><summary>' + type + |
| 103 '</summary></details></td>'; | 103 '</summary></details></td>'; |
| 104 | 104 |
| 105 var valueContainer = document.createElement('pre'); | 105 var valueContainer = document.createElement('pre'); |
| 106 var details = row.cells[1].childNodes[0]; | 106 var details = row.cells[1].childNodes[0]; |
| 107 details.appendChild(valueContainer); | 107 details.appendChild(valueContainer); |
| 108 | 108 |
| 109 // Highlight ICE failures and failure callbacks. |
| 110 if ((update.type === 'iceConnectionStateChange' && |
| 111 update.value === 'ICEConnectionStateFailed') || |
| 112 update.type.indexOf('OnFailure') !== -1 || |
| 113 update.type === 'addIceCandidateFailed') { |
| 114 valueContainer.parentElement.classList.add('update-log-failure'); |
| 115 } |
| 116 |
| 109 var value = update.value; | 117 var value = update.value; |
| 110 // map internal names and values to names and events from the | 118 // map internal names and values to names and events from the |
| 111 // specification. This is a display change which shall not | 119 // specification. This is a display change which shall not |
| 112 // change the JSON dump. | 120 // change the JSON dump. |
| 113 if (update.type === 'iceConnectionStateChange') { | 121 if (update.type === 'iceConnectionStateChange') { |
| 114 value = { | 122 value = { |
| 115 ICEConnectionStateNew: 'new', | 123 ICEConnectionStateNew: 'new', |
| 116 ICEConnectionStateChecking: 'checking', | 124 ICEConnectionStateChecking: 'checking', |
| 117 ICEConnectionStateConnected: 'connected', | 125 ICEConnectionStateConnected: 'connected', |
| 118 ICEConnectionStateCompleted: 'completed', | 126 ICEConnectionStateCompleted: 'completed', |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 tableContainer.appendChild(tableElement); | 170 tableContainer.appendChild(tableElement); |
| 163 tableElement.innerHTML = '<tr><th>Time</th>' + | 171 tableElement.innerHTML = '<tr><th>Time</th>' + |
| 164 '<th class="update-log-header-event">Event</th></tr>'; | 172 '<th class="update-log-header-event">Event</th></tr>'; |
| 165 } | 173 } |
| 166 return tableElement; | 174 return tableElement; |
| 167 } | 175 } |
| 168 }; | 176 }; |
| 169 | 177 |
| 170 return PeerConnectionUpdateTable; | 178 return PeerConnectionUpdateTable; |
| 171 })(); | 179 })(); |
| OLD | NEW |