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

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

Issue 171263002: Requests stats on webrtc-internals as soon as the initial peer connection records are received. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 10 months 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/webrtc_internals.js
diff --git a/content/browser/resources/media/webrtc_internals.js b/content/browser/resources/media/webrtc_internals.js
index dbc5c072cb93350e655f5a0932ffc21ed78e856a..f69e36705adbe03a62d3c2477196c80d49c3b3a0 100644
--- a/content/browser/resources/media/webrtc_internals.js
+++ b/content/browser/resources/media/webrtc_internals.js
@@ -99,14 +99,18 @@ function initialize() {
chrome.send('finishedDOMLoad');
// Requests stats from all peer connections every second.
- window.setInterval(function() {
- if (Object.keys(peerConnectionDataStore).length > 0)
- chrome.send('getAllStats');
- }, 1000);
+ window.setInterval(requestStats, 1000);
}
document.addEventListener('DOMContentLoaded', initialize);
+/** Sends a request to the browser to get peer connection statistics. */
+function requestStats() {
+ if (Object.keys(peerConnectionDataStore).length > 0)
+ chrome.send('getAllStats');
+}
+
+
/**
* A helper function for getting a peer connection element id.
*
@@ -221,6 +225,7 @@ function updateAllPeerConnections(data) {
addPeerConnectionUpdate(peerConnection, log[j]);
}
}
+ requestStats();
}
« 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