From 64c93bc1357df0d92587a5658bc56ca2b60bc6b7 Mon Sep 17 00:00:00 2001 From: "blakeross%telocity.com" Date: Fri, 17 Aug 2001 00:25:04 +0000 Subject: [PATCH] Cleaner fix for making turbo mode dynamic (89504). r=ccarlen sr=ben --- xpfe/appshell/public/nsINativeAppSupport.idl | 6 +----- xpfe/bootstrap/nsAppRunner.cpp | 9 ++++++--- xpfe/bootstrap/nsNativeAppSupportBase.cpp | 8 -------- xpfe/bootstrap/nsNativeAppSupportBase.h | 1 - xpfe/bootstrap/nsNativeAppSupportWin.cpp | 2 +- xpfe/components/startup/public/nsINativeAppSupport.idl | 6 +----- 6 files changed, 9 insertions(+), 23 deletions(-) diff --git a/xpfe/appshell/public/nsINativeAppSupport.idl b/xpfe/appshell/public/nsINativeAppSupport.idl index 3c0c24334336..d010590ccfaa 100644 --- a/xpfe/appshell/public/nsINativeAppSupport.idl +++ b/xpfe/appshell/public/nsINativeAppSupport.idl @@ -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; }; diff --git a/xpfe/bootstrap/nsAppRunner.cpp b/xpfe/bootstrap/nsAppRunner.cpp index 6d2ecd9eba88..d57b05327624 100644 --- a/xpfe/bootstrap/nsAppRunner.cpp +++ b/xpfe/bootstrap/nsAppRunner.cpp @@ -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,8 +1275,11 @@ static nsresult main1(int argc, char* argv[], nsISupports *nativeApp ) nsCOMPtr prefs(do_GetService(NS_PREF_CONTRACTID, &rv)); if (NS_SUCCEEDED(rv) && prefs) { PRBool serverMode = PR_FALSE; - prefs->GetBoolPref(TURBO_PREF, &serverMode); - nativeApps->SetIsServerMode(serverMode); + nativeApps->GetIsServerMode(&serverMode); + if (!serverMode) { // okay, so it's not -turbo + prefs->GetBoolPref(TURBO_PREF, &serverMode); + nativeApps->SetIsServerMode(serverMode); + } } } diff --git a/xpfe/bootstrap/nsNativeAppSupportBase.cpp b/xpfe/bootstrap/nsNativeAppSupportBase.cpp index f295e59e271b..31869e51a3bc 100644 --- a/xpfe/bootstrap/nsNativeAppSupportBase.cpp +++ b/xpfe/bootstrap/nsNativeAppSupportBase.cpp @@ -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); diff --git a/xpfe/bootstrap/nsNativeAppSupportBase.h b/xpfe/bootstrap/nsNativeAppSupportBase.h index b4bf1b7a422f..bd05c7ac7fd9 100644 --- a/xpfe/bootstrap/nsNativeAppSupportBase.h +++ b/xpfe/bootstrap/nsNativeAppSupportBase.h @@ -53,7 +53,6 @@ public: nsrefcnt mRefCnt; nsCOMPtr mSplash; PRBool mServerMode; - PRBool mStartupServerMode; PRBool mNeedsProfileUI; }; // class nsSplashScreenWin diff --git a/xpfe/bootstrap/nsNativeAppSupportWin.cpp b/xpfe/bootstrap/nsNativeAppSupportWin.cpp index 74b944938a84..24863fad30cb 100644 --- a/xpfe/bootstrap/nsNativeAppSupportWin.cpp +++ b/xpfe/bootstrap/nsNativeAppSupportWin.cpp @@ -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; diff --git a/xpfe/components/startup/public/nsINativeAppSupport.idl b/xpfe/components/startup/public/nsINativeAppSupport.idl index 3c0c24334336..d010590ccfaa 100644 --- a/xpfe/components/startup/public/nsINativeAppSupport.idl +++ b/xpfe/components/startup/public/nsINativeAppSupport.idl @@ -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; };