nsXBLDocGlobalObject::GetPrincipal(nsIPrincipal** aPrincipal)
nsXBLDocGlobalObject::GetPrincipal()
nsXBLDocGlobalObject::GetPrincipal(nsIPrincipal** aPrincipal){  nsresult rv = NS_OK;  if (!mGlobalObjectOwner) {    *aPrincipal = nsnull;    return NS_ERROR_FAILURE;  }  nsCOMPtr<nsIXBLDocumentInfo> docInfo = do_QueryInterface(mGlobalObjectOwner, &rv);  NS_ENSURE_SUCCESS(rv, NS_ERROR_FAILURE);  nsCOMPtr<nsIDocument> document;  rv = docInfo->GetDocument(getter_AddRefs(document));  NS_ENSURE_SUCCESS(rv, NS_ERROR_FAILURE);  *aPrincipal = document->GetPrincipal();  if (!*aPrincipal)    return NS_ERROR_FAILURE;  NS_ADDREF(*aPrincipal);  return NS_OK;}