зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1654583 - Refactor SiteDataManager.jsm to not use principal.uri r=ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D82912
This commit is contained in:
Родитель
afd61504a3
Коммит
62263a0673
|
@ -147,9 +147,8 @@ var SiteDataManager = {
|
||||||
let principal = Services.scriptSecurityManager.createContentPrincipalFromOrigin(
|
let principal = Services.scriptSecurityManager.createContentPrincipalFromOrigin(
|
||||||
item.origin
|
item.origin
|
||||||
);
|
);
|
||||||
let uri = principal.URI;
|
if (principal.schemeIs("http") || principal.schemeIs("https")) {
|
||||||
if (uri.scheme == "http" || uri.scheme == "https") {
|
let site = this._getOrInsertSite(principal.host);
|
||||||
let site = this._getOrInsertSite(uri.host);
|
|
||||||
// Assume 3 sites:
|
// Assume 3 sites:
|
||||||
// - Site A (not persisted): https://www.foo.com
|
// - Site A (not persisted): https://www.foo.com
|
||||||
// - Site B (not persisted): https://www.foo.com^userContextId=2
|
// - Site B (not persisted): https://www.foo.com^userContextId=2
|
||||||
|
@ -217,8 +216,7 @@ var SiteDataManager = {
|
||||||
let principal = Services.scriptSecurityManager.createContentPrincipalFromOrigin(
|
let principal = Services.scriptSecurityManager.createContentPrincipalFromOrigin(
|
||||||
group
|
group
|
||||||
);
|
);
|
||||||
let uri = principal.URI;
|
let site = this._getOrInsertSite(principal.host);
|
||||||
let site = this._getOrInsertSite(uri.host);
|
|
||||||
if (!site.principals.some(p => p.origin == principal.origin)) {
|
if (!site.principals.some(p => p.origin == principal.origin)) {
|
||||||
site.principals.push(principal);
|
site.principals.push(principal);
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче