rv = JustCreateTopWindow(aParent, aUrl, aShowWindow, aLoadDefaultPage, aChromeMask, aInitialWidth, aInitialHeight, PR_FALSE, aResult);  if (NS_SUCCEEDED(rv))  RegisterTopLevelWindow(*aResult);
window = new nsWebShellWindow(); if (nsnull == window) { rv = NS_ERROR_OUT_OF_MEMORY; } else { rv = window->Initialize(mAppShell, aUrl, aControllerIID, anObserver); if (NS_SUCCEEDED(rv)) { aResult = window->GetWidget(); RegisterTopLevelWindow(aResult); window->Show(PR_TRUE); } }
nsAppShellService::CreateTopLevelWindow(nsIXULWindow *aParent,                                  nsIURI *aUrl,                                   PRBool aShowWindow, PRBool aLoadDefaultPage,                                  PRUint32 aChromeMask,                                  PRInt32 aInitialWidth, PRInt32 aInitialHeight,                                  nsIXULWindow **aResult){  nsresult rv;  rv = JustCreateTopWindow(aParent, aUrl, aShowWindow, aLoadDefaultPage,                                 aChromeMask, aInitialWidth, aInitialHeight,                                 PR_FALSE, aResult);  if (NS_SUCCEEDED(rv))    // the addref resulting from this is the owning addref for this window    RegisterTopLevelWindow(*aResult);  return rv;}