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

Unified Diff: remoting/webapp/base/js/connection_stats.js

Issue 2004673002: Initialize remoting.ClientSession.PerfStats with zeros (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Reviewer's Feedback & Mark Fields Non-nullable Created 4 years, 7 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
Index: remoting/webapp/base/js/connection_stats.js
diff --git a/remoting/webapp/base/js/connection_stats.js b/remoting/webapp/base/js/connection_stats.js
index 9d163663d380abf25cc7614c82c3fc498417d96e..5f3d268557861732f31aac655f5ab7bc8622dfb6 100644
--- a/remoting/webapp/base/js/connection_stats.js
+++ b/remoting/webapp/base/js/connection_stats.js
@@ -121,28 +121,23 @@ remoting.ConnectionStats.prototype.update = function(stats) {
}
/**
- * @param {number} value
+ * @param {!number} value
* @param {string} units
* @param {number} digits
* @return {string} Formatted number.
*/
function formatStatNumber(value, units, digits) {
- if (value != undefined) {
- return value.toFixed(digits) + ' ' + units;
- } else {
- return "n/a";
- }
+ return value.toFixed(digits) + ' ' + units;
}
/**
* @param {string} type
- * @param {number} avg
- * @param {number} max
+ * @param {!number} avg
+ * @param {!number} max
* @return {string} "type: avg, max; " e.g. "RTT: 8.0, 13; "
*/
function formatStat(type, avg, max) {
- var avgStr = (avg == undefined) ? 'n/a' : avg.toFixed(1);
- return type + ': ' + avgStr + ', ' + max + '; ';
+ return type + ': ' + avg.toFixed(1) + ', ' + max + '; ';
}
var statistics = document.getElementById('statistics');

Powered by Google App Engine
This is Rietveld 408576698