From 545306f56c80e07a6a5762ef22de35a697f1e936 Mon Sep 17 00:00:00 2001 From: "blizzard%redhat.com" Date: Fri, 15 Nov 2002 01:47:59 +0000 Subject: [PATCH] Backout checkin for bug #175320. It was causing cookie files to be saved without any entries but still with the standard "This is a generated file!" header. sr=bz --- profile/src/nsProfile.cpp | 23 +++++++---------------- profile/src/nsProfile.h | 2 -- xpfe/bootstrap/nsAppRunner.cpp | 3 ++- 3 files changed, 9 insertions(+), 19 deletions(-) diff --git a/profile/src/nsProfile.cpp b/profile/src/nsProfile.cpp index e7ae40f72902..0d8aea1072c0 100644 --- a/profile/src/nsProfile.cpp +++ b/profile/src/nsProfile.cpp @@ -247,8 +247,6 @@ nsProfile::nsProfile() mIsUILocaleSpecified = PR_FALSE; mIsContentLocaleSpecified = PR_FALSE; - - mShutdownProfileToreDownNetwork = PR_FALSE; } nsProfile::~nsProfile() @@ -1173,7 +1171,6 @@ nsProfile::SetCurrentProfile(const PRUnichar * aCurrentProfile) // Phase 2a: Send the network teardown notification observerService->NotifyObservers(subject, "profile-change-net-teardown", context.get()); - mShutdownProfileToreDownNetwork = PR_TRUE; // Phase 2b: Send the "teardown" notification observerService->NotifyObservers(subject, "profile-change-teardown", context.get()); @@ -1195,7 +1192,12 @@ nsProfile::SetCurrentProfile(const PRUnichar * aCurrentProfile) if (NS_FAILED(rv)) return rv; mCurrentProfileAvailable = PR_TRUE; - if (!isSwitch) + if (isSwitch) + { + // Bring network back online + observerService->NotifyObservers(subject, "profile-change-net-restore", context.get()); + } + else { // Ensure that the prefs service exists so it can respond to // the notifications we're about to send around. It needs to. @@ -1203,13 +1205,6 @@ nsProfile::SetCurrentProfile(const PRUnichar * aCurrentProfile) NS_ASSERTION(NS_SUCCEEDED(rv), "Could not get prefs service"); } - if (mShutdownProfileToreDownNetwork) - { - // Bring network back online - observerService->NotifyObservers(subject, "profile-change-net-restore", context.get()); - mShutdownProfileToreDownNetwork = PR_FALSE; - } -+ // Phase 4: Notify observers that the profile has changed - Here they respond to new profile observerService->NotifyObservers(subject, "profile-do-change", context.get()); @@ -1264,11 +1259,7 @@ NS_IMETHODIMP nsProfile::ShutDownCurrentProfile(PRUint32 shutDownType) if (mProfileChangeVetoed) return NS_OK; - // Phase 2a: Send the network teardown notification - observerService->NotifyObservers(subject, "profile-change-net-teardown", context.get()); - mShutdownProfileToreDownNetwork = PR_TRUE; - - // Phase 2b: Send the "teardown" notification + // Phase 2: Send the "teardown" notification observerService->NotifyObservers(subject, "profile-change-teardown", context.get()); // Phase 3: Notify observers of a profile change diff --git a/profile/src/nsProfile.h b/profile/src/nsProfile.h index 6d172e21175d..18bc65328f29 100644 --- a/profile/src/nsProfile.h +++ b/profile/src/nsProfile.h @@ -102,8 +102,6 @@ private: PRBool mIsContentLocaleSpecified; nsCString mContentLocaleName; - PRBool mShutdownProfileToreDownNetwork; - public: nsProfile(); virtual ~nsProfile(); diff --git a/xpfe/bootstrap/nsAppRunner.cpp b/xpfe/bootstrap/nsAppRunner.cpp index 017a2300bc90..9d23bb4fecf6 100644 --- a/xpfe/bootstrap/nsAppRunner.cpp +++ b/xpfe/bootstrap/nsAppRunner.cpp @@ -875,7 +875,8 @@ static nsresult DoOnShutdown() nsCOMPtr profileMgr(do_GetService(NS_PROFILE_CONTRACTID, &rv)); NS_ASSERTION(NS_SUCCEEDED(rv), "failed to get profile manager, so unable to update last modified time"); if (NS_SUCCEEDED(rv)) { - profileMgr->ShutDownCurrentProfile(nsIProfile::SHUTDOWN_PERSIST); + // 0 is undefined, we use this secret value so that we don't notify + profileMgr->ShutDownCurrentProfile(0); } }