зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1599801 - NullPrincipal::Init is infallible. r=bzbarsky
I also cleaned up the comment a bit. Differential Revision: https://phabricator.services.mozilla.com/D54970 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
b199ff482d
Коммит
817696d634
|
@ -54,8 +54,7 @@ already_AddRefed<NullPrincipal> NullPrincipal::CreateWithInheritedAttributes(
|
|||
already_AddRefed<NullPrincipal> NullPrincipal::CreateWithInheritedAttributes(
|
||||
const OriginAttributes& aOriginAttributes, bool aIsFirstParty) {
|
||||
RefPtr<NullPrincipal> nullPrin = new NullPrincipal();
|
||||
nsresult rv = nullPrin->Init(aOriginAttributes, aIsFirstParty);
|
||||
MOZ_RELEASE_ASSERT(NS_SUCCEEDED(rv));
|
||||
nullPrin->Init(aOriginAttributes, aIsFirstParty);
|
||||
return nullPrin.forget();
|
||||
}
|
||||
|
||||
|
@ -98,8 +97,8 @@ nsresult NullPrincipal::Init(const OriginAttributes& aOriginAttributes,
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult NullPrincipal::Init(const OriginAttributes& aOriginAttributes,
|
||||
bool aIsFirstParty) {
|
||||
void NullPrincipal::Init(const OriginAttributes& aOriginAttributes,
|
||||
bool aIsFirstParty) {
|
||||
mURI = new NullPrincipalURI();
|
||||
|
||||
nsAutoCString originNoSuffix;
|
||||
|
@ -119,8 +118,6 @@ nsresult NullPrincipal::Init(const OriginAttributes& aOriginAttributes,
|
|||
}
|
||||
|
||||
FinishInit(originNoSuffix, attrs);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult NullPrincipal::GetScriptLocation(nsACString& aStr) {
|
||||
|
|
|
@ -112,11 +112,11 @@ class NullPrincipal final : public BasePrincipal {
|
|||
nsCOMPtr<nsIURI> mURI;
|
||||
|
||||
private:
|
||||
// If aIsFirstParty is true, this NullPrincipal will be initialized base on
|
||||
// the aOriginAttributes with FirstPartyDomain set to an unique value, and
|
||||
// this value is generated from mURI.path, with ".mozilla" appending at the
|
||||
// If aIsFirstParty is true, this NullPrincipal will be initialized based on
|
||||
// the aOriginAttributes with FirstPartyDomain set to a unique value.
|
||||
// This value is generated from mURI.path, with ".mozilla" appended at the
|
||||
// end.
|
||||
nsresult Init(const OriginAttributes& aOriginAttributes, bool aIsFirstParty);
|
||||
void Init(const OriginAttributes& aOriginAttributes, bool aIsFirstParty);
|
||||
};
|
||||
|
||||
} // namespace mozilla
|
||||
|
|
Загрузка…
Ссылка в новой задаче