diff --git a/dom/system/OSFileConstants.cpp b/dom/system/OSFileConstants.cpp index c807c34b6e4d..327440c17ec5 100644 --- a/dom/system/OSFileConstants.cpp +++ b/dom/system/OSFileConstants.cpp @@ -102,48 +102,14 @@ OSFileConstantsService::Paths * The name of the directory holding all the libraries (libxpcom, libnss, etc.) */ nsString libDir; - nsString tmpDir; nsString profileDir; nsString localProfileDir; - /** - * The user's home directory - */ - nsString homeDir; - /** - * The user's 'application data' directory. - * Windows: - * HOME = Documents and Settings\$USER\Application Data - * UAppData = $HOME[\$vendor]\$name - * - * Unix: - * HOME = ~ - * UAppData = $HOME/.[$vendor/]$name - * - * Mac: - * HOME = ~ - * UAppData = $HOME/Library/Application Support/$name - */ - nsString userApplicationDataDir; - -#if defined(XP_MACOSX) - /** - * The user's Library directory. - */ - nsString macUserLibDir; -#endif // defined(XP_MACOSX) Paths() { libDir.SetIsVoid(true); - tmpDir.SetIsVoid(true); profileDir.SetIsVoid(true); localProfileDir.SetIsVoid(true); - homeDir.SetIsVoid(true); - userApplicationDataDir.SetIsVoid(true); - -#if defined(XP_MACOSX) - macUserLibDir.SetIsVoid(true); -#endif // defined(XP_MACOSX) } }; @@ -251,17 +217,6 @@ OSFileConstantsService::InitOSFileConstants() } } - // For other directories, ignore errors (they may be undefined on - // some platforms or in non-Firefox embeddings of Gecko). - - GetPathToSpecialDir(NS_OS_TEMP_DIR, paths->tmpDir); - GetPathToSpecialDir(NS_OS_HOME_DIR, paths->homeDir); - GetPathToSpecialDir(XRE_USER_APP_DATA_DIR, paths->userApplicationDataDir); - -#if defined(XP_MACOSX) - GetPathToSpecialDir(NS_MAC_USER_LIB_DIR, paths->macUserLibDir); -#endif // defined(XP_MACOSX) - mPaths = std::move(paths); // Get the umask from the system-info service. @@ -919,10 +874,6 @@ OSFileConstantsService::DefineOSFileConstants(JSContext* aCx, return false; } - if (!SetStringProperty(aCx, objPath, "tmpDir", mPaths->tmpDir)) { - return false; - } - // Configure profileDir only if it is available at this stage if (!mPaths->profileDir.IsVoid() && !SetStringProperty(aCx, objPath, "profileDir", mPaths->profileDir)) { @@ -935,20 +886,6 @@ OSFileConstantsService::DefineOSFileConstants(JSContext* aCx, return false; } - if (!SetStringProperty(aCx, objPath, "homeDir", mPaths->homeDir)) { - return false; - } - - if (!SetStringProperty(aCx, objPath, "userApplicationDataDir", mPaths->userApplicationDataDir)) { - return false; - } - -#if defined(XP_MACOSX) - if (!SetStringProperty(aCx, objPath, "macUserLibDir", mPaths->macUserLibDir)) { - return false; - } -#endif // defined(XP_MACOSX) - // sqlite3 is linked from different places depending on the platform nsAutoString libsqlite3; #if defined(ANDROID) diff --git a/toolkit/components/osfile/modules/osfile_async_front.jsm b/toolkit/components/osfile/modules/osfile_async_front.jsm index 505a4b9f1e68..f5051fe321bd 100644 --- a/toolkit/components/osfile/modules/osfile_async_front.jsm +++ b/toolkit/components/osfile/modules/osfile_async_front.jsm @@ -86,6 +86,9 @@ for (let [constProp, dirKey] of [ ["winAppDataDir", "AppData"], ["winLocalAppDataDir", "LocalAppData"], ["winStartMenuProgsDir", "Progs"], + ["tmpDir", "TmpD"], + ["homeDir", "Home"], + ["macUserLibDir", "ULibDir"], ]) { if (constProp in SharedAll.Constants.Path) {