зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1678255 - avoid crashing if trying to initialize a fission frameloader with a nullprincipal, r=ckerschb,nika
Differential Revision: https://phabricator.services.mozilla.com/D104865
This commit is contained in:
Родитель
8002a3c48c
Коммит
eff2a84fae
|
@ -901,7 +901,10 @@ static already_AddRefed<nsIPrincipal> CreateRemoteTypeIsolationPrincipal(
|
|||
nsAutoCString origin(
|
||||
Substring(aRemoteType, offset, aRemoteType.Length() - offset));
|
||||
|
||||
return BasePrincipal::CreateContentPrincipal(origin);
|
||||
nsIScriptSecurityManager* ssm = nsContentUtils::GetSecurityManager();
|
||||
nsCOMPtr<nsIPrincipal> principal;
|
||||
ssm->CreateContentPrincipalFromOrigin(origin, getter_AddRefs(principal));
|
||||
return principal.forget();
|
||||
}
|
||||
|
||||
/*static*/
|
||||
|
@ -1429,7 +1432,8 @@ bool ContentParent::ValidatePrincipal(
|
|||
return true;
|
||||
}
|
||||
|
||||
if (RemoteTypePrefix(mRemoteType) != FISSION_WEB_REMOTE_TYPE) {
|
||||
if (!mRemoteTypeIsolationPrincipal ||
|
||||
RemoteTypePrefix(mRemoteType) != FISSION_WEB_REMOTE_TYPE) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче