Bug 1460940 - Convert nsIPrincipal to use nsIDocument. r=bz

MozReview-Commit-ID: z1TGWtS1KG
This commit is contained in:
Adrian Wielgosik
2018-05-11 19:46:15 +02:00
parent 825c66054e
commit e56b3ea2a9
9 changed files with 30 additions and 32 deletions

View File

@@ -25,7 +25,6 @@
#include "nsHtml5TreeOpExecutor.h"
#include "nsIContentSecurityPolicy.h"
#include "nsIContentViewer.h"
#include "nsIDOMDocument.h"
#include "nsIDocShell.h"
#include "nsIDocShellTreeItem.h"
#include "nsIHTMLDocument.h"
@@ -1144,8 +1143,7 @@ nsHtml5TreeOpExecutor::AddSpeculationCSP(const nsAString& aCSP)
nsIPrincipal* principal = mDocument->NodePrincipal();
nsCOMPtr<nsIContentSecurityPolicy> preloadCsp;
nsCOMPtr<nsIDOMDocument> domDoc = do_QueryInterface(mDocument);
nsresult rv = principal->EnsurePreloadCSP(domDoc, getter_AddRefs(preloadCsp));
nsresult rv = principal->EnsurePreloadCSP(mDocument, getter_AddRefs(preloadCsp));
NS_ENSURE_SUCCESS_VOID(rv);
// please note that meta CSPs and CSPs delivered through a header need