Bug 506814 - Get rid of GetPersistentDescriptor. r=josh
authorDrew Willcoxon <adw@mozilla.com>
Tue, 10 Nov 2009 20:46:16 +0100
changeset 34741 5372b453a52ea3f065b17a707bfb50d61bd7f818
parent 34740 f0f48d5f535a708ae3dd3845e4f566542d6145c7
child 34742 f746608c865531707300f904589de9526437d3af
push id10219
push userdgottwald@mozilla.com
push dateTue, 10 Nov 2009 19:46:57 +0000
treeherdermozilla-central@5372b453a52e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjosh
bugs506814
milestone1.9.3a1pre
Bug 506814 - Get rid of GetPersistentDescriptor. r=josh
xpcom/io/nsLocalFileOSX.mm
--- a/xpcom/io/nsLocalFileOSX.mm
+++ b/xpcom/io/nsLocalFileOSX.mm
@@ -1445,41 +1445,17 @@ NS_IMETHODIMP nsLocalFile::AppendRelativ
       ++nodeEnd;
     nodeBegin = nodeEnd;
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP nsLocalFile::GetPersistentDescriptor(nsACString& aPersistentDescriptor)
 {
-  NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
-
-  FSRef fsRef;
-  nsresult rv = GetFSRefInternal(fsRef);
-  if (NS_FAILED(rv))
-    return rv;
-    
-  AliasHandle aliasH;
-  OSErr err = ::FSNewAlias(nsnull, &fsRef, &aliasH);
-  if (err != noErr)
-    return MacErrorMapper(err);
-    
-   PRUint32 bytes = ::GetHandleSize((Handle) aliasH);
-   ::HLock((Handle) aliasH);
-   // Passing nsnull for dest makes NULL-term string
-   char* buf = PL_Base64Encode((const char*)*aliasH, bytes, nsnull);
-   ::DisposeHandle((Handle) aliasH);
-   NS_ENSURE_TRUE(buf, NS_ERROR_OUT_OF_MEMORY);
-   
-   aPersistentDescriptor = buf;
-   PR_Free(buf);
-
-  return NS_OK;
-
-  NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
+  return GetNativePath(aPersistentDescriptor);
 }
 
 NS_IMETHODIMP nsLocalFile::SetPersistentDescriptor(const nsACString& aPersistentDescriptor)
 {
   NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
 
   if (aPersistentDescriptor.IsEmpty())
     return NS_ERROR_INVALID_ARG;