nsAppShellService::Initialize( nsICmdLineService *aCmdLineService, nsISupports *aNativeAppSupportOrSplashScreen )
nsAppShellService::Initialize(void)
nsAppShellService::Initialize( nsICmdLineService *aCmdLineService,                               nsISupports *aNativeAppSupportOrSplashScreen ){  nsresult rv;    // Remember cmd line service.  mCmdLineService = aCmdLineService;  // Remember where the native app support lives.  mNativeAppSupport = do_QueryInterface(aNativeAppSupportOrSplashScreen);  // Or, remember the splash screen (for backward compatibility).  if (!mNativeAppSupport)    mSplashScreen = do_QueryInterface(aNativeAppSupportOrSplashScreen);  NS_TIMELINE_ENTER("nsComponentManager::CreateInstance.");  // Create widget application shell  rv = nsComponentManager::CreateInstance(kAppShellCID, nsnull,                                          NS_GET_IID(nsIAppShell),                                          (void**)getter_AddRefs(mAppShell));  NS_TIMELINE_LEAVE("nsComponentManager::CreateInstance");  if (NS_FAILED(rv))    goto done;  rv = mAppShell->Create(0, nsnull);  if (NS_FAILED(rv))    goto done;  // listen to EventQueues' comings and goings. do this after the appshell  // has been created, but after the event queue has been created. that  // latter bit is unfortunate, but we deal with it.  RegisterObserver(PR_TRUE);   // enable window mediation (and fail if we can't get the mediator)  mWindowMediator = do_GetService(kWindowMediatorCID, &rv);  mWindowWatcher = do_GetService(NS_WINDOWWATCHER_CONTRACTID);done:  return rv;}