bug 124029 Roaming - 4.x-HTTP-compatible
patch 134896 r=ben.bucksch@beonex.com sr=bz-vacation@mit.edu
This commit is contained in:
Родитель
4a99f1fdc8
Коммит
84a1e5220c
|
@ -37,6 +37,7 @@ SDK_XPIDLSRCS = \
|
||||||
XPIDLSRCS = \
|
XPIDLSRCS = \
|
||||||
nsIProfileInternal.idl \
|
nsIProfileInternal.idl \
|
||||||
nsIProfileStartupListener.idl \
|
nsIProfileStartupListener.idl \
|
||||||
|
nsISessionRoaming.idl \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
ifeq ($(OS_ARCH),WINNT)
|
ifeq ($(OS_ARCH),WINNT)
|
||||||
|
|
|
@ -80,6 +80,7 @@
|
||||||
#include "nsHashtable.h"
|
#include "nsHashtable.h"
|
||||||
#include "nsIAtom.h"
|
#include "nsIAtom.h"
|
||||||
#include "nsProfileDirServiceProvider.h"
|
#include "nsProfileDirServiceProvider.h"
|
||||||
|
#include "nsISessionRoaming.h"
|
||||||
|
|
||||||
// Interfaces Needed
|
// Interfaces Needed
|
||||||
#include "nsIDocShell.h"
|
#include "nsIDocShell.h"
|
||||||
|
@ -156,6 +157,7 @@ static nsProfileDirServiceProvider *gDirServiceProvider = nsnull;
|
||||||
static NS_DEFINE_CID(kPrefMigrationCID, NS_PREFMIGRATION_CID);
|
static NS_DEFINE_CID(kPrefMigrationCID, NS_PREFMIGRATION_CID);
|
||||||
static NS_DEFINE_CID(kPrefConverterCID, NS_PREFCONVERTER_CID);
|
static NS_DEFINE_CID(kPrefConverterCID, NS_PREFCONVERTER_CID);
|
||||||
|
|
||||||
|
#define NS_SESSIONROAMING_CONTRACTID "@mozilla.org/profile/session-roaming;1"
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -1258,6 +1260,13 @@ nsProfile::SetCurrentProfile(const PRUnichar * aCurrentProfile)
|
||||||
return NS_ERROR_ABORT;
|
return NS_ERROR_ABORT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Roaming download
|
||||||
|
// Tolerate errors. Maybe the roaming extension isn't installed.
|
||||||
|
nsCOMPtr <nsISessionRoaming> roam =
|
||||||
|
do_GetService(NS_SESSIONROAMING_CONTRACTID, &rv);
|
||||||
|
if (NS_SUCCEEDED(rv))
|
||||||
|
roam->BeginSession();
|
||||||
|
|
||||||
// Phase 4: Notify observers that the profile has changed - Here they respond to new profile
|
// Phase 4: Notify observers that the profile has changed - Here they respond to new profile
|
||||||
observerService->NotifyObservers(subject, "profile-do-change", context.get());
|
observerService->NotifyObservers(subject, "profile-do-change", context.get());
|
||||||
if (mProfileChangeFailed)
|
if (mProfileChangeFailed)
|
||||||
|
@ -1344,6 +1353,13 @@ NS_IMETHODIMP nsProfile::ShutDownCurrentProfile(PRUint32 shutDownType)
|
||||||
observerService->NotifyObservers(subject, "profile-before-change", context.get());
|
observerService->NotifyObservers(subject, "profile-before-change", context.get());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Roaming upload
|
||||||
|
// Tolerate errors. Maybe the roaming extension isn't installed.
|
||||||
|
nsCOMPtr <nsISessionRoaming> roam =
|
||||||
|
do_GetService(NS_SESSIONROAMING_CONTRACTID, &rv);
|
||||||
|
if (NS_SUCCEEDED(rv))
|
||||||
|
roam->EndSession();
|
||||||
|
|
||||||
gDirServiceProvider->SetProfileDir(nsnull);
|
gDirServiceProvider->SetProfileDir(nsnull);
|
||||||
UpdateCurrentProfileModTime(PR_TRUE);
|
UpdateCurrentProfileModTime(PR_TRUE);
|
||||||
mCurrentProfileAvailable = PR_FALSE;
|
mCurrentProfileAvailable = PR_FALSE;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче