Source/WebCore/ChangeLog

 12013-01-29 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 NOBODY (OOPS!).
 7
 8 In some use cases only responses that contain "set-cookie" headers
 9 are interesting.
 10
 11 * English.lproj/localizedStrings.js: Added corresponding strings.
 12 * inspector/front-end/NetworkPanel.js:
 13 (WebInspector.NetworkLogView.prototype._createTable): Added column.
 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.CookiesComparator): Added.
 19
1202013-01-28 Shinya Kawanaka <shinyak@chromium.org>
221
322 [Shadow] Gesture event is not fired in ShadowDOM

Source/WebCore/English.lproj/localizedStrings.js

@@localizedStrings["Blocking"] = "Blocking";
8686localizedStrings["Break on..."] = "Break on...";
8787localizedStrings["Breakpoints"] = "Breakpoints";
8888localizedStrings["Cookies"] = "Cookies";
 89localizedStrings["Cookies sent."] = "Cookies sent.";
 90localizedStrings["Cookies received."] = "Cookies received.";
8991localizedStrings["COUNTERS"] = "COUNTERS";
9092localizedStrings["CPU PROFILES"] = "CPU PROFILES";
9193localizedStrings["CPU profiles show where the execution time is spent in your page's JavaScript functions."] = "CPU profiles show where the execution time is spent in your page's JavaScript functions.";

Source/WebCore/inspector/front-end/NetworkPanel.js

@@WebInspector.NetworkLogView = function(coulmnsVisibilitySetting)
9595 WebInspector.networkLog.requests.forEach(this._appendRequest.bind(this));
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, size: true, time: true};
9999
100100WebInspector.NetworkLogView.prototype = {
101101 _initializeView: function()

@@WebInspector.NetworkLogView.prototype = {
157157
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: {}, size: {}, time: {}, timeline: {}};
161161
162162 columns.name.titleDOMFragment = this._makeHeaderFragment(WebInspector.UIString("Name"), WebInspector.UIString("Path"));
163163 columns.name.name = WebInspector.UIString("Name");

@@WebInspector.NetworkLogView.prototype = {
186186 columns.initiator.sortable = true;
187187 columns.initiator.weight = 10;
188188
 189 columns.cookies.title = WebInspector.UIString("Cookies");
 190 columns.cookies.sortable = true;
 191 columns.cookies.weight = 4
 192 columns.cookies.aligned = "centered";
 193
189194 columns.size.titleDOMFragment = this._makeHeaderFragment(WebInspector.UIString("Size"), WebInspector.UIString("Content"));
190195 columns.size.name = WebInspector.UIString("Size");
191196 columns.size.sortable = true;

@@WebInspector.NetworkLogView.prototype = {
280285 this._sortingFunctions.domain = WebInspector.NetworkDataGridNode.RequestPropertyComparator.bind(null, "domain", false);
281286 this._sortingFunctions.type = WebInspector.NetworkDataGridNode.RequestPropertyComparator.bind(null, "mimeType", false);
282287 this._sortingFunctions.initiator = WebInspector.NetworkDataGridNode.InitiatorComparator;
 288 this._sortingFunctions.cookies = WebInspector.NetworkDataGridNode.CookiesComparator;
283289 this._sortingFunctions.size = WebInspector.NetworkDataGridNode.SizeComparator;
284290 this._sortingFunctions.time = WebInspector.NetworkDataGridNode.RequestPropertyComparator.bind(null, "duration", false);
285291 this._sortingFunctions.timeline = WebInspector.NetworkDataGridNode.RequestPropertyComparator.bind(null, "startTime", false);

@@WebInspector.NetworkDataGridNode.prototype = {
19611967 this._domainCell = this._createDivInTD("domain");
19621968 this._typeCell = this._createDivInTD("type");
19631969 this._initiatorCell = this._createDivInTD("initiator");
 1970 this._cookiesCell = this._createDivInTD("cookies");
19641971 this._sizeCell = this._createDivInTD("size");
19651972 this._timeCell = this._createDivInTD("time");
19661973 this._createTimelineCell();

@@WebInspector.NetworkDataGridNode.prototype = {
20672074 this._refreshDomainCell();
20682075 this._refreshTypeCell();
20692076 this._refreshInitiatorCell();
 2077 this._refreshCookiesCell();
20702078 this._refreshSizeCell();
20712079 this._refreshTimeCell();
20722080

@@WebInspector.NetworkDataGridNode.prototype = {
22122220 }
22132221 },
22142222
 2223 _refreshCookiesCell: function()
 2224 {
 2225 this._cookiesCell.removeChildren();
 2226 var value = [];
 2227 var title = [];
 2228 var responseCookies = this._request.responseCookies;
 2229 if (responseCookies && responseCookies.length) {
 2230 value.push("\u25BC");
 2231 title.push(WebInspector.UIString("Cookies received."));
 2232 }
 2233 var requestCookies = this._request.requestCookies;
 2234 if (requestCookies && requestCookies.length) {
 2235 value.push("\u25B2");
 2236 title.push(WebInspector.UIString("Cookies sent."));
 2237 }
 2238 this._cookiesCell.createTextChild(value.join(""));
 2239 this._cookiesCell.title = title.join("\n");
 2240 },
 2241
22152242 _refreshSizeCell: function()
22162243 {
22172244 if (this._request.cached) {

@@WebInspector.NetworkDataGridNode.InitiatorComparator = function(a, b)
23822409 return a._request.initiator.lineNumber - b._request.initiator.lineNumber;
23832410}
23842411
 2412WebInspector.NetworkDataGridNode.CookiesComparator = function(a, b)
 2413{
 2414 var aScore = (a._request.responseCookies && a._request.responseCookies.length) ? 2 : 0;
 2415 aScore += (a._request.requestCookies && a._request.requestCookies.length) ? 1 : 0;
 2416
 2417 var bScore = (b._request.responseCookies && b._request.responseCookies.length) ? 2 : 0;
 2418 bScore += (b._request.requestCookies && b._request.requestCookies.length) ? 1 : 0;
 2419
 2420 return bScore - aScore;
 2421}
 2422
23852423WebInspector.NetworkDataGridNode.RequestPropertyComparator = function(propertyName, revert, a, b)
23862424{
23872425 var aValue = a._request[propertyName];