mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-12 04:45:45 +00:00
Bug 1345433 - Bring back assertion that history entries need a valid triggeringPrincipal r=smaug
MozReview-Commit-ID: 9GfGIxkqfhM --HG-- extra : rebase_source : 4e5909e77cc89e43a129e81baacd8e0f8962c1a9
This commit is contained in:
parent
41f2111481
commit
18b893a6f4
@ -12880,8 +12880,10 @@ nsDocShell::LoadHistoryEntry(nsISHEntry* aEntry, uint32_t aLoadType)
|
||||
srcdoc = VoidString();
|
||||
}
|
||||
|
||||
// If there is no valid triggeringPrincipal, we deny the load
|
||||
MOZ_ASSERT(triggeringPrincipal, "need a valid triggeringPrincipal to load from history");
|
||||
if (!triggeringPrincipal) {
|
||||
triggeringPrincipal = nsContentUtils::GetSystemPrincipal();
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
// Passing nullptr as aSourceDocShell gives the same behaviour as before
|
||||
|
@ -550,6 +550,11 @@ nsSHEntry::GetTriggeringPrincipal(nsIPrincipal** aTriggeringPrincipal)
|
||||
NS_IMETHODIMP
|
||||
nsSHEntry::SetTriggeringPrincipal(nsIPrincipal* aTriggeringPrincipal)
|
||||
{
|
||||
MOZ_ASSERT(aTriggeringPrincipal, "need a valid triggeringPrincipal");
|
||||
if (!aTriggeringPrincipal) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
mShared->mTriggeringPrincipal = aTriggeringPrincipal;
|
||||
return NS_OK;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user