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

Unified Diff: third_party/WebKit/Source/devtools/front_end/sdk/ServerTiming.js

Issue 2689833002: DevTools: Server Timing values should be in milliseconds (Closed)
Patch Set: handle undefined values Created 3 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
Index: third_party/WebKit/Source/devtools/front_end/sdk/ServerTiming.js
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/ServerTiming.js b/third_party/WebKit/Source/devtools/front_end/sdk/ServerTiming.js
index 04a329670442f110e4e3effc28fd0b51d650d61f..f44206edc3dfde1f47e1ac8da3dc7a1bb4d56cdb 100644
--- a/third_party/WebKit/Source/devtools/front_end/sdk/ServerTiming.js
+++ b/third_party/WebKit/Source/devtools/front_end/sdk/ServerTiming.js
@@ -7,8 +7,8 @@
SDK.ServerTiming = class {
/**
* @param {string} metric
- * @param {number} value
- * @param {string} description
+ * @param {?number} value
+ * @param {?string} description
*/
constructor(metric, value, description) {
this.metric = metric;
@@ -39,10 +39,11 @@ SDK.ServerTiming = class {
var metric = metricMatch[1];
var value = metricMatch[2];
var description = metricMatch[3] || metricMatch[4];
- if (value !== null)
+ if (value !== undefined)
value = Math.abs(parseFloat(metricMatch[2]));
valueString = metricMatch[5]; // comma delimited headers
- result.push(new SDK.ServerTiming(metric, value, description));
+ if (typeof value === 'number' || value === undefined)
allada 2017/02/14 00:00:24 This can send in 'undefined' for value when null a
caseq 2017/02/14 00:06:21 This will be always true due to lines 42 & 43. I g
paulirish 2017/02/14 01:25:06 yup sg. done.
+ result.push(new SDK.ServerTiming(metric, value, description));
}
return result;
}

Powered by Google App Engine
This is Rietveld 408576698