зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1680332 - Use createContentPrincipalFromOrigin to split scopeAndPrincipal r=geckoview-reviewers,agi
Differential Revision: https://phabricator.services.mozilla.com/D131801
This commit is contained in:
Родитель
5b5527de61
Коммит
9503390f00
|
@ -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 = {
|
||||
|
|
Загрузка…
Ссылка в новой задаче