diff --git a/mozilla/toolkit/xre/nsAppRunner.h b/mozilla/toolkit/xre/nsAppRunner.h index d514230b30a..86eeb0e69f4 100644 --- a/mozilla/toolkit/xre/nsAppRunner.h +++ b/mozilla/toolkit/xre/nsAppRunner.h @@ -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; diff --git a/mozilla/toolkit/xre/nsXREDirProvider.cpp b/mozilla/toolkit/xre/nsXREDirProvider.cpp index 999313ebbed..4005d45885d 100644 --- a/mozilla/toolkit/xre/nsXREDirProvider.cpp +++ b/mozilla/toolkit/xre/nsXREDirProvider.cpp @@ -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));