OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
271 cell.colSpan = 3; | 271 cell.colSpan = 3; |
272 cell.createTextChild(WebInspector.UIString("CAUTION: request is not fini shed yet!")); | 272 cell.createTextChild(WebInspector.UIString("CAUTION: request is not fini shed yet!")); |
273 } | 273 } |
274 | 274 |
275 var footer = tableElement.createChild("tr", "network-timing-footer"); | 275 var footer = tableElement.createChild("tr", "network-timing-footer"); |
276 var note = footer.createChild("td"); | 276 var note = footer.createChild("td"); |
277 note.colSpan = 2; | 277 note.colSpan = 2; |
278 note.appendChild(WebInspector.linkifyDocumentationURLAsNode("profile/network -performance/resource-loading#view-network-timing-details-for-a-specific-resourc e", WebInspector.UIString("Explanation"))); | 278 note.appendChild(WebInspector.linkifyDocumentationURLAsNode("profile/network -performance/resource-loading#view-network-timing-details-for-a-specific-resourc e", WebInspector.UIString("Explanation"))); |
279 footer.createChild("td").createTextChild(Number.secondsToString(totalDuratio n, true)); | 279 footer.createChild("td").createTextChild(Number.secondsToString(totalDuratio n, true)); |
280 | 280 |
281 var serverHeader; | |
282 var serverTimings = request.serverTimings; | |
283 | |
284 if (serverTimings) { | |
pfeldman
2016/03/15 20:18:59
[style] Blink's code style suggests to prefer earl
| |
285 var breakEl = tableElement.createChild("tr", "network-timing-table-heade r").createChild("td"); | |
286 breakEl.colSpan = 3; | |
287 breakEl.createChild("hr", "break"); | |
288 serverHeader = tableElement.createChild("tr", "network-timing-table-head er"); | |
289 serverHeader.createChild("td").createTextChild(WebInspector.UIString("Se rver-Timing")); | |
290 serverHeader.createChild("td").createTextChild(""); | |
291 serverHeader.createChild("td").createTextChild(WebInspector.UIString("TI ME")); | |
292 | |
293 /** | |
294 * @param {!WebInspector.ServerTiming} serverTiming | |
295 */ | |
296 function addTiming(serverTiming) { | |
pfeldman
2016/03/15 20:18:59
[style] { goes next line.
| |
297 var tr = tableElement.createChild("tr", serverTiming.metric == "tota l" ? "network-timing-footer" : ""); | |
298 var metric = tr.createChild("td", "network-timing-metric"); | |
299 metric.colSpan = 2; | |
300 metric.createTextChild(serverTiming.description || serverTiming.metr ic); | |
301 | |
302 var label = tr.createChild("td").createChild("div", "network-timing- bar-title"); | |
303 label.textContent = Number.secondsToString(serverTiming.value, true) ; | |
304 } | |
305 | |
306 serverTimings.filter(item => item.metric.toLowerCase() != "total").forEa ch(addTiming); | |
307 serverTimings.filter(item => item.metric.toLowerCase() == "total").forEa ch(addTiming); | |
308 } | |
309 | |
281 return tableElement; | 310 return tableElement; |
282 } | 311 } |
OLD | NEW |