summaryrefslogtreecommitdiffstats
path: root/docshell/shistory/nsSHEntry.cpp
diff options
context:
space:
mode:
authorjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-04-30 23:02:01 +0200
committerjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-04-30 23:02:01 +0200
commit2cb9f3ceb89038721eb9528dcc56dd33b66b0c85 (patch)
treeebd21481de50c193c390e29ad5ae3f6f0efeb6f9 /docshell/shistory/nsSHEntry.cpp
parent6cb841b26e10af54559020b23a01ef93a639ac17 (diff)
downloadUXP-2cb9f3ceb89038721eb9528dcc56dd33b66b0c85.tar
UXP-2cb9f3ceb89038721eb9528dcc56dd33b66b0c85.tar.gz
UXP-2cb9f3ceb89038721eb9528dcc56dd33b66b0c85.tar.lz
UXP-2cb9f3ceb89038721eb9528dcc56dd33b66b0c85.tar.xz
UXP-2cb9f3ceb89038721eb9528dcc56dd33b66b0c85.zip
Bug 1307736 - Ensure History loads pass valid triggeringPrincipal
Diffstat (limited to 'docshell/shistory/nsSHEntry.cpp')
-rw-r--r--docshell/shistory/nsSHEntry.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/docshell/shistory/nsSHEntry.cpp b/docshell/shistory/nsSHEntry.cpp
index 9d972136f..9d8bf5096 100644
--- a/docshell/shistory/nsSHEntry.cpp
+++ b/docshell/shistory/nsSHEntry.cpp
@@ -416,6 +416,9 @@ nsSHEntry::Create(nsIURI* aURI, const nsAString& aTitle,
uint64_t aDocShellID,
bool aDynamicCreation)
{
+ MOZ_ASSERT(aTriggeringPrincipal,
+ "need a valid triggeringPrincipal to create a session history entry");
+
mURI = aURI;
mTitle = aTitle;
mPostData = aInputStream;
@@ -515,6 +518,10 @@ 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;
}