[tbb-commits] [tor-browser/tor-browser-45.2.0esr-6.0-1] fixup! Bug 13252 - Do not store data in the app bundle

gk at torproject.org gk at torproject.org
Fri Jul 15 13:00:34 UTC 2016


commit 3cf0ed64dc038b41605bf6c9d5e59bdeddb9e9bc
Author: Kathy Brade <brade at pearlcrescent.com>
Date:   Wed Jun 22 15:58:14 2016 -0400

    fixup! Bug 13252 - Do not store data in the app bundle
    
    Avoid compilation errors when MOZ_UPDATER is not defined.
    Fixes bug 19484.
---
 toolkit/xre/nsAppRunner.cpp | 27 ++++++++++++++++++---------
 1 file changed, 18 insertions(+), 9 deletions(-)

diff --git a/toolkit/xre/nsAppRunner.cpp b/toolkit/xre/nsAppRunner.cpp
index 67bb2d3..1426d77 100644
--- a/toolkit/xre/nsAppRunner.cpp
+++ b/toolkit/xre/nsAppRunner.cpp
@@ -2712,7 +2712,10 @@ static bool gDoProfileReset = false;
 // 6) display the profile-manager UI
 static nsresult
 SelectProfile(nsIProfileLock* *aResult, nsIToolkitProfileService* aProfileSvc,
-              nsIFile *aAppDir, nsINativeAppSupport* aNative,
+#ifdef TOR_BROWSER_DATA_OUTSIDE_APP_DIR
+              nsIFile *aAppDir,
+#endif
+              nsINativeAppSupport* aNative,
               bool* aStartOffline, nsACString* aProfileName)
 {
   StartupTimeline::Record(StartupTimeline::SELECT_PROFILE);
@@ -4303,10 +4306,19 @@ XREMain::XRE_mainStartup(bool* aExitFlag)
   }
 #endif
 
+#if (defined(MOZ_UPDATER) && !defined(MOZ_WIDGET_ANDROID)) || defined(TOR_BROWSER_DATA_OUTSIDE_APP_DIR)
+  nsCOMPtr<nsIFile> exeFile, exeDir;
+  bool persistent;
+  rv = mDirProvider.GetFile(XRE_EXECUTABLE_FILE, &persistent,
+                            getter_AddRefs(exeFile));
+  NS_ENSURE_SUCCESS(rv, 1);
+  rv = exeFile->GetParent(getter_AddRefs(exeDir));
+  NS_ENSURE_SUCCESS(rv, 1);
+#endif
+
 #if defined(MOZ_UPDATER) && !defined(MOZ_WIDGET_ANDROID)
   // Check for and process any available updates
   nsCOMPtr<nsIFile> updRoot;
-  bool persistent;
   rv = mDirProvider.GetFile(XRE_UPDATE_ROOT_DIR, &persistent,
                             getter_AddRefs(updRoot));
   // XRE_UPDATE_ROOT_DIR may fail. Fallback to appDir if failed
@@ -4341,12 +4353,6 @@ XREMain::XRE_mainStartup(bool* aExitFlag)
   if (CheckArg("test-process-updates")) {
     SaveToEnv("MOZ_TEST_PROCESS_UPDATES=1");
   }
-  nsCOMPtr<nsIFile> exeFile, exeDir;
-  rv = mDirProvider.GetFile(XRE_EXECUTABLE_FILE, &persistent,
-                            getter_AddRefs(exeFile));
-  NS_ENSURE_SUCCESS(rv, 1);
-  rv = exeFile->GetParent(getter_AddRefs(exeDir));
-  NS_ENSURE_SUCCESS(rv, 1);
 #ifdef TOR_BROWSER_UPDATE
   nsAutoCString compatVersion(TOR_BROWSER_VERSION);
 #endif
@@ -4395,7 +4401,10 @@ XREMain::XRE_mainStartup(bool* aExitFlag)
     return 1;
   }
 
-  rv = SelectProfile(getter_AddRefs(mProfileLock), mProfileSvc, exeDir,
+  rv = SelectProfile(getter_AddRefs(mProfileLock), mProfileSvc,
+#ifdef TOR_BROWSER_DATA_OUTSIDE_APP_DIR
+                     exeDir,
+#endif
                      mNativeApp, &mStartOffline, &mProfileName);
   if (rv == NS_ERROR_LAUNCHED_CHILD_PROCESS ||
       rv == NS_ERROR_ABORT) {



More information about the tbb-commits mailing list