*aPrincipal = nsnull; return NS_ERROR_FAILURE;
return nsnull;
nsXULPDGlobalObject::GetPrincipal(nsIPrincipal** aPrincipal){    if (!mGlobalObjectOwner) {        // See nsXULPrototypeDocument::NewXULPDGlobalObject, the comment        // about gSystemGlobal implying gSystemPrincipal.        if (this == nsXULPrototypeDocument::gSystemGlobal) {            *aPrincipal = nsXULPrototypeDocument::gSystemPrincipal;            NS_ADDREF(*aPrincipal);            return NS_OK;        }        *aPrincipal = nsnull;        return NS_ERROR_FAILURE;    }    nsCOMPtr<nsIXULPrototypeDocument> protoDoc      = do_QueryInterface(mGlobalObjectOwner);    *aPrincipal = protoDoc->GetDocumentPrincipal();    if (!*aPrincipal) {        return NS_ERROR_FAILURE;    }    NS_ADDREF(*aPrincipal);    return NS_OK;}