window = new nsWebShellWindow(); if (nsnull == window) { rv = NS_ERROR_OUT_OF_MEMORY; } else {   rv = window->Initialize((nsIWidget *) nsnull, mAppShell, aUrl, aControllerIID, anObserver, aCallbacks, aInitialWidth, aInitialHeight); if (NS_SUCCEEDED(rv)) { aResult = window->GetWidget(); RegisterTopLevelWindow(aResult); window->Show(PR_TRUE); } }
rv = JustCreateTopWindow(aParent, aUrl, aShowWindow, aLoadDefaultPage, aChromeMask, aInitialWidth, aInitialHeight, PR_FALSE, aResult);  if (NS_SUCCEEDED(rv))  RegisterTopLevelWindow(*aResult);
nsAppShellService::CreateTopLevelWindow(nsIWidget *aParent,                                        nsIURL* aUrl, nsString& aControllerIID,                                        nsIWidget*& aResult, nsIStreamObserver* anObserver,                                        nsIXULWindowCallbacks *aCallbacks,                                        PRInt32 aInitialWidth, PRInt32 aInitialHeight){  nsresult rv;  nsWebShellWindow* window;  window = new nsWebShellWindow();  if (nsnull == window) {    rv = NS_ERROR_OUT_OF_MEMORY;  } else {    // temporarily disabling parentage because non-Windows platforms    // seem to be interpreting it in unexpected ways.    rv = window->Initialize((nsIWidget *) nsnull, mAppShell, aUrl, aControllerIID,                            anObserver, aCallbacks,                            aInitialWidth, aInitialHeight);    if (NS_SUCCEEDED(rv)) {      aResult = window->GetWidget();      RegisterTopLevelWindow(aResult);      window->Show(PR_TRUE);    }  }  return rv;}