Index: third_party/WebKit/Source/devtools/front_end/sdk/CookieModel.js |
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/CookieModel.js b/third_party/WebKit/Source/devtools/front_end/sdk/CookieModel.js |
index d9d958dd714c20e1126d263c0aab5cc84eaeab01..eef47a23eeefe0cc36d4d971d05939cbd1af5d9c 100644 |
--- a/third_party/WebKit/Source/devtools/front_end/sdk/CookieModel.js |
+++ b/third_party/WebKit/Source/devtools/front_end/sdk/CookieModel.js |
@@ -5,9 +5,11 @@ |
SDK.CookieModel = class extends SDK.SDKModel { |
/** |
* @param {!SDK.Target} target |
+ * @param {!Protocol.Dispatcher} dispatcher |
*/ |
- constructor(target) { |
- super(target); |
+ constructor(target, dispatcher) { |
+ super(target, dispatcher); |
+ this._networkAgent = dispatcher.networkAgent(); |
} |
/** |
@@ -62,7 +64,7 @@ SDK.CookieModel = class extends SDK.SDKModel { |
* @param {function(!Array<!SDK.Cookie>)} callback |
*/ |
getCookiesAsync(urls, callback) { |
- this.target().networkAgent().getCookies(urls, (err, cookies) => { |
+ this._networkAgent.getCookies(urls, (err, cookies) => { |
if (err) { |
console.error(err); |
return callback([]); |
@@ -99,7 +101,7 @@ SDK.CookieModel = class extends SDK.SDKModel { |
var expires = undefined; |
if (cookie.expires()) |
expires = Math.floor(Date.parse(cookie.expires()) / 1000); |
- this.target().networkAgent().setCookie( |
+ this._networkAgent.setCookie( |
cookie.url(), cookie.name(), cookie.value(), domain, cookie.path(), cookie.secure(), cookie.httpOnly(), |
cookie.sameSite(), expires, callback); |
} |
@@ -129,7 +131,7 @@ SDK.CookieModel = class extends SDK.SDKModel { |
* @param {function()=} callback |
*/ |
_deleteAll(cookies, callback) { |
- var networkAgent = this.target().networkAgent(); |
+ var networkAgent = this._networkAgent; |
function deleteCookie(cookie) { |
return new Promise(resolve => networkAgent.deleteCookie(cookie.name(), cookie.url(), resolve)); |
} |