| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2008, 2009 Anthony Ricaud <rik@webkit.org> | 3 * Copyright (C) 2008, 2009 Anthony Ricaud <rik@webkit.org> |
| 4 * Copyright (C) 2011 Google Inc. All rights reserved. | 4 * Copyright (C) 2011 Google Inc. All rights reserved. |
| 5 * | 5 * |
| 6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
| 7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
| 8 * are met: | 8 * are met: |
| 9 * | 9 * |
| 10 * 1. Redistributions of source code must retain the above copyright | 10 * 1. Redistributions of source code must retain the above copyright |
| (...skipping 2390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2401 if (hasLatency && rightLabel) { | 2401 if (hasLatency && rightLabel) { |
| 2402 var total = Number.secondsToString(request.duration); | 2402 var total = Number.secondsToString(request.duration); |
| 2403 var tooltip = WebInspector.NetworkTimeCalculator._latencyDownloadTot
alFormat.format(leftLabel, rightLabel, total); | 2403 var tooltip = WebInspector.NetworkTimeCalculator._latencyDownloadTot
alFormat.format(leftLabel, rightLabel, total); |
| 2404 } else if (hasLatency) | 2404 } else if (hasLatency) |
| 2405 var tooltip = WebInspector.NetworkTimeCalculator._latencyFormat.form
at(leftLabel); | 2405 var tooltip = WebInspector.NetworkTimeCalculator._latencyFormat.form
at(leftLabel); |
| 2406 else if (rightLabel) | 2406 else if (rightLabel) |
| 2407 var tooltip = WebInspector.NetworkTimeCalculator._downloadFormat.for
mat(rightLabel); | 2407 var tooltip = WebInspector.NetworkTimeCalculator._downloadFormat.for
mat(rightLabel); |
| 2408 | 2408 |
| 2409 if (request.fetchedViaServiceWorker) | 2409 if (request.fetchedViaServiceWorker) |
| 2410 tooltip = WebInspector.NetworkTimeCalculator._fromServiceWorkerForma
t.format(tooltip); | 2410 tooltip = WebInspector.NetworkTimeCalculator._fromServiceWorkerForma
t.format(tooltip); |
| 2411 else if (request.cached) | 2411 else if (request.cached()) |
| 2412 tooltip = WebInspector.NetworkTimeCalculator._fromCacheFormat.format
(tooltip); | 2412 tooltip = WebInspector.NetworkTimeCalculator._fromCacheFormat.format
(tooltip); |
| 2413 return {left: leftLabel, right: rightLabel, tooltip: tooltip}; | 2413 return {left: leftLabel, right: rightLabel, tooltip: tooltip}; |
| 2414 }, | 2414 }, |
| 2415 | 2415 |
| 2416 /** | 2416 /** |
| 2417 * @param {!WebInspector.NetworkRequest} request | 2417 * @param {!WebInspector.NetworkRequest} request |
| 2418 * @return {boolean} | 2418 * @return {boolean} |
| 2419 */ | 2419 */ |
| 2420 updateBoundaries: function(request) | 2420 updateBoundaries: function(request) |
| 2421 { | 2421 { |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2695 { | 2695 { |
| 2696 cell = cell.createChild("div"); | 2696 cell = cell.createChild("div"); |
| 2697 this._timelineCell = cell; | 2697 this._timelineCell = cell; |
| 2698 | 2698 |
| 2699 cell.className = "network-graph-side"; | 2699 cell.className = "network-graph-side"; |
| 2700 | 2700 |
| 2701 this._barAreaElement = cell.createChild("div", "network-graph-bar-area")
; | 2701 this._barAreaElement = cell.createChild("div", "network-graph-bar-area")
; |
| 2702 this._barAreaElement.request = this._request; | 2702 this._barAreaElement.request = this._request; |
| 2703 | 2703 |
| 2704 var type = this._request.type.name(); | 2704 var type = this._request.type.name(); |
| 2705 var cached = this._request.cached; | 2705 var cached = this._request.cached(); |
| 2706 | 2706 |
| 2707 this._barLeftElement = this._barAreaElement.createChild("div", "network-
graph-bar"); | 2707 this._barLeftElement = this._barAreaElement.createChild("div", "network-
graph-bar"); |
| 2708 this._barLeftElement.classList.add(type, "waiting"); | 2708 this._barLeftElement.classList.add(type, "waiting"); |
| 2709 this._barLeftElement.classList.toggle("cached", cached); | 2709 this._barLeftElement.classList.toggle("cached", cached); |
| 2710 | 2710 |
| 2711 this._barRightElement = this._barAreaElement.createChild("div", "network
-graph-bar"); | 2711 this._barRightElement = this._barAreaElement.createChild("div", "network
-graph-bar"); |
| 2712 this._barRightElement.classList.add(type); | 2712 this._barRightElement.classList.add(type); |
| 2713 this._barRightElement.classList.toggle("cached", cached); | 2713 this._barRightElement.classList.toggle("cached", cached); |
| 2714 | 2714 |
| 2715 this._labelLeftElement = this._barAreaElement.createChild("div", "networ
k-graph-label"); | 2715 this._labelLeftElement = this._barAreaElement.createChild("div", "networ
k-graph-label"); |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2752 cell.createTextChild(this._request.name()); | 2752 cell.createTextChild(this._request.name()); |
| 2753 this._appendSubtitle(cell, this._request.path()); | 2753 this._appendSubtitle(cell, this._request.path()); |
| 2754 cell.title = this._request.url; | 2754 cell.title = this._request.url; |
| 2755 }, | 2755 }, |
| 2756 | 2756 |
| 2757 /** | 2757 /** |
| 2758 * @param {!Element} cell | 2758 * @param {!Element} cell |
| 2759 */ | 2759 */ |
| 2760 _renderStatusCell: function(cell) | 2760 _renderStatusCell: function(cell) |
| 2761 { | 2761 { |
| 2762 cell.classList.toggle("network-dim-cell", !this._isFailed() && (this._re
quest.cached || !this._request.statusCode)); | 2762 cell.classList.toggle("network-dim-cell", !this._isFailed() && (this._re
quest.cached() || !this._request.statusCode)); |
| 2763 | 2763 |
| 2764 if (this._request.failed && !this._request.canceled) { | 2764 if (this._request.failed && !this._request.canceled) { |
| 2765 var failText = WebInspector.UIString("(failed)"); | 2765 var failText = WebInspector.UIString("(failed)"); |
| 2766 if (this._request.localizedFailDescription) { | 2766 if (this._request.localizedFailDescription) { |
| 2767 cell.createTextChild(failText); | 2767 cell.createTextChild(failText); |
| 2768 this._appendSubtitle(cell, this._request.localizedFailDescriptio
n); | 2768 this._appendSubtitle(cell, this._request.localizedFailDescriptio
n); |
| 2769 cell.title = failText + " " + this._request.localizedFailDescrip
tion; | 2769 cell.title = failText + " " + this._request.localizedFailDescrip
tion; |
| 2770 } else | 2770 } else |
| 2771 cell.setTextAndTitle(failText); | 2771 cell.setTextAndTitle(failText); |
| 2772 } else if (this._request.statusCode) { | 2772 } else if (this._request.statusCode) { |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2827 }, | 2827 }, |
| 2828 | 2828 |
| 2829 /** | 2829 /** |
| 2830 * @param {!Element} cell | 2830 * @param {!Element} cell |
| 2831 */ | 2831 */ |
| 2832 _renderSizeCell: function(cell) | 2832 _renderSizeCell: function(cell) |
| 2833 { | 2833 { |
| 2834 if (this._request.fetchedViaServiceWorker) { | 2834 if (this._request.fetchedViaServiceWorker) { |
| 2835 cell.setTextAndTitle(WebInspector.UIString("(from ServiceWorker)")); | 2835 cell.setTextAndTitle(WebInspector.UIString("(from ServiceWorker)")); |
| 2836 cell.classList.add("network-dim-cell"); | 2836 cell.classList.add("network-dim-cell"); |
| 2837 } else if (this._request.cached) { | 2837 } else if (this._request.cached()) { |
| 2838 cell.setTextAndTitle(WebInspector.UIString("(from cache)")); | 2838 cell.setTextAndTitle(WebInspector.UIString("(from cache)")); |
| 2839 cell.classList.add("network-dim-cell"); | 2839 cell.classList.add("network-dim-cell"); |
| 2840 } else { | 2840 } else { |
| 2841 var resourceSize = Number.bytesToString(this._request.resourceSize); | 2841 var resourceSize = Number.bytesToString(this._request.resourceSize); |
| 2842 var transferSize = Number.bytesToString(this._request.transferSize); | 2842 var transferSize = Number.bytesToString(this._request.transferSize); |
| 2843 cell.setTextAndTitle(transferSize); | 2843 cell.setTextAndTitle(transferSize); |
| 2844 this._appendSubtitle(cell, resourceSize); | 2844 this._appendSubtitle(cell, resourceSize); |
| 2845 } | 2845 } |
| 2846 }, | 2846 }, |
| 2847 | 2847 |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3012 return a._request.indentityCompare(b._request); | 3012 return a._request.indentityCompare(b._request); |
| 3013 } | 3013 } |
| 3014 | 3014 |
| 3015 /** | 3015 /** |
| 3016 * @param {!WebInspector.NetworkDataGridNode} a | 3016 * @param {!WebInspector.NetworkDataGridNode} a |
| 3017 * @param {!WebInspector.NetworkDataGridNode} b | 3017 * @param {!WebInspector.NetworkDataGridNode} b |
| 3018 * @return {number} | 3018 * @return {number} |
| 3019 */ | 3019 */ |
| 3020 WebInspector.NetworkDataGridNode.SizeComparator = function(a, b) | 3020 WebInspector.NetworkDataGridNode.SizeComparator = function(a, b) |
| 3021 { | 3021 { |
| 3022 if (b._request.cached && !a._request.cached) | 3022 if (b._request.cached() && !a._request.cached()) |
| 3023 return 1; | 3023 return 1; |
| 3024 if (a._request.cached && !b._request.cached) | 3024 if (a._request.cached() && !b._request.cached()) |
| 3025 return -1; | 3025 return -1; |
| 3026 return (a._request.transferSize - b._request.transferSize) || a._request.ind
entityCompare(b._request); | 3026 return (a._request.transferSize - b._request.transferSize) || a._request.ind
entityCompare(b._request); |
| 3027 } | 3027 } |
| 3028 | 3028 |
| 3029 /** | 3029 /** |
| 3030 * @param {!WebInspector.NetworkDataGridNode} a | 3030 * @param {!WebInspector.NetworkDataGridNode} a |
| 3031 * @param {!WebInspector.NetworkDataGridNode} b | 3031 * @param {!WebInspector.NetworkDataGridNode} b |
| 3032 * @return {number} | 3032 * @return {number} |
| 3033 */ | 3033 */ |
| 3034 WebInspector.NetworkDataGridNode.InitiatorComparator = function(a, b) | 3034 WebInspector.NetworkDataGridNode.InitiatorComparator = function(a, b) |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3131 | 3131 |
| 3132 WebInspector.NetworkPanelFactory.prototype = { | 3132 WebInspector.NetworkPanelFactory.prototype = { |
| 3133 /** | 3133 /** |
| 3134 * @return {!WebInspector.Panel} | 3134 * @return {!WebInspector.Panel} |
| 3135 */ | 3135 */ |
| 3136 createPanel: function() | 3136 createPanel: function() |
| 3137 { | 3137 { |
| 3138 return WebInspector.NetworkPanel._instance(); | 3138 return WebInspector.NetworkPanel._instance(); |
| 3139 } | 3139 } |
| 3140 } | 3140 } |
| OLD | NEW |