| Index: third_party/WebKit/Source/devtools/front_end/sdk/CookieParser.js
|
| diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/CookieParser.js b/third_party/WebKit/Source/devtools/front_end/sdk/CookieParser.js
|
| index 9554d691646b9aa711e433cacb464ee80e21285c..8bcb40ef01dda60f25ac70a587c1f4726643fbef 100644
|
| --- a/third_party/WebKit/Source/devtools/front_end/sdk/CookieParser.js
|
| +++ b/third_party/WebKit/Source/devtools/front_end/sdk/CookieParser.js
|
| @@ -250,7 +250,7 @@ SDK.Cookie = class {
|
| }
|
|
|
| /**
|
| - * @return {string}
|
| + * @return {!Protocol.Network.CookieSameSite<string>}
|
| */
|
| sameSite() {
|
| return this._attributes['samesite'];
|
| @@ -287,7 +287,7 @@ SDK.Cookie = class {
|
| }
|
|
|
| /**
|
| - * @return {string}
|
| + * @return {number}
|
| */
|
| expires() {
|
| return this._attributes['expires'];
|
| @@ -307,6 +307,10 @@ SDK.Cookie = class {
|
| return this._size;
|
| }
|
|
|
| + url() {
|
| + return (this.secure() ? 'https://' : 'http://') + this.domain() + this.path();
|
| + }
|
| +
|
| /**
|
| * @param {number} size
|
| */
|
| @@ -339,7 +343,7 @@ SDK.Cookie = class {
|
|
|
| /**
|
| * @param {string} key
|
| - * @param {string=} value
|
| + * @param {string|number=} value
|
| */
|
| addAttribute(key, value) {
|
| this._attributes[key.toLowerCase()] = value;
|
| @@ -349,8 +353,19 @@ SDK.Cookie = class {
|
| * @param {function(?Protocol.Error)=} callback
|
| */
|
| remove(callback) {
|
| - this._target.networkAgent().deleteCookie(
|
| - this.name(), (this.secure() ? 'https://' : 'http://') + this.domain() + this.path(), callback);
|
| + this._target.networkAgent().deleteCookie(this.name(), this.url(), callback);
|
| + }
|
| +
|
| + /**
|
| + * @param {function(?Protocol.Error, boolean)=} callback
|
| + */
|
| + save(callback) {
|
| + var domain = this.domain();
|
| + // for cookies targeting single domain and no sub domains 'domain' field should be sent empty
|
| + if (!domain.startsWith('.'))
|
| + domain = '';
|
| + this._target.networkAgent().setCookie(this.url(), this.name(), this.value(), domain, this.path(), this.secure(),
|
| + this.httpOnly(), this.sameSite(), this.expires(), callback);
|
| }
|
| };
|
|
|
|
|