Modified: trunk/Source/WebCore/inspector/front-end/NetworkPanel.js (141416 => 141417)
--- trunk/Source/WebCore/inspector/front-end/NetworkPanel.js 2013-01-31 14:30:49 UTC (rev 141416)
+++ trunk/Source/WebCore/inspector/front-end/NetworkPanel.js 2013-01-31 14:52:58 UTC (rev 141417)
@@ -95,7 +95,7 @@
WebInspector.networkLog.requests.forEach(this._appendRequest.bind(this));
}
-WebInspector.NetworkLogView._defaultColumnsVisivility = {method: true, status: true, domain: false, type: true, initiator: true, size: true, time: true};
+WebInspector.NetworkLogView._defaultColumnsVisivility = {method: true, status: true, domain: false, type: true, initiator: true, cookies: false, setCookies: false, size: true, time: true};
WebInspector.NetworkLogView.prototype = {
_initializeView: function()
@@ -157,7 +157,7 @@
_createTable: function()
{
- var columns = {name: {}, method: {}, status: {}, domain: {}, type: {}, initiator: {}, size: {}, time: {}, timeline: {}};
+ var columns = {name: {}, method: {}, status: {}, domain: {}, type: {}, initiator: {}, cookies: {}, setCookies: {}, size: {}, time: {}, timeline: {}};
columns.name.titleDOMFragment = this._makeHeaderFragment(WebInspector.UIString("Name"), WebInspector.UIString("Path"));
columns.name.name = WebInspector.UIString("Name");
@@ -186,6 +186,16 @@
columns.initiator.sortable = true;
columns.initiator.weight = 10;
+ columns.cookies.title = WebInspector.UIString("Cookies");
+ columns.cookies.sortable = true;
+ columns.cookies.weight = 6;
+ columns.cookies.aligned = "right";
+
+ columns.setCookies.title = WebInspector.UIString("Set-Cookies");
+ columns.setCookies.sortable = true;
+ columns.setCookies.weight = 6;
+ columns.setCookies.aligned = "right";
+
columns.size.titleDOMFragment = this._makeHeaderFragment(WebInspector.UIString("Size"), WebInspector.UIString("Content"));
columns.size.name = WebInspector.UIString("Size");
columns.size.sortable = true;
@@ -280,6 +290,8 @@
this._sortingFunctions.domain = WebInspector.NetworkDataGridNode.RequestPropertyComparator.bind(null, "domain", false);
this._sortingFunctions.type = WebInspector.NetworkDataGridNode.RequestPropertyComparator.bind(null, "mimeType", false);
this._sortingFunctions.initiator = WebInspector.NetworkDataGridNode.InitiatorComparator;
+ this._sortingFunctions.cookies = WebInspector.NetworkDataGridNode.RequestCookiesCountComparator;
+ this._sortingFunctions.setCookies = WebInspector.NetworkDataGridNode.ResponseCookiesCountComparator;
this._sortingFunctions.size = WebInspector.NetworkDataGridNode.SizeComparator;
this._sortingFunctions.time = WebInspector.NetworkDataGridNode.RequestPropertyComparator.bind(null, "duration", false);
this._sortingFunctions.timeline = WebInspector.NetworkDataGridNode.RequestPropertyComparator.bind(null, "startTime", false);
@@ -1961,6 +1973,8 @@
this._domainCell = this._createDivInTD("domain");
this._typeCell = this._createDivInTD("type");
this._initiatorCell = this._createDivInTD("initiator");
+ this._cookiesCell = this._createDivInTD("cookies");
+ this._setCookiesCell = this._createDivInTD("setCookies");
this._sizeCell = this._createDivInTD("size");
this._timeCell = this._createDivInTD("time");
this._createTimelineCell();
@@ -2067,6 +2081,8 @@
this._refreshDomainCell();
this._refreshTypeCell();
this._refreshInitiatorCell();
+ this._refreshCookiesCell();
+ this._refreshSetCookiesCell();
this._refreshSizeCell();
this._refreshTimeCell();
@@ -2212,6 +2228,18 @@
}
},
+ _refreshCookiesCell: function()
+ {
+ var requestCookies = this._request.requestCookies;
+ this._cookiesCell.setTextAndTitle(requestCookies ? "" + requestCookies.length : "");
+ },
+
+ _refreshSetCookiesCell: function()
+ {
+ var responseCookies = this._request.responseCookies;
+ this._setCookiesCell.setTextAndTitle(responseCookies ? "" + responseCookies.length : "");
+ },
+
_refreshSizeCell: function()
{
if (this._request.cached) {
@@ -2382,6 +2410,20 @@
return a._request.initiator.lineNumber - b._request.initiator.lineNumber;
}
+WebInspector.NetworkDataGridNode.RequestCookiesCountComparator = function(a, b)
+{
+ var aScore = a._request.requestCookies ? a._request.requestCookies.length : 0;
+ var bScore = b._request.requestCookies ? b._request.requestCookies.length : 0;
+ return aScore - bScore;
+}
+
+WebInspector.NetworkDataGridNode.ResponseCookiesCountComparator = function(a, b)
+{
+ var aScore = a._request.responseCookies ? a._request.responseCookies.length : 0;
+ var bScore = b._request.responseCookies ? b._request.responseCookies.length : 0;
+ return aScore - bScore;
+}
+
WebInspector.NetworkDataGridNode.RequestPropertyComparator = function(propertyName, revert, a, b)
{
var aValue = a._request[propertyName];