diff --git a/toolkit/xre/nsXREDirProvider.cpp b/toolkit/xre/nsXREDirProvider.cpp index 2ac76686d630..d90887964bbd 100644 --- a/toolkit/xre/nsXREDirProvider.cpp +++ b/toolkit/xre/nsXREDirProvider.cpp @@ -298,11 +298,7 @@ nsXREDirProvider::GetFile(const char* aProperty, bool* aPersistent, rv = NS_ERROR_FAILURE; nsCOMPtr file; - if (!strcmp(aProperty, NS_APP_PROFILE_DEFAULTS_50_DIR) || - !strcmp(aProperty, NS_APP_PROFILE_DEFAULTS_NLOC_50_DIR)) { - return GetProfileDefaultsDir(aFile); - } - else if (!strcmp(aProperty, NS_APP_PREF_DEFAULTS_50_DIR)) + if (!strcmp(aProperty, NS_APP_PREF_DEFAULTS_50_DIR)) { // return the GRE default prefs directory here, and the app default prefs // directory (if applicable) in NS_APP_PREFS_DEFAULTS_DIR_LIST. @@ -433,13 +429,11 @@ nsXREDirProvider::GetFile(const char* aProperty, bool* aPersistent, } else { rv = file->AppendNative(NS_LITERAL_CSTRING("localstore.rdf")); - EnsureProfileFileExists(file); ensureFilePermissions = true; } } else if (!strcmp(aProperty, NS_APP_USER_MIMETYPES_50_FILE)) { rv = file->AppendNative(NS_LITERAL_CSTRING("mimeTypes.rdf")); - EnsureProfileFileExists(file); ensureFilePermissions = true; } else if (!strcmp(aProperty, NS_APP_DOWNLOADS_50_FILE)) { @@ -1446,51 +1440,6 @@ nsXREDirProvider::EnsureDirectoryExists(nsIFile* aDirectory) return rv; } -void -nsXREDirProvider::EnsureProfileFileExists(nsIFile *aFile) -{ - nsresult rv; - bool exists; - - rv = aFile->Exists(&exists); - if (NS_FAILED(rv) || exists) return; - - nsAutoCString leafName; - rv = aFile->GetNativeLeafName(leafName); - if (NS_FAILED(rv)) return; - - nsCOMPtr defaultsFile; - rv = GetProfileDefaultsDir(getter_AddRefs(defaultsFile)); - if (NS_FAILED(rv)) return; - - rv = defaultsFile->AppendNative(leafName); - if (NS_FAILED(rv)) return; - - defaultsFile->CopyToNative(mProfileDir, EmptyCString()); -} - -nsresult -nsXREDirProvider::GetProfileDefaultsDir(nsIFile* *aResult) -{ - NS_ASSERTION(mGREDir, "nsXREDirProvider not initialized."); - NS_PRECONDITION(aResult, "Null out-param"); - - nsresult rv; - nsCOMPtr defaultsDir; - - rv = GetAppDir()->Clone(getter_AddRefs(defaultsDir)); - NS_ENSURE_SUCCESS(rv, rv); - - rv = defaultsDir->AppendNative(NS_LITERAL_CSTRING("defaults")); - NS_ENSURE_SUCCESS(rv, rv); - - rv = defaultsDir->AppendNative(NS_LITERAL_CSTRING("profile")); - NS_ENSURE_SUCCESS(rv, rv); - - defaultsDir.forget(aResult); - return NS_OK; -} - nsresult nsXREDirProvider::AppendSysUserExtensionPath(nsIFile* aFile) { diff --git a/toolkit/xre/nsXREDirProvider.h b/toolkit/xre/nsXREDirProvider.h index eb27ed27fc26..1190cc708171 100644 --- a/toolkit/xre/nsXREDirProvider.h +++ b/toolkit/xre/nsXREDirProvider.h @@ -54,8 +54,6 @@ public: void DoShutdown(); - nsresult GetProfileDefaultsDir(nsIFile* *aResult); - static nsresult GetUserAppDataDirectory(nsIFile* *aFile) { return GetUserDataDirectory(aFile, false, nullptr, nullptr, nullptr); } @@ -108,7 +106,6 @@ protected: static nsresult GetSystemExtensionsDirectory(nsIFile** aFile); #endif static nsresult EnsureDirectoryExists(nsIFile* aDirectory); - void EnsureProfileFileExists(nsIFile* aFile); // Determine the profile path within the UAppData directory. This is different // on every major platform. diff --git a/xpcom/io/nsAppDirectoryServiceDefs.h b/xpcom/io/nsAppDirectoryServiceDefs.h index 4eb39bdf681f..3242812670f6 100644 --- a/xpcom/io/nsAppDirectoryServiceDefs.h +++ b/xpcom/io/nsAppDirectoryServiceDefs.h @@ -31,11 +31,6 @@ #define NS_APP_DEFAULTS_50_DIR "DefRt" // The root dir of all defaults dirs #define NS_APP_PREF_DEFAULTS_50_DIR "PrfDef" -#define NS_APP_PROFILE_DEFAULTS_50_DIR "profDef" // The profile defaults of the "current" - // locale. Should be first choice. -#define NS_APP_PROFILE_DEFAULTS_NLOC_50_DIR "ProfDefNoLoc" // The profile defaults of the "default" - // installed locale. Second choice - // when above is not available. #define NS_APP_USER_PROFILES_ROOT_DIR "DefProfRt" // The dir where user profile dirs live. #define NS_APP_USER_PROFILES_LOCAL_ROOT_DIR "DefProfLRt" // The dir where user profile temp dirs live. diff --git a/xpcom/io/nsAppFileLocationProvider.cpp b/xpcom/io/nsAppFileLocationProvider.cpp index 1211c39be853..bf01fd366b93 100644 --- a/xpcom/io/nsAppFileLocationProvider.cpp +++ b/xpcom/io/nsAppFileLocationProvider.cpp @@ -58,7 +58,6 @@ #define DEFAULTS_DIR_NAME NS_LITERAL_CSTRING("defaults") #define DEFAULTS_PREF_DIR_NAME NS_LITERAL_CSTRING("pref") -#define DEFAULTS_PROFILE_DIR_NAME NS_LITERAL_CSTRING("profile") #define RES_DIR_NAME NS_LITERAL_CSTRING("res") #define CHROME_DIR_NAME NS_LITERAL_CSTRING("chrome") #define PLUGINS_DIR_NAME NS_LITERAL_CSTRING("plugins") @@ -123,15 +122,6 @@ nsAppFileLocationProvider::GetFile(const char* aProp, bool* aPersistent, rv = localFile->AppendRelativeNativePath(DEFAULTS_PREF_DIR_NAME); } } - } else if (nsCRT::strcmp(aProp, NS_APP_PROFILE_DEFAULTS_50_DIR) == 0 || - nsCRT::strcmp(aProp, NS_APP_PROFILE_DEFAULTS_NLOC_50_DIR) == 0) { - rv = CloneMozBinDirectory(getter_AddRefs(localFile)); - if (NS_SUCCEEDED(rv)) { - rv = localFile->AppendRelativeNativePath(DEFAULTS_DIR_NAME); - if (NS_SUCCEEDED(rv)) { - rv = localFile->AppendRelativeNativePath(DEFAULTS_PROFILE_DIR_NAME); - } - } } else if (nsCRT::strcmp(aProp, NS_APP_USER_PROFILES_ROOT_DIR) == 0) { rv = GetDefaultUserProfileRoot(getter_AddRefs(localFile)); } else if (nsCRT::strcmp(aProp, NS_APP_USER_PROFILES_LOCAL_ROOT_DIR) == 0) {