Verified Commit 5858c308 authored by Pier Angelo Vendrame's avatar Pier Angelo Vendrame 🎃
Browse files

dropme! Partial revert of Bug 13252

I need to modify Bug 9173. So, I am removing a few changes from 13252
to make both the modifications and the rebase easier.
parent 060e2d72
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -4,5 +4,3 @@ ac_add_options --enable-strip

# See bug #41131
ac_add_options --disable-update-agent

ac_add_options --enable-tor-browser-data-outside-app-dir
+1 −22
Original line number Diff line number Diff line
@@ -56,8 +56,6 @@
#  include "nsIPK11Token.h"
#endif

#include "TorFileUtils.h"

#include <stdlib.h>

#ifdef XP_WIN
@@ -1366,13 +1364,7 @@ nsresult nsXREDirProvider::GetUserDataDirectoryHome(nsIFile** aFile,
    return gDataDirHome->Clone(aFile);
  }

#if defined(RELATIVE_PROFILE_DIRECTORY) || \
    defined(TOR_BROWSER_DATA_OUTSIDE_APP_DIR)
#  ifdef TOR_BROWSER_DATA_OUTSIDE_APP_DIR
  rv = GetTorBrowserUserDataDir(getter_AddRefs(localDir));
  NS_ENSURE_SUCCESS(rv, rv);
  rv = localDir->AppendNative("Browser"_ns);
#  else
#if defined(RELATIVE_PROFILE_DIRECTORY)
  RefPtr<nsXREDirProvider> singleton = GetSingleton();
  if (!singleton) {
    return NS_ERROR_OUT_OF_MEMORY;
@@ -1382,7 +1374,6 @@ nsresult nsXREDirProvider::GetUserDataDirectoryHome(nsIFile** aFile,
  nsAutoCString profileDir(RELATIVE_PROFILE_DIRECTORY);
  rv = localDir->SetRelativePath(localDir.get(), profileDir);
  NS_ENSURE_SUCCESS(rv, rv);
#endif
  if (aLocal) {
    rv = localDir->AppendNative("Caches"_ns);
    NS_ENSURE_SUCCESS(rv, rv);
@@ -1530,18 +1521,6 @@ nsresult nsXREDirProvider::GetUserDataDirectory(nsIFile** aFile, bool aLocal) {
  return NS_OK;
}

nsresult nsXREDirProvider::GetTorBrowserUserDataDir(nsIFile** aFile) {
  NS_ENSURE_ARG_POINTER(aFile);
  nsCOMPtr<nsIFile> appRootDir;
  RefPtr<nsXREDirProvider> singleton = GetSingleton();
  if (!singleton) {
    return NS_ERROR_OUT_OF_MEMORY;
  }
  nsresult rv = singleton->GetAppRootDir(getter_AddRefs(appRootDir));
  NS_ENSURE_SUCCESS(rv, rv);
  return TorBrowser_GetUserDataDir(appRootDir, aFile);
}

nsresult nsXREDirProvider::GetAppRootDir(nsIFile** aFile) {
  bool persistent = false;
  nsCOMPtr<nsIFile> file, appRootDir;
+1 −12
Original line number Diff line number Diff line
@@ -27,8 +27,6 @@
#  include <sys/param.h>
#endif

#include "TorFileUtils.h"

// WARNING: These hard coded names need to go away. They need to
// come from localizable resources

@@ -249,8 +247,7 @@ nsresult nsAppFileLocationProvider::GetProductDirectory(nsIFile** aLocalFile,
  bool exists;
  nsCOMPtr<nsIFile> localDir;

#if defined(RELATIVE_PROFILE_DIRECTORY) || \
    defined(TOR_BROWSER_DATA_OUTSIDE_APP_DIR)
#if defined(RELATIVE_PROFILE_DIRECTORY)
  nsCOMPtr<nsIProperties> directoryService(
      do_GetService(NS_DIRECTORY_SERVICE_CONTRACTID, &rv));
  NS_ENSURE_SUCCESS(rv, rv);
@@ -272,18 +269,10 @@ nsresult nsAppFileLocationProvider::GetProductDirectory(nsIFile** aLocalFile,
    file = appRootDir;
  }

#ifdef TOR_BROWSER_DATA_OUTSIDE_APP_DIR
  rv = TorBrowser_GetUserDataDir(appRootDir, getter_AddRefs(localDir));
  NS_ENSURE_SUCCESS(rv, rv);
  rv = localDir->AppendNative("Browser"_ns);
#else
  localDir = appRootDir;
  nsAutoCString profileDir(RELATIVE_PROFILE_DIRECTORY);
  rv = localDir->SetRelativePath(localDir.get(), profileDir);
  NS_ENSURE_SUCCESS(rv, rv);
#endif

  NS_ENSURE_SUCCESS(rv, rv);

  if (aLocal) {
    rv = localDir->AppendNative("Caches"_ns);