Bug 1403366 - Remove GetXULRunnerStubPath. r?froydnj
The difference between GetXULRunnerStubPath and XRE_GetBinaryPath was
removed in
bug 552864.
--- 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)) {