Backed out changeset ffa4255ebaa7 (bug 1016875) for bustage on a CLOSED TREE

This commit is contained in:
Carsten "Tomcat" Book 2014-07-16 15:25:59 +02:00
parent a927af1835
commit 89828810a9
2 changed files with 7 additions and 14 deletions

View File

@ -190,23 +190,14 @@ void ImportLoader::ReleaseResources()
mImportParent = nullptr;
}
nsIPrincipal*
ImportLoader::Principal()
{
MOZ_ASSERT(mImportParent);
nsCOMPtr<nsIDocument> master = mImportParent->MasterDocument();
nsCOMPtr<nsIScriptObjectPrincipal> sop = do_QueryInterface(master);
MOZ_ASSERT(sop);
return sop->GetPrincipal();
}
void
ImportLoader::Open()
{
AutoError ae(this, false);
// Imports should obey to the master documents CSP.
nsCOMPtr<nsIDocument> master = mImportParent->MasterDocument();
nsIPrincipal* principal = Principal();
nsCOMPtr<nsIScriptObjectPrincipal> sop = do_QueryInterface(master);
nsCOMPtr<nsIPrincipal> principal = sop->GetPrincipal();
int16_t shouldLoad = nsIContentPolicy::ACCEPT;
nsresult rv = NS_CheckContentLoadPolicy(nsIContentPolicy::TYPE_SCRIPT,
@ -333,7 +324,11 @@ NS_IMETHODIMP
ImportLoader::OnStartRequest(nsIRequest* aRequest, nsISupports* aContext)
{
AutoError ae(this);
nsIPrincipal* principal = Principal();
nsCOMPtr<nsIScriptObjectPrincipal> sop = do_QueryInterface(mImportParent);
nsCOMPtr<nsIPrincipal> principal = sop->GetPrincipal();
if (!sop) {
return NS_ERROR_DOM_ABORT_ERR;
}
nsCOMPtr<nsIChannel> channel = do_QueryInterface(aRequest);
if (!channel) {

View File

@ -115,8 +115,6 @@ private:
void BlockScripts();
void UnblockScripts();
nsIPrincipal* Principal();
nsCOMPtr<nsIDocument> mDocument;
nsCOMPtr<nsIURI> mURI;
nsCOMPtr<nsIStreamListener> mParserStreamListener;