Bug 1403366 - Remove GetXULRunnerStubPath. r?froydnj draft
authorMike Hommey <mh+mozilla@glandium.org>
Thu, 28 Sep 2017 10:31:14 +0900
changeset 674063 a2f9d45c2d3bccb64e5174e5858668e41e551614
parent 674062 8645ba5f445fe393242e8d640655b211a8eaa845
child 674064 5fdcd7c4abb417292a6f7f51a0d04d1c3c74c0ff
push id82722
push userbmo:mh+mozilla@glandium.org
push dateTue, 03 Oct 2017 06:57:08 +0000
reviewersfroydnj
bugs1403366, 552864
milestone58.0a1
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)) {