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

This commit is contained in:
blizzard%redhat.com 2002-11-15 01:47:59 +00:00
Родитель e0e945ef10
Коммит 545306f56c
3 изменённых файлов: 9 добавлений и 19 удалений

Просмотреть файл

@ -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

Просмотреть файл

@ -102,8 +102,6 @@ private:
PRBool mIsContentLocaleSpecified;
nsCString mContentLocaleName;
PRBool mShutdownProfileToreDownNetwork;
public:
nsProfile();
virtual ~nsProfile();

Просмотреть файл

@ -875,7 +875,8 @@ static nsresult DoOnShutdown()
nsCOMPtr<nsIProfile> 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);
}
}