Chromium Code Reviews| Index: content/browser/resources/media/webrtc_internals.js |
| diff --git a/content/browser/resources/media/webrtc_internals.js b/content/browser/resources/media/webrtc_internals.js |
| index 00cff2011f36acb092cde90fec9e4de34d4d0ec7..d7d24c9b2963622f2537356100a119b88c652265 100644 |
| --- a/content/browser/resources/media/webrtc_internals.js |
| +++ b/content/browser/resources/media/webrtc_internals.js |
| @@ -9,6 +9,8 @@ var statsTable = null; |
| var dumpCreator = null; |
| /** A map from peer connection id to the PeerConnectionRecord. */ |
| var peerConnectionDataStore = {}; |
| +/** A list of getUserMedia requests. */ |
| +var userMediaRequests = []; |
| /** A simple class to store the updates and stats data for a peer connection. */ |
| var PeerConnectionRecord = (function() { |
| @@ -248,10 +250,11 @@ function addStats(data) { |
| * Adds a getUserMedia request. |
| * |
| * @param {!Object} data The object containing rid {number}, pid {number}, |
| - * origin {string}, audio {Object<string>}, video {Object<string>}. |
| + * origin {string}, audio {string}, video {string}. |
| */ |
| function addGetUserMedia(data) { |
| // TODO(jiayl): add the getUserMedia info to the tabbed UI. |
|
vrk (LEFT CHROMIUM)
2014/01/09 00:26:31
nit: remove TODO?
|
| + userMediaRequests.push(data); |
| } |
| @@ -262,6 +265,11 @@ function addGetUserMedia(data) { |
| */ |
| function removeGetUserMediaForRenderer(data) { |
| // TODO(jiayl): remove the getUserMedia info from the tabbed UI. |
|
vrk (LEFT CHROMIUM)
2014/01/09 00:26:31
nit: remove TODO?
|
| + for (var i = userMediaRequests.length - 1; i >= 0; --i) { |
| + if (userMediaRequests[i].rid == data.rid) { |
|
vrk (LEFT CHROMIUM)
2014/01/09 00:26:31
nit: no {}
|
| + userMediaRequests.splice(i, 1); |
| + } |
| + } |
| } |