Bug 1680332 - Use createContentPrincipalFromOrigin to split scopeAndPrincipal r=geckoview-reviewers,agi

Differential Revision: https://phabricator.services.mozilla.com/D131801
This commit is contained in:
Jonathan Almeida [:jonalmeida] 2021-11-23 17:01:56 +00:00
Родитель 5b5527de61
Коммит 9503390f00
1 изменённых файлов: 5 добавлений и 9 удалений

Просмотреть файл

@ -24,16 +24,12 @@ XPCOMUtils.defineLazyServiceGetter(
const { debug, warn } = GeckoViewUtils.initLogging("GeckoViewPushController");
function createScopeAndPrincipal(scopeAndAttrs) {
const [scope, attrs] = scopeAndAttrs.split("^");
const uri = Services.io.newURI(scope);
const principal = Services.scriptSecurityManager.createContentPrincipalFromOrigin(
scopeAndAttrs
);
const scope = principal.URI.spec;
return [
scope,
Services.scriptSecurityManager.createContentPrincipal(
uri,
ChromeUtils.createOriginAttributesFromOrigin(attrs)
),
];
return [scope, principal];
}
const GeckoViewPushController = {