Chromium Code Reviews| 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; |
| } |