Use the principal doing the load to decide on the URI to pass to content policies. This will help do the right thing for data:/javascript:/about:blank, as well as allow us to skip content policies altogether if the caller is system. Bug 388597, r+sr=sicking

This commit is contained in:
2007-08-07 18:16:09 -07:00
parent a64e8458c6
commit c7695ee4ba
19 changed files with 145 additions and 94 deletions

View File

@@ -220,14 +220,10 @@ CheckPingURI(nsIURI* uri, nsIContent* content)
// Check with contentpolicy
PRInt16 shouldLoad = nsIContentPolicy::ACCEPT;
nsIURI* docURI = nsnull;
nsIDocument* doc = content->GetOwnerDoc();
if (doc) {
docURI = doc->GetDocumentURI();
}
rv = NS_CheckContentLoadPolicy(nsIContentPolicy::TYPE_PING,
uri,
docURI,
nsnull,
content->NodePrincipal(),
content,
EmptyCString(), // mime hint
nsnull, //extra