[tor-commits] [tor-browser/tor-browser-17.0.9esr-1] fixup! Change the default Firefox profile directory to be TBB-relative.

mikeperry at torproject.org mikeperry at torproject.org
Thu Oct 3 01:33:10 UTC 2013


commit f0519e332aa292b6b481dec6f9e6a22640157131
Author: Mike Perry <mikeperry-git at torproject.org>
Date:   Wed Oct 2 18:31:31 2013 -0700

    fixup! Change the default Firefox profile directory to be TBB-relative.
    
    For safety and future-proofing, remove the codepaths that touch empty strings.
---
 toolkit/xre/nsXREDirProvider.cpp |   29 ++---------------------------
 1 file changed, 2 insertions(+), 27 deletions(-)

diff --git a/toolkit/xre/nsXREDirProvider.cpp b/toolkit/xre/nsXREDirProvider.cpp
index 8432cca..aae1e2f 100644
--- a/toolkit/xre/nsXREDirProvider.cpp
+++ b/toolkit/xre/nsXREDirProvider.cpp
@@ -1284,39 +1284,25 @@ nsXREDirProvider::AppendProfilePath(nsIFile* aFile,
   }
 
   nsCAutoString profile;
-  nsCAutoString appName;
-  nsCAutoString vendor;
   if (aProfileName && !aProfileName->IsEmpty()) {
     profile = *aProfileName;
   } else if (gAppData->profile) {
     profile = gAppData->profile;
   }
 
-  nsresult rv;
+  nsresult rv = NS_ERROR_FAILURE;
 
 #if defined (XP_MACOSX)
   if (!profile.IsEmpty()) {
     rv = AppendProfileString(aFile, profile.get());
   }
-  else {
-    // Note that MacOS ignores the vendor when creating the profile hierarchy -
-    // all application preferences directories live alongside one another in
-    // ~/Library/Application Support/
-    rv = aFile->AppendNative(appName);
-  }
   NS_ENSURE_SUCCESS(rv, rv);
 
 #elif defined(XP_WIN) || defined(XP_OS2)
   if (!profile.IsEmpty()) {
     rv = AppendProfileString(aFile, profile.get());
   }
-  else {
-    if (!vendor.IsEmpty()) {
-      rv = aFile->AppendNative(vendor);
-      NS_ENSURE_SUCCESS(rv, rv);
-    }
-    rv = aFile->AppendNative(appName);
-  }
+
   NS_ENSURE_SUCCESS(rv, rv);
 
 #elif defined(ANDROID)
@@ -1349,17 +1335,6 @@ nsXREDirProvider::AppendProfilePath(nsIFile* aFile,
     rv = AppendProfileString(aFile, folder.BeginReading());
   }
   else {
-    if (!vendor.IsEmpty()) {
-      folder.Append(vendor);
-      ToLowerCase(folder);
-
-      rv = aFile->AppendNative(folder);
-      NS_ENSURE_SUCCESS(rv, rv);
-
-      folder.Truncate();
-    }
-
-    folder.Append(appName);
     ToLowerCase(folder);
 
     rv = aFile->AppendNative(folder);



More information about the tor-commits mailing list