Commit 64c93bc1 authored by blakeross%telocity.com's avatar blakeross%telocity.com
Browse files

Cleaner fix for making turbo mode dynamic (89504). r=ccarlen sr=ben

parent 7d73da2c
Loading
Loading
Loading
Loading
+1 −5
Original line number Diff line number Diff line
@@ -136,8 +136,7 @@
 *
 * This interface has these attributes:
 *  isServerMode - Boolean attribute indicating whether the application
 *                 is running in "server mode" as a result of the
 *                 browser.turbo.enabled pref. Server mode means the
 *                 is running in "server mode." Server mode means the
 *                 application was started to pre-load shared-libraries,
 *                 initialize services, and open a hidden Navigator window
 *                 in order to quickly surface that window when the user
@@ -146,8 +145,6 @@
 *                 sense there) and is intended to be initiated from the
 *                 Windows startup folder at system initialization.
 *
 *  isStartupServerMode - Boolean attribute indicated whether the app is in
 *                        "server mode" as a result of the -turbo cmdline arg.
 *
 *  needsProfileUI - Boolean attribute used when running in "server mode."
 *                   If the "server mode" caused profile dialogs to be
@@ -171,7 +168,6 @@ interface nsINativeAppSupport : nsISupports {

    // Server mode.
    attribute boolean isServerMode;
    readonly attribute boolean isStartupServerMode;
    void startServerMode();
    attribute boolean needsProfileUI;
};
+6 −3
Original line number Diff line number Diff line
@@ -830,7 +830,7 @@ static nsresult Ensure1Window( nsICmdLineService* cmdLineArgs)
      PRBool serverMode = PR_FALSE;
      rv = GetNativeAppSupport(getter_AddRefs(nativeApp));
      // Create special Nav window.
      if (NS_SUCCEEDED(rv) && NS_SUCCEEDED(nativeApp->GetIsStartupServerMode(&serverMode)) && serverMode) {
      if (NS_SUCCEEDED(rv) && NS_SUCCEEDED(nativeApp->GetIsServerMode(&serverMode)) && serverMode) {
         nativeApp->StartServerMode();
         return NS_OK;
      } 
@@ -1275,10 +1275,13 @@ static nsresult main1(int argc, char* argv[], nsISupports *nativeApp )
    nsCOMPtr<nsIPref> prefs(do_GetService(NS_PREF_CONTRACTID, &rv));
    if (NS_SUCCEEDED(rv) && prefs) {
      PRBool serverMode = PR_FALSE;
      nativeApps->GetIsServerMode(&serverMode);
      if (!serverMode) {    // okay, so it's not -turbo
        prefs->GetBoolPref(TURBO_PREF, &serverMode);
        nativeApps->SetIsServerMode(serverMode);
      }
    }
  }
    
  // This will go away once Components are handling there own commandlines
  // if we have no command line arguments, we need to heed the
+0 −8
Original line number Diff line number Diff line
@@ -26,7 +26,6 @@ nsNativeAppSupportBase::nsNativeAppSupportBase()
    : mRefCnt( 0 ),
      mSplash( 0 ),
      mServerMode( PR_FALSE ),
      mStartupServerMode( PR_FALSE ),
      mNeedsProfileUI( PR_FALSE ) {
}

@@ -94,13 +93,6 @@ nsNativeAppSupportBase::GetIsServerMode(PRBool *aIsServerMode) {
    return NS_OK;
}

NS_IMETHODIMP
nsNativeAppSupportBase::GetIsStartupServerMode(PRBool *aIsStartupServerMode) {
    NS_ENSURE_ARG( aIsStartupServerMode );
    *aIsStartupServerMode = mStartupServerMode;
    return NS_OK;
}

NS_IMETHODIMP
nsNativeAppSupportBase::GetNeedsProfileUI(PRBool *aNeedsProfileUI) {
    NS_ENSURE_ARG_POINTER(aNeedsProfileUI);
+0 −1
Original line number Diff line number Diff line
@@ -53,7 +53,6 @@ public:
    nsrefcnt mRefCnt;
    nsCOMPtr<nsISplashScreen> mSplash;
    PRBool   mServerMode;
    PRBool   mStartupServerMode;
    PRBool   mNeedsProfileUI;
}; // class nsSplashScreenWin
+1 −1
Original line number Diff line number Diff line
@@ -585,7 +585,7 @@ nsNativeAppSupportWin::CheckConsole() {
                    ||
                    strcmp( "/server", __argv[i] ) == 0 ) {         
            // Start in server mode (and suppress splash screen).   
            mStartupServerMode = PR_TRUE;
            mServerMode = PR_TRUE;
            __argv[i] = "-nosplash"; // Bit of a hack, but it works!
            // Ignore other args.                                   
            break;                                                  
Loading