Base our referrer on the URI of the principal executing the code, not on the URI of the document currently loaded in the window associated to the context we're running on. Bug 402649, r+sr=jst

This commit is contained in:
bzbarsky@mit.edu 2007-11-11 11:11:25 -08:00
Родитель 50b5d2c559
Коммит a9fca9d0ef
2 изменённых файлов: 1 добавлений и 17 удалений

Просмотреть файл

@ -847,7 +847,6 @@ protected:
nsresult SetHrefWithContext(JSContext* cx, const nsAString& aHref,
PRBool aReplace);
nsresult GetSourceURL(JSContext* cx, nsIURI** sourceURL);
nsresult GetSourceBaseURL(JSContext* cx, nsIURI** sourceURL);
nsresult GetSourceDocument(JSContext* cx, nsIDocument** aDocument);

Просмотреть файл

@ -223,8 +223,7 @@ nsLocation::CheckURL(nsIURI* aURI, nsIDocShellLoadInfo** aLoadInfo)
!principal)
return NS_ERROR_FAILURE;
owner = do_QueryInterface(principal);
GetSourceURL(cx, getter_AddRefs(sourceURI));
principal->GetURI(getter_AddRefs(sourceURI));
}
// Create load info
@ -1028,17 +1027,3 @@ nsLocation::GetSourceBaseURL(JSContext* cx, nsIURI** sourceURL)
return rv;
}
nsresult
nsLocation::GetSourceURL(JSContext* cx, nsIURI** sourceURL)
{
nsCOMPtr<nsIDocument> doc;
nsresult rv = GetSourceDocument(cx, getter_AddRefs(doc));
if (doc) {
NS_IF_ADDREF(*sourceURL = doc->GetDocumentURI());
} else {
*sourceURL = nsnull;
}
return rv;
}