mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-10 20:05:49 +00:00
Bug 1315905
- Cleanup Necko http security check, r=valentin
This commit is contained in:
parent
d981a267d6
commit
9218d463aa
@ -159,18 +159,22 @@ NeckoParent::GetValidatedOriginAttributes(const SerializedLoadContext& aSerializ
|
||||
nsIPrincipal* aRequestingPrincipal,
|
||||
DocShellOriginAttributes& aAttrs)
|
||||
{
|
||||
if (!aSerialized.IsNotNull()) {
|
||||
if (UsingNeckoIPCSecurity()) {
|
||||
CrashWithReason("GetValidatedOriginAttributes | SerializedLoadContext from child is null");
|
||||
return "SerializedLoadContext from child is null";
|
||||
if (!UsingNeckoIPCSecurity()) {
|
||||
if (!aSerialized.IsNotNull()) {
|
||||
// If serialized is null, we cannot validate anything. We have to assume
|
||||
// that this requests comes from a SystemPrincipal.
|
||||
aAttrs = DocShellOriginAttributes(NECKO_NO_APP_ID, false);
|
||||
} else {
|
||||
aAttrs = aSerialized.mOriginAttributes;
|
||||
}
|
||||
|
||||
// If serialized is null, we cannot validate anything. We have to assume
|
||||
// that this requests comes from a SystemPrincipal.
|
||||
aAttrs = DocShellOriginAttributes(NECKO_NO_APP_ID, false);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (!aSerialized.IsNotNull()) {
|
||||
CrashWithReason("GetValidatedOriginAttributes | SerializedLoadContext from child is null");
|
||||
return "SerializedLoadContext from child is null";
|
||||
}
|
||||
|
||||
nsTArray<TabContext> contextArray =
|
||||
static_cast<ContentParent*>(aContent)->GetManagedTabContext();
|
||||
|
||||
@ -213,12 +217,6 @@ NeckoParent::GetValidatedOriginAttributes(const SerializedLoadContext& aSerializ
|
||||
}
|
||||
}
|
||||
|
||||
if (!UsingNeckoIPCSecurity()) {
|
||||
// We are running some tests
|
||||
aAttrs = aSerialized.mOriginAttributes;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
nsAutoCString errorString;
|
||||
errorString.Append("GetValidatedOriginAttributes | App does not have permission -");
|
||||
errorString.Append(debugString);
|
||||
|
Loading…
Reference in New Issue
Block a user