Changeset 141417 in webkit


Ignore:
Timestamp:
Jan 31, 2013 6:52:58 AM (11 years ago)
Author:
commit-queue@webkit.org
Message:

Web Inspector: [Network] Add cookie column to show presence of request/response cookies.
https://bugs.webkit.org/show_bug.cgi?id=107441

Patch by Eugene Klyuchnikov <eustas@chromium.org> on 2013-01-31
Reviewed by Pavel Feldman.

In some use cases only responses that contain "set-cookie" headers
are interesting.

  • English.lproj/localizedStrings.js: Added "Set-Cookies" string.
  • inspector/front-end/NetworkPanel.js:

(WebInspector.NetworkLogView.prototype._createTable): Added columns.
(WebInspector.NetworkLogView.prototype._createSortingFunctions): Ditto.
(WebInspector.NetworkDataGridNode.prototype.createCells): Ditto.
(WebInspector.NetworkDataGridNode.prototype.refreshRequest): Ditto.
(WebInspector.NetworkDataGridNode.prototype._refreshCookiesCell): Added.
(WebInspector.NetworkDataGridNode.prototype._refreshSetCookiesCell): Added.
(WebInspector.NetworkDataGridNode.RequestCookiesCountComparator): Added.
(WebInspector.NetworkDataGridNode.ResponseCookiesCountComparator): Added.

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r141415 r141417  
     12013-01-31  Eugene Klyuchnikov  <eustas@chromium.org>
     2
     3        Web Inspector: [Network] Add cookie column to show presence of request/response cookies.
     4        https://bugs.webkit.org/show_bug.cgi?id=107441
     5
     6        Reviewed by Pavel Feldman.
     7
     8        In some use cases only responses that contain "set-cookie" headers
     9        are interesting.
     10
     11        * English.lproj/localizedStrings.js: Added "Set-Cookies" string.
     12        * inspector/front-end/NetworkPanel.js:
     13        (WebInspector.NetworkLogView.prototype._createTable): Added columns.
     14        (WebInspector.NetworkLogView.prototype._createSortingFunctions): Ditto.
     15        (WebInspector.NetworkDataGridNode.prototype.createCells): Ditto.
     16        (WebInspector.NetworkDataGridNode.prototype.refreshRequest): Ditto.
     17        (WebInspector.NetworkDataGridNode.prototype._refreshCookiesCell): Added.
     18        (WebInspector.NetworkDataGridNode.prototype._refreshSetCookiesCell): Added.
     19        (WebInspector.NetworkDataGridNode.RequestCookiesCountComparator): Added.
     20        (WebInspector.NetworkDataGridNode.ResponseCookiesCountComparator): Added.
     21
    1222013-01-31  Andrey Adaikin  <aandrey@chromium.org>
    223
  • trunk/Source/WebCore/English.lproj/localizedStrings.js

    r141269 r141417  
    395395localizedStrings["Lon = "] = "Lon = ";
    396396localizedStrings["Response Time"] = "Response Time";
     397localizedStrings["Set-Cookies"] = "Set-Cookies";
    397398localizedStrings["Start"] = "Start";
    398399localizedStrings["Start CPU profiling."] = "Start CPU profiling.";
  • trunk/Source/WebCore/inspector/front-end/NetworkPanel.js

    r140814 r141417  
    9696}
    9797
    98 WebInspector.NetworkLogView._defaultColumnsVisivility = {method: true, status: true, domain: false, type: true, initiator: true, size: true, time: true};
     98WebInspector.NetworkLogView._defaultColumnsVisivility = {method: true, status: true, domain: false, type: true, initiator: true, cookies: false, setCookies: false, size: true, time: true};
    9999
    100100WebInspector.NetworkLogView.prototype = {
     
    158158    _createTable: function()
    159159    {
    160         var columns = {name: {}, method: {}, status: {}, domain: {}, type: {}, initiator: {}, size: {}, time: {}, timeline: {}};
     160        var columns = {name: {}, method: {}, status: {}, domain: {}, type: {}, initiator: {}, cookies: {}, setCookies: {}, size: {}, time: {}, timeline: {}};
    161161
    162162        columns.name.titleDOMFragment = this._makeHeaderFragment(WebInspector.UIString("Name"), WebInspector.UIString("Path"));
     
    186186        columns.initiator.sortable = true;
    187187        columns.initiator.weight = 10;
     188
     189        columns.cookies.title = WebInspector.UIString("Cookies");
     190        columns.cookies.sortable = true;
     191        columns.cookies.weight = 6;
     192        columns.cookies.aligned = "right";
     193
     194        columns.setCookies.title = WebInspector.UIString("Set-Cookies");
     195        columns.setCookies.sortable = true;
     196        columns.setCookies.weight = 6;
     197        columns.setCookies.aligned = "right";
    188198
    189199        columns.size.titleDOMFragment = this._makeHeaderFragment(WebInspector.UIString("Size"), WebInspector.UIString("Content"));
     
    281291        this._sortingFunctions.type = WebInspector.NetworkDataGridNode.RequestPropertyComparator.bind(null, "mimeType", false);
    282292        this._sortingFunctions.initiator = WebInspector.NetworkDataGridNode.InitiatorComparator;
     293        this._sortingFunctions.cookies = WebInspector.NetworkDataGridNode.RequestCookiesCountComparator;
     294        this._sortingFunctions.setCookies = WebInspector.NetworkDataGridNode.ResponseCookiesCountComparator;
    283295        this._sortingFunctions.size = WebInspector.NetworkDataGridNode.SizeComparator;
    284296        this._sortingFunctions.time = WebInspector.NetworkDataGridNode.RequestPropertyComparator.bind(null, "duration", false);
     
    19621974        this._typeCell = this._createDivInTD("type");
    19631975        this._initiatorCell = this._createDivInTD("initiator");
     1976        this._cookiesCell = this._createDivInTD("cookies");
     1977        this._setCookiesCell = this._createDivInTD("setCookies");
    19641978        this._sizeCell = this._createDivInTD("size");
    19651979        this._timeCell = this._createDivInTD("time");
     
    20682082        this._refreshTypeCell();
    20692083        this._refreshInitiatorCell();
     2084        this._refreshCookiesCell();
     2085        this._refreshSetCookiesCell();
    20702086        this._refreshSizeCell();
    20712087        this._refreshTimeCell();
     
    22132229    },
    22142230
     2231    _refreshCookiesCell: function()
     2232    {
     2233        var requestCookies = this._request.requestCookies;
     2234        this._cookiesCell.setTextAndTitle(requestCookies ? "" + requestCookies.length : "");
     2235    },
     2236
     2237    _refreshSetCookiesCell: function()
     2238    {
     2239        var responseCookies = this._request.responseCookies;
     2240        this._setCookiesCell.setTextAndTitle(responseCookies ? "" + responseCookies.length : "");
     2241    },
     2242
    22152243    _refreshSizeCell: function()
    22162244    {
     
    23832411}
    23842412
     2413WebInspector.NetworkDataGridNode.RequestCookiesCountComparator = function(a, b)
     2414{
     2415    var aScore = a._request.requestCookies ? a._request.requestCookies.length : 0;
     2416    var bScore = b._request.requestCookies ? b._request.requestCookies.length : 0;
     2417    return aScore - bScore;
     2418}
     2419
     2420WebInspector.NetworkDataGridNode.ResponseCookiesCountComparator = function(a, b)
     2421{
     2422    var aScore = a._request.responseCookies ? a._request.responseCookies.length : 0;
     2423    var bScore = b._request.responseCookies ? b._request.responseCookies.length : 0;
     2424    return aScore - bScore;
     2425}
     2426
    23852427WebInspector.NetworkDataGridNode.RequestPropertyComparator = function(propertyName, revert, a, b)
    23862428{
Note: See TracChangeset for help on using the changeset viewer.