From 9136559bb311758beb508a1a91f626ddaa09485b Mon Sep 17 00:00:00 2001 From: Dave Townsend Date: Fri, 21 Sep 2018 16:50:02 +0000 Subject: [PATCH] Bug 1493202: Don't store offline startup state in nsIToolkitProfileService. r=florian Differential Revision: https://phabricator.services.mozilla.com/D6503 --HG-- extra : moz-landing-system : lando --- toolkit/profile/content/profileSelection.js | 5 ++--- toolkit/profile/nsIToolkitProfileService.idl | 1 - toolkit/profile/nsToolkitProfileService.cpp | 18 +----------------- toolkit/xre/nsAppRunner.cpp | 7 +++++-- 4 files changed, 8 insertions(+), 23 deletions(-) diff --git a/toolkit/profile/content/profileSelection.js b/toolkit/profile/content/profileSelection.js index 7a35ec2bb19d..452c757f9081 100644 --- a/toolkit/profile/content/profileSelection.js +++ b/toolkit/profile/content/profileSelection.js @@ -98,6 +98,8 @@ function acceptDialog() { updateStartupPrefs(); gDialogParams.SetInt(0, 1); + /* Bug 257777 */ + gDialogParams.SetInt(1, document.getElementById("offlineState").checked ? 1 : 0); gDialogParams.SetString(0, selectedProfile.profile.name); @@ -113,9 +115,6 @@ function exitDialog() { function updateStartupPrefs() { var autoSelectLastProfile = document.getElementById("autoSelectLastProfile"); gProfileService.startWithLastProfile = autoSelectLastProfile.checked; - - /* Bug 257777 */ - gProfileService.startOffline = document.getElementById("offlineState").checked; } // handle key event on listboxes diff --git a/toolkit/profile/nsIToolkitProfileService.idl b/toolkit/profile/nsIToolkitProfileService.idl index 68cb1f19ffef..69ba1f4827b6 100644 --- a/toolkit/profile/nsIToolkitProfileService.idl +++ b/toolkit/profile/nsIToolkitProfileService.idl @@ -14,7 +14,6 @@ interface nsIProfileLock; interface nsIToolkitProfileService : nsISupports { attribute boolean startWithLastProfile; - attribute boolean startOffline; readonly attribute nsISimpleEnumerator /*nsIToolkitProfile*/ profiles; diff --git a/toolkit/profile/nsToolkitProfileService.cpp b/toolkit/profile/nsToolkitProfileService.cpp index 16de4dbea5d9..463b24048ab8 100644 --- a/toolkit/profile/nsToolkitProfileService.cpp +++ b/toolkit/profile/nsToolkitProfileService.cpp @@ -119,8 +119,7 @@ private: friend nsresult NS_NewToolkitProfileService(nsIToolkitProfileService**); nsToolkitProfileService() : - mStartWithLast(true), - mStartOffline(false) + mStartWithLast(true) { gService = this; } @@ -140,7 +139,6 @@ private: nsCOMPtr mTempData; nsCOMPtr mListFile; bool mStartWithLast; - bool mStartOffline; static nsToolkitProfileService *gService; @@ -573,20 +571,6 @@ nsToolkitProfileService::GetStartWithLastProfile(bool *aResult) return NS_OK; } -NS_IMETHODIMP -nsToolkitProfileService::GetStartOffline(bool *aResult) -{ - *aResult = mStartOffline; - return NS_OK; -} - -NS_IMETHODIMP -nsToolkitProfileService::SetStartOffline(bool aValue) -{ - mStartOffline = aValue; - return NS_OK; -} - NS_IMETHODIMP nsToolkitProfileService::GetProfiles(nsISimpleEnumerator* *aResult) { diff --git a/toolkit/xre/nsAppRunner.cpp b/toolkit/xre/nsAppRunner.cpp index a444b0753a9d..e0c5137db711 100644 --- a/toolkit/xre/nsAppRunner.cpp +++ b/toolkit/xre/nsAppRunner.cpp @@ -2119,6 +2119,7 @@ ShowProfileManager(nsIToolkitProfileService* aProfileSvc, nsCOMPtr profD, profLD; char16_t* profileNamePtr; nsAutoCString profileName; + bool offline = false; { ScopedXPCOMStartup xpcom; @@ -2172,6 +2173,10 @@ ShowProfileManager(nsIToolkitProfileService* aProfileSvc, rv = ioParamBlock->GetInt(0, &dialogConfirmed); if (NS_FAILED(rv) || dialogConfirmed == 0) return NS_ERROR_ABORT; + int32_t startOffline; + rv = ioParamBlock->GetInt(1, &startOffline); + offline = NS_SUCCEEDED(rv) && startOffline == 1; + nsCOMPtr lock; rv = dlgArray->QueryElementAt(0, NS_GET_IID(nsIProfileLock), getter_AddRefs(lock)); @@ -2197,8 +2202,6 @@ ShowProfileManager(nsIToolkitProfileService* aProfileSvc, SaveFileToEnv("XRE_PROFILE_LOCAL_PATH", profLD); SaveWordToEnv("XRE_PROFILE_NAME", profileName); - bool offline = false; - aProfileSvc->GetStartOffline(&offline); if (offline) { SaveToEnv("XRE_START_OFFLINE=1"); }