Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(558)

Unified Diff: third_party/WebKit/Source/devtools/front_end/sdk/CookieModel.js

Issue 2782773002: [DevTools] Remove SDKModels' fromTarget methods (Closed)
Patch Set: addressed review comments Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 a03c0e1cb6dd7920612555d90b97cd2f7e80b546..5920342e19c1f4521f4093ad43281634293bdf2d 100644
--- a/third_party/WebKit/Source/devtools/front_end/sdk/CookieModel.js
+++ b/third_party/WebKit/Source/devtools/front_end/sdk/CookieModel.js
@@ -32,14 +32,6 @@ SDK.CookieModel = class extends SDK.SDKModel {
}
/**
- * @param {!SDK.Target} target
- * @return {!SDK.CookieModel}
- */
- static fromTarget(target) {
- return /** @type {!SDK.CookieModel} */ (target.model(SDK.CookieModel));
- }
-
- /**
* @param {!SDK.Cookie} cookie
* @param {string} resourceURL
* @return {boolean}
@@ -126,7 +118,9 @@ SDK.CookieModel = class extends SDK.SDKModel {
if (url && (!domain || url.securityOrigin() === domain))
resourceURLs.push(resource.url);
}
- SDK.ResourceTreeModel.fromTarget(this.target()).forAllResources(populateResourceURLs);
+ var resourceTreeModel = this.target().model(SDK.ResourceTreeModel);
+ if (resourceTreeModel)
+ resourceTreeModel.forAllResources(populateResourceURLs);
this.getCookiesAsync(resourceURLs, callback);
}

Powered by Google App Engine
This is Rietveld 408576698