bug #145579 (r=darin, sr=jst) send the correct referrer for images...

git-svn-id: svn://10.0.0.236/trunk@129799 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
rpotts%netscape.com
2002-09-17 18:59:41 +00:00
parent 9dd35360c6
commit 5d90e7c567
12 changed files with 139 additions and 43 deletions

View File

@@ -92,8 +92,6 @@ nsImageLoader::Load(nsIURI *aURI)
return NS_ERROR_FAILURE;
nsCOMPtr<nsILoadGroup> loadGroup;
nsCOMPtr<nsIURI> uri;
nsCOMPtr<nsIURI> baseURI;
nsCOMPtr<nsIPresShell> shell;
nsresult rv = mPresContext->GetShell(getter_AddRefs(shell));
@@ -106,6 +104,10 @@ nsImageLoader::Load(nsIURI *aURI)
// Get the document's loadgroup
doc->GetDocumentLoadGroup(getter_AddRefs(loadGroup));
// Get the document URI (for the referrer).
nsCOMPtr<nsIURI> documentURI;
doc->GetDocumentURL(getter_AddRefs(documentURI));
if (mRequest) {
nsCOMPtr<nsIURI> oldURI;
mRequest->GetURI(getter_AddRefs(oldURI));
@@ -119,7 +121,8 @@ nsImageLoader::Load(nsIURI *aURI)
nsCOMPtr<imgILoader> il(do_GetService("@mozilla.org/image/loader;1", &rv));
if (NS_FAILED(rv)) return rv;
return il->LoadImage(aURI, nsnull, loadGroup, NS_STATIC_CAST(imgIDecoderObserver *, this),
// XXX: initialDocumentURI is NULL!
return il->LoadImage(aURI, nsnull, documentURI, loadGroup, NS_STATIC_CAST(imgIDecoderObserver *, this),
nsnull, nsIRequest::LOAD_BACKGROUND, nsnull, nsnull, getter_AddRefs(mRequest));
}