Bug 303279 - Use "special" localstore when in safe mode, r=mconnor+darin

This commit is contained in:
bsmedberg%covad.net 2005-09-07 17:31:00 +00:00
parent fc2c9e5234
commit 4e83816dae
2 changed files with 17 additions and 2 deletions

View File

@ -60,6 +60,11 @@
// this key will not be available.
#define NS_APP_PROFILE_DIR_STARTUP "ProfDS"
// This directory service key is a lot like NS_APP_LOCALSTORE_50_FILE,
// but it is always the "main" localstore file, even when we're in safe mode
// and we load localstore from somewhere else.
#define NS_LOCALSTORE_UNSAFE_FILE "LStoreS"
class nsACString;
struct nsXREAppData;
struct nsStaticModuleInfo;

View File

@ -262,10 +262,20 @@ nsXREDirProvider::GetFile(const char* aProperty, PRBool* aPersistent,
rv = mProfileDir->Clone(getter_AddRefs(file));
rv |= file->AppendNative(NS_LITERAL_CSTRING("prefs.js"));
}
else if (!strcmp(aProperty, NS_APP_LOCALSTORE_50_FILE)) {
else if (!strcmp(aProperty, NS_LOCALSTORE_UNSAFE_FILE)) {
rv = mProfileDir->Clone(getter_AddRefs(file));
rv |= file->AppendNative(NS_LITERAL_CSTRING("localstore.rdf"));
EnsureProfileFileExists(file);
}
else if (!strcmp(aProperty, NS_APP_LOCALSTORE_50_FILE)) {
rv = mProfileDir->Clone(getter_AddRefs(file));
if (gSafeMode) {
rv |= file->AppendNative(NS_LITERAL_CSTRING("localstore-safe.rdf"));
file->Remove(PR_FALSE);
}
else {
rv |= file->AppendNative(NS_LITERAL_CSTRING("localstore.rdf"));
EnsureProfileFileExists(file);
}
}
else if (!strcmp(aProperty, NS_APP_HISTORY_50_FILE)) {
rv = mProfileDir->Clone(getter_AddRefs(file));