nsresult rv;  rv = UnregisterTopLevelWindow(aWindow); if (0 == mWindowList->Count()) { mAppShell->Exit(); }  return rv;
nsCOMPtr<nsIWebShellWindow> webShellWin(do_QueryInterface(aWindow)); NS_ENSURE_TRUE(webShellWin, NS_ERROR_FAILURE); return webShellWin->Close();
nsAppShellService::CloseTopLevelWindow(nsIWidget* aWindow){  nsresult rv;  rv = UnregisterTopLevelWindow(aWindow);  if (0 == mWindowList->Count()) {    mAppShell->Exit();  }  return rv;}