Get rid of FSRef usage in XRE_GetBinaryPath. Also resolve cached paths when initializing from CFURL sources. b=506812 r=vlad
☠☠ backed out by 0e01045dad63 ☠ ☠
authorJosh Aas <joshmoz@gmail.com>
Fri, 13 Nov 2009 05:24:41 -0500
changeset 34819 88b83c564d3c885e4b66deb3f0212f528f4dc0a3
parent 34818 6cf81d2d5d756fe6f7f1f4a16b011b387917028c
child 34820 0e01045dad63c3f3ff36f268fdfa44c29ffbe956
push id10279
push userjosh@mozilla.com
push dateFri, 13 Nov 2009 10:24:57 +0000
treeherdermozilla-central@88b83c564d3c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersvlad
bugs506812
milestone1.9.3a1pre
Get rid of FSRef usage in XRE_GetBinaryPath. Also resolve cached paths when initializing from CFURL sources. b=506812 r=vlad
toolkit/xre/nsAppRunner.cpp
xpcom/io/nsLocalFileOSX.mm
--- a/toolkit/xre/nsAppRunner.cpp
+++ b/toolkit/xre/nsAppRunner.cpp
@@ -1448,23 +1448,17 @@ XRE_GetBinaryPath(const char* argv0, nsI
   CFBundleRef appBundle = CFBundleGetMainBundle();
   if (!appBundle)
     return NS_ERROR_FAILURE;
 
   CFURLRef bundleURL = CFBundleCopyExecutableURL(appBundle);
   if (!bundleURL)
     return NS_ERROR_FAILURE;
 
-  FSRef fileRef;
-  if (!CFURLGetFSRef(bundleURL, &fileRef)) {
-    CFRelease(bundleURL);
-    return NS_ERROR_FAILURE;
-  }
-
-  rv = lfm->InitWithFSRef(&fileRef);
+  rv = lfm->InitWithCFURL(bundleURL);
   CFRelease(bundleURL);
 
   if (NS_FAILED(rv))
     return rv;
 
 #elif defined(XP_UNIX)
   struct stat fileStat;
   char exePath[MAXPATHLEN];
--- a/xpcom/io/nsLocalFileOSX.mm
+++ b/xpcom/io/nsLocalFileOSX.mm
@@ -1931,17 +1931,17 @@ nsresult nsLocalFile::SetBaseURL(CFURLRe
 
   NS_ENSURE_ARG(aCFURLRef);
 
   ::CFRetain(aCFURLRef);
   if (mBaseURL)
     ::CFRelease(mBaseURL);
   mBaseURL = aCFURLRef;
 
-  if (!::CFURLGetFileSystemRepresentation(mBaseURL, NO, (UInt8*)mPath, PATH_MAX))
+  if (!::CFURLGetFileSystemRepresentation(mBaseURL, true, (UInt8*)mPath, PATH_MAX))
     return NS_ERROR_FAILURE;
 
   return NS_OK;
 
   NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
 }
 
 nsresult nsLocalFile::GetFSRefInternal(FSRef& aFSRef)