Bug 1403366 - Remove GetXULRunnerStubPath. r=froydnj
authorMike Hommey <mh+mozilla@glandium.org>
Thu, 28 Sep 2017 10:31:14 +0900
changeset 384594 3b49525269b130fc688913e76e5c14193d06b26b
parent 384593 d6dc8ba8b0762681e7c0ed4005ca5a194d48b325
child 384595 7e9878e20731fa40ef525aee84db1d62fe925e09
push id32631
push userarchaeopteryx@coole-files.de
push dateThu, 05 Oct 2017 08:51:33 +0000
treeherdermozilla-central@66042a706980 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1403366, 552864
milestone58.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1403366 - Remove GetXULRunnerStubPath. r=froydnj The difference between GetXULRunnerStubPath and XRE_GetBinaryPath was removed in bug 552864.
toolkit/xre/nsUpdateDriver.cpp
--- a/toolkit/xre/nsUpdateDriver.cpp
+++ b/toolkit/xre/nsUpdateDriver.cpp
@@ -156,45 +156,16 @@ GetInstallDirPath(nsIFile *appDir, nsACS
   rv = appDir->GetNativePath(installDirPath);
 #endif
   if (NS_FAILED(rv)) {
     return rv;
   }
   return NS_OK;
 }
 
-#if defined(XP_MACOSX)
-// This is a copy of OS X's XRE_GetBinaryPath from nsAppRunner.cpp with the
-// gBinaryPath check removed so that the updater can reload the stub executable
-// instead of xulrunner-bin. See bug 349737.
-static nsresult
-GetXULRunnerStubPath(const char* argv0, nsIFile* *aResult)
-{
-  // Works even if we're not bundled.
-  CFBundleRef appBundle = ::CFBundleGetMainBundle();
-  if (!appBundle)
-    return NS_ERROR_FAILURE;
-
-  CFURLRef bundleURL = ::CFBundleCopyExecutableURL(appBundle);
-  if (!bundleURL)
-    return NS_ERROR_FAILURE;
-
-  nsCOMPtr<nsILocalFileMac> lfm;
-  nsresult rv = NS_NewLocalFileWithCFURL(bundleURL, true, getter_AddRefs(lfm));
-
-  ::CFRelease(bundleURL);
-
-  if (NS_FAILED(rv))
-    return rv;
-
-  lfm.forget(aResult);
-  return NS_OK;
-}
-#endif /* XP_MACOSX */
-
 static bool
 GetFile(nsIFile* dir, const nsACString& name, nsCOMPtr<nsIFile>& result)
 {
   nsresult rv;
 
   nsCOMPtr<nsIFile> file;
   rv = dir->Clone(getter_AddRefs(file));
   if (NS_FAILED(rv))
@@ -532,23 +503,17 @@ ApplyUpdate(nsIFile *greDir, nsIFile *up
     rv = GetCurrentWorkingDir(workingDirPath, sizeof(workingDirPath));
     if (NS_FAILED(rv)) {
       return;
     }
 
     // Get the application file path used by the updater to restart the
     // application after the update has finished.
     nsCOMPtr<nsIFile> appFile;
-#if defined(XP_MACOSX)
-    // On OS X we need to pass the location of the xulrunner-stub executable
-    // rather than xulrunner-bin. See bug 349737.
-    GetXULRunnerStubPath(appArgv[0], getter_AddRefs(appFile));
-#else
     XRE_GetBinaryPath(appArgv[0], getter_AddRefs(appFile));
-#endif
     if (!appFile) {
       return;
     }
 
 #if defined(XP_WIN)
     nsAutoString appFilePathW;
     rv = appFile->GetPath(appFilePathW);
     if (NS_FAILED(rv)) {