Bug 593491. Add some debugging output to try to diagnose random orange.

This commit is contained in:
Timothy Nikkel 2010-10-14 20:03:45 -05:00
Родитель 71de5a40f0
Коммит 4e9e63ad22
1 изменённых файлов: 15 добавлений и 2 удалений

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

@ -1832,7 +1832,6 @@ nsHTMLDocument::OpenCommon(const nsACString& aContentType, PRBool aReplace)
// change the principals of a document for security reasons we'll have to
// refuse to go ahead with this call.
NS_WARNING("No caller doc for open call.");
return NS_ERROR_DOM_SECURITY_ERR;
}
@ -1852,7 +1851,21 @@ nsHTMLDocument::OpenCommon(const nsACString& aContentType, PRBool aReplace)
PRBool equals = PR_FALSE;
if (NS_FAILED(callerPrincipal->Equals(NodePrincipal(), &equals)) ||
!equals) {
NS_WARNING("Principals unequal for open call.");
#ifdef DEBUG
nsCOMPtr<nsIURI> callerDocURI = callerDoc->GetDocumentURI();
nsCOMPtr<nsIURI> thisURI = nsIDocument::GetDocumentURI();
nsCAutoString callerSpec;
nsCAutoString thisSpec;
if (callerDocURI) {
callerDocURI->GetSpec(callerSpec);
}
if (thisURI) {
thisURI->GetSpec(thisSpec);
}
printf("nsHTMLDocument::OpenCommon callerDoc %s this %s\n", callerSpec.get(), thisSpec.get());
#endif
return NS_ERROR_DOM_SECURITY_ERR;
}