From 6c0bf8d6c06a52a28a29e9b3ee6bf0345a5e4c05 Mon Sep 17 00:00:00 2001 From: mkwst Date: Mon, 1 Feb 2016 02:05:37 -0800 Subject: [PATCH] Rename first-party-only cookies to same-site cookies. As per https://tools.ietf.org/html/draft-west-first-party-cookies-05 and https://lists.w3.org/Archives/Public/ietf-http-wg/2016JanMar/0134.html. BUG=459154 Review URL: https://codereview.chromium.org/1615773005 Cr-Commit-Position: refs/heads/master@{#372630} --- front_end/components_lazy/CookiesTable.js | 8 ++++---- front_end/sdk/CookieParser.js | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/front_end/components_lazy/CookiesTable.js b/front_end/components_lazy/CookiesTable.js index 3619ffa050..60d5a6c311 100644 --- a/front_end/components_lazy/CookiesTable.js +++ b/front_end/components_lazy/CookiesTable.js @@ -51,7 +51,7 @@ WebInspector.CookiesTable = function(expandable, refreshCallback, selectedCallba {id: "size", title: WebInspector.UIString("Size"), sortable: true, align: WebInspector.DataGrid.Align.Right, weight: 7}, {id: "httpOnly", title: WebInspector.UIString("HTTP"), sortable: true, align: WebInspector.DataGrid.Align.Center, weight: 7}, {id: "secure", title: WebInspector.UIString("Secure"), sortable: true, align: WebInspector.DataGrid.Align.Center, weight: 7}, - {id: "firstPartyOnly", title: WebInspector.UIString("First-Party"), sortable: true, align: WebInspector.DataGrid.Align.Center, weight: 7} + {id: "sameSite", title: WebInspector.UIString("Same-Site"), sortable: true, align: WebInspector.DataGrid.Align.Center, weight: 7} ]; if (readOnly) @@ -144,7 +144,7 @@ WebInspector.CookiesTable.prototype = { for (var i = 0; i < this._data.length; ++i) { var item = this._data[i]; if (item.folderName) { - var groupData = {name: item.folderName, value: "", domain: "", path: "", expires: "", size: this._totalSize(item.cookies), httpOnly: "", secure: "", firstPartyOnly: ""}; + var groupData = {name: item.folderName, value: "", domain: "", path: "", expires: "", size: this._totalSize(item.cookies), httpOnly: "", secure: "", sameSite: ""}; var groupNode = new WebInspector.DataGridNode(groupData); groupNode.selectable = true; this._dataGrid.rootNode().appendChild(groupNode); @@ -227,7 +227,7 @@ WebInspector.CookiesTable.prototype = { case "size": comparator = numberCompare.bind(null, WebInspector.Cookie.prototype.size); break; case "httpOnly": comparator = compareTo.bind(null, WebInspector.Cookie.prototype.httpOnly); break; case "secure": comparator = compareTo.bind(null, WebInspector.Cookie.prototype.secure); break; - case "firstPartyOnly": comparator = compareTo.bind(null, WebInspector.Cookie.prototype.firstPartyOnly); break; + case "sameSite": comparator = compareTo.bind(null, WebInspector.Cookie.prototype.sameSite); break; default: compareTo.bind(null, WebInspector.Cookie.prototype.name); } @@ -261,7 +261,7 @@ WebInspector.CookiesTable.prototype = { const checkmark = "\u2713"; data.httpOnly = (cookie.httpOnly() ? checkmark : ""); data.secure = (cookie.secure() ? checkmark : ""); - data.firstPartyOnly = (cookie.firstPartyOnly() ? checkmark : ""); + data.sameSite = (cookie.sameSite() ? checkmark : ""); var node = new WebInspector.DataGridNode(data); node.cookie = cookie; diff --git a/front_end/sdk/CookieParser.js b/front_end/sdk/CookieParser.js index 9b2805ae12..1bea7702ad 100644 --- a/front_end/sdk/CookieParser.js +++ b/front_end/sdk/CookieParser.js @@ -260,9 +260,9 @@ WebInspector.Cookie.prototype = { /** * @return {boolean} */ - firstPartyOnly: function () + sameSite: function () { - return "first-party-only" in this._attributes; + return "samesite" in this._attributes; }, /** @@ -428,8 +428,8 @@ WebInspector.Cookies._parseProtocolCookie = function(target, protocolCookie) cookie.addAttribute("httpOnly"); if (protocolCookie["secure"]) cookie.addAttribute("secure"); - if (protocolCookie["firstPartyOnly"]) - cookie.addAttribute("first-party-only"); + if (protocolCookie["sameSite"]) + cookie.addAttribute("sameSite"); cookie.setSize(protocolCookie["size"]); return cookie; }