Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(878)

Unified Diff: content/browser/resources/media/peer_connection_update_table.js

Issue 2602603002: webrtc-internals: use spec event values (Closed)
Patch Set: webrtc-internals: use spec event names Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/resources/media/peer_connection_update_table.js
diff --git a/content/browser/resources/media/peer_connection_update_table.js b/content/browser/resources/media/peer_connection_update_table.js
index f5e58b5be0c5c0b7b2128f34af3b53b511983bd3..f3475a8174a938143caca6d76b5a3041533aad20 100644
--- a/content/browser/resources/media/peer_connection_update_table.js
+++ b/content/browser/resources/media/peer_connection_update_table.js
@@ -84,18 +84,60 @@ var PeerConnectionUpdateTable = (function() {
var time = new Date(parseFloat(update.time));
row.innerHTML = '<td>' + time.toLocaleString() + '</td>';
+ // map internal event names to spec event names.
+ var type = {
+ onRenegotiationNeeded: 'negotiationneeded',
+ signalingStateChange: 'signalingstatechange',
+ iceGatheringStateChange: 'icegatheringstatechange',
+ iceConnectionStateChange: 'iceconnectionstatechange',
+ onIceCandidate: 'icecandidate',
+ stop: 'close'
+ }[update.type] || update.type;
+
if (update.value.length == 0) {
- row.innerHTML += '<td>' + update.type + '</td>';
+ row.innerHTML += '<td>' + type + '</td>';
return;
}
- row.innerHTML += '<td><details><summary>' + update.type +
+ row.innerHTML += '<td><details><summary>' + type +
'</summary></details></td>';
var valueContainer = document.createElement('pre');
var details = row.cells[1].childNodes[0];
details.appendChild(valueContainer);
- valueContainer.textContent = update.value;
+
+ var value = update.value;
+ // map internal names and values to names and events from the
+ // specification. This is a display change which shall not
+ // change the JSON dump.
+ if (update.type === 'iceConnectionStateChange') {
+ value = {
+ ICEConnectionStateNew: 'new',
+ ICEConnectionStateChecking: 'checking',
+ ICEConnectionStateConnected: 'connected',
+ ICEConnectionStateCompleted: 'completed',
+ ICEConnectionStateFailed: 'failed',
+ ICEConnectionStateDisconnected: 'disconnected',
+ ICEConnectionStateClosed: 'closed',
+ }[value] || value;
+ } else if (update.type === 'iceGatheringStateChange') {
+ value = {
+ ICEGatheringStateNew: 'new',
+ ICEGatheringStateGathering: 'gathering',
+ ICEGatheringStateComplete: 'complete',
+ }[value] || value;
+ } else if (update.type === 'signalingStateChange') {
+ value = {
+ SignalingStateStable: 'stable',
+ SignalingStateHaveLocalOffer: 'have-local-offer',
+ SignalingStateHaveRemoteOffer: 'have-remote-offer',
+ SignalingStateHaveLocalPrAnswer: 'have-local-pranswer',
+ SignalingStateHaveRemotePrAnswer: 'have-remote-pranswer',
+ SignalingStateClosed: 'closed',
+ }[value] || value;
+ }
+
+ valueContainer.textContent = value;
},
/**
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698