Bug 1403366 - Remove GetXULRunnerStubPath. r=froydnj
☠☠ backed out by a208381e377e ☠ ☠
authorMike Hommey <mh+mozilla@glandium.org>
Thu, 28 Sep 2017 10:31:14 +0900
changeset 384309 78f4fbeaac2004bb382c12081673ed363b3ad07c
parent 384308 bc7ca663b817224db4f6afd5ee6eb1a5610bfcee
child 384310 582d112281f929dedd2b15d073738ddf016d58f8
push id52581
push usermh@glandium.org
push dateTue, 03 Oct 2017 22:05:39 +0000
treeherderautoland@aa58d5c8fe1a [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)) {