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

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

Issue 2440953003: DevTools: use semicolons after each statement. (Closed)
Patch Set: rebaseline Created 4 years, 1 month 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * @constructor 6 * @constructor
7 * @param {string} metric 7 * @param {string} metric
8 * @param {number} value 8 * @param {number} value
9 * @param {string} description 9 * @param {string} description
10 */ 10 */
11 WebInspector.ServerTiming = function(metric, value, description) 11 WebInspector.ServerTiming = function(metric, value, description)
12 { 12 {
13 this.metric = metric; 13 this.metric = metric;
14 this.value = value; 14 this.value = value;
15 this.description = description; 15 this.description = description;
16 } 16 };
17 17
18 /** 18 /**
19 * @param {!Array<!WebInspector.NetworkRequest.NameValue>} headers 19 * @param {!Array<!WebInspector.NetworkRequest.NameValue>} headers
20 * @return {?Array<!WebInspector.ServerTiming>} 20 * @return {?Array<!WebInspector.ServerTiming>}
21 */ 21 */
22 WebInspector.ServerTiming.parseHeaders = function(headers) 22 WebInspector.ServerTiming.parseHeaders = function(headers)
23 { 23 {
24 var rawServerTimingHeaders = headers.filter(item => item.name.toLowerCase() === "server-timing"); 24 var rawServerTimingHeaders = headers.filter(item => item.name.toLowerCase() === "server-timing");
25 if (!rawServerTimingHeaders.length) 25 if (!rawServerTimingHeaders.length)
26 return null; 26 return null;
(...skipping 20 matching lines...) Expand all
47 return result; 47 return result;
48 } 48 }
49 49
50 var serverTimings = rawServerTimingHeaders.reduce((memo, header) => { 50 var serverTimings = rawServerTimingHeaders.reduce((memo, header) => {
51 var timing = createFromHeaderValue(header.value); 51 var timing = createFromHeaderValue(header.value);
52 Array.prototype.push.apply(memo, timing); 52 Array.prototype.push.apply(memo, timing);
53 return memo; 53 return memo;
54 }, []); 54 }, []);
55 serverTimings.sort((a, b) => a.metric.toLowerCase().compareTo(b.metric.toLow erCase())); 55 serverTimings.sort((a, b) => a.metric.toLowerCase().compareTo(b.metric.toLow erCase()));
56 return serverTimings; 56 return serverTimings;
57 } 57 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698