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 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
258 tr.createChild("td").createTextChild(WebInspector.RequestTimingView._tim eRangeTitle(rangeName)); | 258 tr.createChild("td").createTextChild(WebInspector.RequestTimingView._tim eRangeTitle(rangeName)); |
259 | 259 |
260 var row = tr.createChild("td").createChild("div", "network-timing-row"); | 260 var row = tr.createChild("td").createChild("div", "network-timing-row"); |
261 var bar = row.createChild("span", "network-timing-bar " + rangeName); | 261 var bar = row.createChild("span", "network-timing-bar " + rangeName); |
262 bar.style.left = left + "%"; | 262 bar.style.left = left + "%"; |
263 bar.style.right = right + "%"; | 263 bar.style.right = right + "%"; |
264 bar.textContent = "\u200B"; // Important for 0-time items to have 0 widt h. | 264 bar.textContent = "\u200B"; // Important for 0-time items to have 0 widt h. |
265 var label = tr.createChild("td").createChild("div", "network-timing-bar- title"); | 265 var label = tr.createChild("td").createChild("div", "network-timing-bar- title"); |
266 label.textContent = Number.secondsToString(duration, true); | 266 label.textContent = Number.secondsToString(duration, true); |
267 } | 267 } |
268 | 268 |
269 if (!request.finished) { | 269 if (!request.finished) { |
270 var cell = tableElement.createChild("tr").createChild("td", "caution"); | 270 var cell = tableElement.createChild("tr").createChild("td", "caution"); |
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) { | |
285 tableElement.createChild("tr").createChild("td").createTextChild("\u00a0 "); | |
286 serverHeader = tableElement.createChild("tr", "network-timing-table-head er"); | |
287 serverHeader.createChild("td").createTextChild("Server-Timing"); | |
pfeldman
2016/03/14 22:54:34
User-visible strings should be wrapped with WebIns
sroussey
2016/04/22 00:55:07
OK! You might look at other things in this file --
| |
288 serverHeader.createChild("td").createTextChild(""); | |
289 serverHeader.createChild("td").createTextChild("TIME"); | |
pfeldman
2016/03/14 22:54:34
ditto
| |
290 | |
291 var addTiming = (serverTiming) => { | |
pfeldman
2016/03/14 22:54:34
Please declare as a named function.
/**
* @param
| |
292 var tr = tableElement.createChild("tr", serverTiming.metric == "tota l" ? "network-timing-footer" : ""); | |
293 var metric = tr.createChild("td"); | |
294 metric.colSpan = 2; | |
295 metric.createTextChild(WebInspector.RequestTimingView._timeRangeTitl e(serverTiming.description || serverTiming.metric)); | |
296 | |
297 var label = tr.createChild("td").createChild("div", "network-timing- bar-title"); | |
298 label.textContent = Number.secondsToString(serverTiming.value, true) ; | |
299 }; | |
300 serverTimings.filter(item => item.metric.toLowerCase() != "total").forEa ch(addTiming); | |
301 serverTimings.filter(item => item.metric.toLowerCase() == "total").forEa ch(addTiming); | |
302 } | |
303 | |
281 return tableElement; | 304 return tableElement; |
282 } | 305 } |
OLD | NEW |