Minor Mac OS X fs code cleanup, mostly change some member variable names. b=487045 r/sr=roc
authorJosh Aas <joshmoz@gmail.com>
Thu, 09 Apr 2009 20:46:49 -0400
changeset 27146 71f2a7fd20980dd8de730c08d0079f21643f78ca
parent 27145 c88e42c8297094cf3ae86ad073c8b6833aadced1
child 27147 ba5eda04971c91b5c48be241a0126dff75226bb8
push id6406
push userjosh@mozilla.com
push dateFri, 10 Apr 2009 00:55:01 +0000
treeherdermozilla-central@adf251480d63 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs487045
milestone1.9.2a1pre
Minor Mac OS X fs code cleanup, mostly change some member variable names. b=487045 r/sr=roc
configure.in
xpcom/io/nsLocalFileOSX.h
xpcom/io/nsLocalFileOSX.mm
--- a/configure.in
+++ b/configure.in
@@ -1827,18 +1827,16 @@ case "$target" in
     _PLATFORM_DEFAULT_TOOLKIT='cairo-cocoa'
     MOZ_ENABLE_POSTSCRIPT=
     TARGET_NSPR_MDCPUCFG='\"md/_darwin.cfg\"'
     LDFLAGS="$LDFLAGS -framework Cocoa"
     # The ExceptionHandling framework is needed for Objective-C exception
     # logging code in nsObjCExceptions.h. Currently we only use that in debug
     # builds.
     MOZ_DEBUG_LDFLAGS="$MOZ_DEBUG_LDFLAGS -framework ExceptionHandling"
-    # set MACOSX to generate lib/mac/MoreFiles/Makefile
-    MACOSX=1
 
     dnl DTrace and -dead_strip don't interact well. See bug 403132.
     dnl ===================================================================
     if test "x$enable_dtrace" = "xyes"; then
         echo "Skipping -dead_strip because DTrace is enabled. See bug 403132."
     else
         dnl check for the presence of the -dead_strip linker flag
         AC_MSG_CHECKING([for -dead_strip option to ld])
--- a/xpcom/io/nsLocalFileOSX.h
+++ b/xpcom/io/nsLocalFileOSX.h
@@ -92,16 +92,16 @@ protected:
                         const nsAString& newName,
                         PRBool followLinks);
 
   static PRInt64  HFSPlustoNSPRTime(const UTCDateTime& utcTime);
   static void     NSPRtoHFSPlusTime(PRInt64 nsprTime, UTCDateTime& utcTime);
   static nsresult CFStringReftoUTF8(CFStringRef aInStrRef, nsACString& aOutStr);
 
 protected:
-  CFURLRef mBaseRef;   // The FS object we represent
-  CFURLRef mTargetRef; // If mBaseRef is an alias, its target
+  CFURLRef mBaseURL;   // The FS object we represent
+  CFURLRef mTargetURL; // If mBaseURL is an alias/symlink, its target
 
   PRPackedBool mFollowLinks;
   PRPackedBool mFollowLinksDirty;
 };
 
 #endif // nsLocalFileMac_h_
--- a/xpcom/io/nsLocalFileOSX.mm
+++ b/xpcom/io/nsLocalFileOSX.mm
@@ -61,19 +61,19 @@
 
 #include <Carbon/Carbon.h>
 #import <Cocoa/Cocoa.h>
 
 #include <unistd.h>
 #include <sys/stat.h>
 #include <stdlib.h>
 
-#define CHECK_mBaseRef()                        \
+#define CHECK_mBaseURL()                        \
     PR_BEGIN_MACRO                              \
-        if (!mBaseRef)                          \
+        if (!mBaseURL)                          \
             return NS_ERROR_NOT_INITIALIZED;    \
     PR_END_MACRO
 
 static nsresult MacErrorMapper(OSErr inErr);
 static void CopyUTF8toUTF16NFC(const nsACString& aSrc, nsAString& aResult);
 
 #pragma mark -
 #pragma mark [FSRef operator==]
@@ -287,48 +287,48 @@ const char kPathSepChar = '/';
 // The NSPR epoch is Jan. 1, 1970 GMT
 // 2082844800 is the difference in seconds between those dates
 const PRInt64 kJanuaryFirst1970Seconds = 2082844800LL;
 
 #pragma mark -
 #pragma mark [CTORs/DTOR]
 
 nsLocalFile::nsLocalFile() :
-  mBaseRef(nsnull),
-  mTargetRef(nsnull),
+  mBaseURL(nsnull),
+  mTargetURL(nsnull),
   mFollowLinks(PR_TRUE),
   mFollowLinksDirty(PR_TRUE)
 {
 }
 
 nsLocalFile::nsLocalFile(const nsLocalFile& src) :
-  mBaseRef(src.mBaseRef),
-  mTargetRef(src.mTargetRef),
+  mBaseURL(src.mBaseURL),
+  mTargetURL(src.mTargetURL),
   mFollowLinks(src.mFollowLinks),
   mFollowLinksDirty(src.mFollowLinksDirty)
 {
   NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
 
   // A CFURLRef is immutable so no need to copy, just retain.
-  if (mBaseRef)
-    ::CFRetain(mBaseRef);
-  if (mTargetRef)
-    ::CFRetain(mTargetRef);
+  if (mBaseURL)
+    ::CFRetain(mBaseURL);
+  if (mTargetURL)
+    ::CFRetain(mTargetURL);
 
   NS_OBJC_END_TRY_ABORT_BLOCK;
 }
 
 nsLocalFile::~nsLocalFile()
 {
   NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
 
-  if (mBaseRef)
-    ::CFRelease(mBaseRef);
-  if (mTargetRef)
-    ::CFRelease(mTargetRef);
+  if (mBaseURL)
+    ::CFRelease(mBaseURL);
+  if (mTargetURL)
+    ::CFRelease(mTargetURL);
 
   NS_OBJC_END_TRY_ABORT_BLOCK;
 }
 
 #pragma mark -
 #pragma mark [nsISupports]
 
 NS_IMPL_THREADSAFE_ISUPPORTS4(nsLocalFile,
@@ -363,30 +363,30 @@ NS_IMETHODIMP nsLocalFile::Append(const 
   return AppendNative(NS_ConvertUTF16toUTF8(aNode));
 }
 
 NS_IMETHODIMP nsLocalFile::AppendNative(const nsACString& aNode)
 {
   NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
 
   // Check we are correctly initialized.
-  CHECK_mBaseRef();
+  CHECK_mBaseURL();
 
   nsACString::const_iterator start, end;
   aNode.BeginReading(start);
   aNode.EndReading(end);
   if (FindCharInReadable(kPathSepChar, start, end))
     return NS_ERROR_FILE_UNRECOGNIZED_PATH;
 
   CFStringRef nodeStrRef = ::CFStringCreateWithCString(kCFAllocatorDefault,
                                   PromiseFlatCString(aNode).get(),
                                   kCFStringEncodingUTF8);
   if (nodeStrRef) {
     CFURLRef newRef = ::CFURLCreateCopyAppendingPathComponent(kCFAllocatorDefault,
-                                  mBaseRef, nodeStrRef, PR_FALSE);
+                                  mBaseURL, nodeStrRef, PR_FALSE);
     ::CFRelease(nodeStrRef);
     if (newRef) {
       SetBaseRef(newRef);
       ::CFRelease(newRef);
       return NS_OK;
     }
   }
   return NS_ERROR_FAILURE;
@@ -394,23 +394,23 @@ NS_IMETHODIMP nsLocalFile::AppendNative(
   NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
 }
 
 NS_IMETHODIMP nsLocalFile::Normalize()
 {
   NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
 
   // Check we are correctly initialized.
-  CHECK_mBaseRef();
+  CHECK_mBaseURL();
 
   // CFURL doesn't doesn't seem to resolve paths containing relative
   // components, so we'll nick the stdlib code from nsLocalFileUnix
   UInt8 path[PATH_MAX] = "";
   Boolean success;
-  success = ::CFURLGetFileSystemRepresentation(mBaseRef, true, path, PATH_MAX);
+  success = ::CFURLGetFileSystemRepresentation(mBaseURL, true, path, PATH_MAX);
   if (!success)
     return NS_ERROR_FAILURE;
 
   char resolved_path[PATH_MAX] = "";
   char *resolved_path_ptr = nsnull;
   resolved_path_ptr = realpath((char*)path, resolved_path);
 
   // if there is an error, the return is null.
@@ -447,20 +447,20 @@ NS_IMETHODIMP nsLocalFile::Normalize()
 NS_IMETHODIMP nsLocalFile::Create(PRUint32 type, PRUint32 permissions)
 {
   NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
 
   if (type != NORMAL_FILE_TYPE && type != DIRECTORY_TYPE)
     return NS_ERROR_FILE_UNKNOWN_TYPE;
 
   // Check we are correctly initialized.
-  CHECK_mBaseRef();
+  CHECK_mBaseURL();
   
   nsTArray<nsString> nonExtantNodes;
-  CFURLRef pathURLRef = mBaseRef;
+  CFURLRef pathURLRef = mBaseURL;
   FSRef pathFSRef;
   CFStringRef leafStrRef = nsnull;
   nsAutoTArray<UniChar, FILENAME_BUFFER_SIZE> buffer;
   Boolean success;
   
   // Work backwards through the path to find the last node which
   // exists. Place the nodes which don't exist in an array and we'll
   // create those below.
@@ -476,21 +476,21 @@ NS_IMETHODIMP nsLocalFile::Create(PRUint
     nonExtantNodes.AppendElement(nsString(nsDependentString(buffer.Elements())));
     ::CFRelease(leafStrRef);
     leafStrRef = nsnull;
     
     // Get the parent of the leaf for the next go round
     CFURLRef parent = ::CFURLCreateCopyDeletingLastPathComponent(NULL, pathURLRef);
     if (!parent)
       break;
-    if (pathURLRef != mBaseRef)
+    if (pathURLRef != mBaseURL)
       ::CFRelease(pathURLRef);
     pathURLRef = parent;
   }
-  if (pathURLRef != mBaseRef)
+  if (pathURLRef != mBaseURL)
     ::CFRelease(pathURLRef);
   if (leafStrRef != nsnull)
     ::CFRelease(leafStrRef);
   if (!success)
     return NS_ERROR_FAILURE;
   PRInt32 nodesToCreate = PRInt32(nonExtantNodes.Length());
   if (nodesToCreate == 0)
     return NS_ERROR_FILE_ALREADY_EXISTS;
@@ -547,38 +547,38 @@ NS_IMETHODIMP nsLocalFile::SetLeafName(c
   return SetNativeLeafName(NS_ConvertUTF16toUTF8(aLeafName));
 }
 
 NS_IMETHODIMP nsLocalFile::GetNativeLeafName(nsACString& aNativeLeafName)
 {
   NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
 
   // Check we are correctly initialized.
-  CHECK_mBaseRef();
+  CHECK_mBaseURL();
 
   nsresult rv = NS_ERROR_FAILURE;
-  CFStringRef leafStrRef = ::CFURLCopyLastPathComponent(mBaseRef);
+  CFStringRef leafStrRef = ::CFURLCopyLastPathComponent(mBaseURL);
   if (leafStrRef) {
     rv = CFStringReftoUTF8(leafStrRef, aNativeLeafName);
     ::CFRelease(leafStrRef);
   }
   return rv;
 
   NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
 }
 
 NS_IMETHODIMP nsLocalFile::SetNativeLeafName(const nsACString& aNativeLeafName)
 {
   NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
 
   // Check we are correctly initialized.
-  CHECK_mBaseRef();
+  CHECK_mBaseURL();
 
   nsresult rv = NS_ERROR_FAILURE;
-  CFURLRef parentURLRef = ::CFURLCreateCopyDeletingLastPathComponent(kCFAllocatorDefault, mBaseRef);
+  CFURLRef parentURLRef = ::CFURLCreateCopyDeletingLastPathComponent(kCFAllocatorDefault, mBaseURL);
   if (parentURLRef) {
     CFStringRef nodeStrRef = ::CFStringCreateWithCString(kCFAllocatorDefault,
                                     PromiseFlatCString(aNativeLeafName).get(),
                                     kCFStringEncodingUTF8);
 
     if (nodeStrRef) {
       CFURLRef newURLRef = ::CFURLCreateCopyAppendingPathComponent(kCFAllocatorDefault,
                                     parentURLRef, nodeStrRef, PR_FALSE);
@@ -621,17 +621,17 @@ NS_IMETHODIMP nsLocalFile::MoveTo(nsIFil
   return MoveToNative(newParentDir, NS_ConvertUTF16toUTF8(newName));
 }
 
 NS_IMETHODIMP nsLocalFile::MoveToNative(nsIFile *newParentDir, const nsACString& newName)
 {
   NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
 
   // Check we are correctly initialized.
-  CHECK_mBaseRef();
+  CHECK_mBaseURL();
 
   StFollowLinksState followLinks(*this, PR_FALSE);
 
   PRBool isDirectory;
   nsresult rv = IsDirectory(&isDirectory);
   if (NS_FAILED(rv))
     return rv;
 
@@ -708,17 +708,17 @@ NS_IMETHODIMP nsLocalFile::MoveToNative(
   NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
 }
 
 NS_IMETHODIMP nsLocalFile::Remove(PRBool recursive)
 {
   NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
 
   // Check we are correctly initialized.
-  CHECK_mBaseRef();
+  CHECK_mBaseURL();
 
   // XXX If we're an alias, never remove target
   StFollowLinksState followLinks(*this, PR_FALSE);
 
   PRBool isDirectory;
   nsresult rv = IsDirectory(&isDirectory);
   if (NS_FAILED(rv))
     return rv;
@@ -761,20 +761,20 @@ NS_IMETHODIMP nsLocalFile::Remove(PRBool
 #define NORMALIZE_PERMS(mode)    ((mode)& (S_IRWXU | S_IRWXG | S_IRWXO))
 
 NS_IMETHODIMP nsLocalFile::GetPermissions(PRUint32 *aPermissions)
 {
   NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
 
   NS_ENSURE_ARG_POINTER(aPermissions);
 
-  CHECK_mBaseRef();
+  CHECK_mBaseURL();
 
   NSAutoreleasePool* ap = [[NSAutoreleasePool alloc] init];
-  NSDictionary *fileAttributes = [[NSFileManager defaultManager] fileAttributesAtPath:[(NSURL*)mBaseRef path] traverseLink:YES];
+  NSDictionary *fileAttributes = [[NSFileManager defaultManager] fileAttributesAtPath:[(NSURL*)mBaseURL path] traverseLink:YES];
   if (fileAttributes) {
     NSNumber *permissions = [fileAttributes objectForKey:NSFilePosixPermissions];
     if (permissions) {
       *aPermissions = NORMALIZE_PERMS([permissions unsignedLongValue]);
       [ap release];
       return NS_OK;
     }
   }
@@ -784,23 +784,23 @@ NS_IMETHODIMP nsLocalFile::GetPermission
 
   NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
 }
 
 NS_IMETHODIMP nsLocalFile::SetPermissions(PRUint32 aPermissions)
 {
   NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
 
-  CHECK_mBaseRef();
+  CHECK_mBaseURL();
 
   NSAutoreleasePool* ap = [[NSAutoreleasePool alloc] init];
   NSNumber* pNumber = [NSNumber numberWithUnsignedInt:aPermissions];
   NSDictionary* fileAttributes = [NSDictionary dictionaryWithObject:pNumber forKey:NSFilePosixPermissions];
   // changeFileAttributes:atPath: follows symbolic links though the documentation doesn't mention it
-  BOOL success = [[NSFileManager defaultManager] changeFileAttributes:fileAttributes atPath:[(NSURL*)mBaseRef path]];
+  BOOL success = [[NSFileManager defaultManager] changeFileAttributes:fileAttributes atPath:[(NSURL*)mBaseURL path]];
   [ap release];
   return (success ? NS_OK : NS_ERROR_FAILURE);
 
   NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
 }
 
 NS_IMETHODIMP nsLocalFile::GetPermissionsOfLink(PRUint32 *aPermissionsOfLink)
 {
@@ -814,17 +814,17 @@ NS_IMETHODIMP nsLocalFile::SetPermission
     return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP nsLocalFile::GetLastModifiedTime(PRInt64 *aLastModifiedTime)
 {
   NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
 
   // Check we are correctly initialized.
-  CHECK_mBaseRef();
+  CHECK_mBaseURL();
 
   NS_ENSURE_ARG_POINTER(aLastModifiedTime);
   
   FSRef fsRef;
   nsresult rv = GetFSRefInternal(fsRef);
   if (NS_FAILED(rv))
     return rv;
     
@@ -839,17 +839,17 @@ NS_IMETHODIMP nsLocalFile::GetLastModifi
   NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
 }
 
 NS_IMETHODIMP nsLocalFile::SetLastModifiedTime(PRInt64 aLastModifiedTime)
 {
   NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
 
   // Check we are correctly initialized.
-  CHECK_mBaseRef();
+  CHECK_mBaseURL();
 
   OSErr err;
   nsresult rv;
   FSRef fsRef;
   FSCatalogInfo catalogInfo;
 
   rv = GetFSRefInternal(fsRef);
   if (NS_FAILED(rv))
@@ -920,17 +920,17 @@ NS_IMETHODIMP nsLocalFile::GetFileSize(P
   NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
 }
 
 NS_IMETHODIMP nsLocalFile::SetFileSize(PRInt64 aFileSize)
 {
   NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
 
   // Check we are correctly initialized.
-  CHECK_mBaseRef();
+  CHECK_mBaseURL();
 
   FSRef fsRef;
   nsresult rv = GetFSRefInternal(fsRef);
   if (NS_FAILED(rv))
     return rv;
   
 #ifdef __LP64__
   FSIORefNum refNum;
@@ -946,17 +946,17 @@ NS_IMETHODIMP nsLocalFile::SetFileSize(P
   return MacErrorMapper(err);
 
   NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
 }
 
 NS_IMETHODIMP nsLocalFile::GetFileSizeOfLink(PRInt64 *aFileSizeOfLink)
 {
   // Check we are correctly initialized.
-  CHECK_mBaseRef();
+  CHECK_mBaseURL();
 
   NS_ENSURE_ARG_POINTER(aFileSizeOfLink);
   
   StFollowLinksState followLinks(*this, PR_FALSE);
   return GetFileSize(aFileSizeOfLink);
 }
 
 NS_IMETHODIMP nsLocalFile::GetTarget(nsAString& aTarget)
@@ -968,20 +968,20 @@ NS_IMETHODIMP nsLocalFile::GetTarget(nsA
   CopyUTF8toUTF16NFC(nativeString, aTarget);
   return NS_OK;
 }
 
 NS_IMETHODIMP nsLocalFile::GetNativeTarget(nsACString& aNativeTarget)
 {
   NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
 
-  if (!mTargetRef)
+  if (!mTargetURL)
     return NS_ERROR_NOT_INITIALIZED;
   nsresult rv = NS_ERROR_FAILURE;
-  CFStringRef pathStrRef = ::CFURLCopyFileSystemPath(mTargetRef, kCFURLPOSIXPathStyle);
+  CFStringRef pathStrRef = ::CFURLCopyFileSystemPath(mTargetURL, kCFURLPOSIXPathStyle);
   if (pathStrRef) {
     rv = CFStringReftoUTF8(pathStrRef, aNativeTarget);
     ::CFRelease(pathStrRef);
   }
   return rv;
 
   NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
 }
@@ -996,67 +996,67 @@ NS_IMETHODIMP nsLocalFile::GetPath(nsASt
   return NS_OK;
 }
 
 NS_IMETHODIMP nsLocalFile::GetNativePath(nsACString& aNativePath)
 {
   NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
 
   // Check we are correctly initialized.
-  CHECK_mBaseRef();
+  CHECK_mBaseURL();
 
   nsresult rv = NS_ERROR_FAILURE;
-  CFStringRef pathStrRef = ::CFURLCopyFileSystemPath(mBaseRef, kCFURLPOSIXPathStyle);
+  CFStringRef pathStrRef = ::CFURLCopyFileSystemPath(mBaseURL, kCFURLPOSIXPathStyle);
   if (pathStrRef) {
     rv = CFStringReftoUTF8(pathStrRef, aNativePath);
     ::CFRelease(pathStrRef);
   }
   return rv;
 
   NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
 }
 
 NS_IMETHODIMP nsLocalFile::Exists(PRBool *_retval)
 {
   // Check we are correctly initialized.
-  CHECK_mBaseRef();
+  CHECK_mBaseURL();
 
   NS_ENSURE_ARG_POINTER(_retval);
   *_retval = PR_FALSE;
   
   FSRef fsRef;
   if (NS_SUCCEEDED(GetFSRefInternal(fsRef))) {
     *_retval = PR_TRUE;
   }
   
   return NS_OK;
 }
 
 NS_IMETHODIMP nsLocalFile::IsWritable(PRBool *_retval)
 {
   NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
 
-  CHECK_mBaseRef();
+  CHECK_mBaseURL();
 
   NS_ENSURE_ARG_POINTER(_retval);
   *_retval = PR_FALSE;
 
   NSAutoreleasePool* ap = [[NSAutoreleasePool alloc] init];
   // don't bother resolving, this always traverses symbolic links
-  *_retval = (PRBool)[[NSFileManager defaultManager] isWritableFileAtPath:[(NSURL*)mBaseRef path]];
+  *_retval = (PRBool)[[NSFileManager defaultManager] isWritableFileAtPath:[(NSURL*)mBaseURL path]];
   [ap release];
 
   return NS_OK;
 
   NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
 }
 
 NS_IMETHODIMP nsLocalFile::IsReadable(PRBool *_retval)
 {
-  CHECK_mBaseRef();
+  CHECK_mBaseURL();
 
   NS_ENSURE_ARG_POINTER(_retval);
   *_retval = PR_FALSE;
 
   PRUint32 permissions;
   nsresult rv = GetPermissions(&permissions);
   if (NS_FAILED(rv))
     return rv;
@@ -1064,17 +1064,17 @@ NS_IMETHODIMP nsLocalFile::IsReadable(PR
   return NS_OK;
 }
 
 NS_IMETHODIMP nsLocalFile::IsExecutable(PRBool *_retval)
 {
   NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
 
   // Check we are correctly initialized.
-  CHECK_mBaseRef();
+  CHECK_mBaseURL();
 
   NS_ENSURE_ARG_POINTER(_retval);
   *_retval = PR_FALSE;
   
   FSRef fsRef;
   nsresult rv = GetFSRefInternal(fsRef);
   if (NS_FAILED(rv))
     return rv;
@@ -1168,17 +1168,17 @@ NS_IMETHODIMP nsLocalFile::IsFile(PRBool
 
   NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
 }
 
 NS_IMETHODIMP nsLocalFile::IsSymlink(PRBool *_retval)
 {
   NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
 
-  CHECK_mBaseRef();
+  CHECK_mBaseURL();
 
   NS_ENSURE_ARG(_retval);
   *_retval = PR_FALSE;
 
   // First see if we are an actual symlink
   nsCAutoString path;
   nsresult rv = GetNativePath(path);
   if (NS_FAILED(rv))
@@ -1186,17 +1186,17 @@ NS_IMETHODIMP nsLocalFile::IsSymlink(PRB
   struct stat symStat;
   if (lstat(path.get(), &symStat) < 0)
     return NSRESULT_FOR_ERRNO();
   *_retval = S_ISLNK(symStat.st_mode);
 
   // If we're not a symlink, see if we are an old-school Mac OS alias
   if (!(*_retval)) {
     FSRef fsRef;
-    if (::CFURLGetFSRef(mBaseRef, &fsRef)) {
+    if (::CFURLGetFSRef(mBaseURL, &fsRef)) {
       Boolean isAlias, isFolder;
       if (::FSIsAliasFile(&fsRef, &isAlias, &isFolder) == noErr)
         *_retval = isAlias;
     }    
   }
 
   return NS_OK;
 
@@ -1260,17 +1260,17 @@ nsLocalFile::EqualsInternal(nsISupports*
   *_retval = thisPath.Equals(inPath);
   
   return NS_OK;
 }
 
 NS_IMETHODIMP nsLocalFile::Contains(nsIFile *inFile, PRBool recur, PRBool *_retval)
 {
   // Check we are correctly initialized.
-  CHECK_mBaseRef();
+  CHECK_mBaseURL();
 
   NS_ENSURE_ARG_POINTER(_retval);
   *_retval = PR_FALSE;
 
   PRBool isDir;
   nsresult rv = IsDirectory(&isDir);
   if (NS_FAILED(rv))
     return rv;
@@ -1293,29 +1293,29 @@ NS_IMETHODIMP nsLocalFile::Contains(nsIF
 NS_IMETHODIMP nsLocalFile::GetParent(nsIFile * *aParent)
 {
   NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
 
   NS_ENSURE_ARG_POINTER(aParent);
   *aParent = nsnull;
 
   // Check we are correctly initialized.
-  CHECK_mBaseRef();
+  CHECK_mBaseURL();
 
   // If it can be determined without error that a file does not
   // have a parent, return nsnull for the parent and NS_OK as the result.
   // See bug 133617.
   nsresult rv = NS_OK;
-  CFURLRef parentURLRef = ::CFURLCreateCopyDeletingLastPathComponent(kCFAllocatorDefault, mBaseRef);
+  CFURLRef parentURLRef = ::CFURLCreateCopyDeletingLastPathComponent(kCFAllocatorDefault, mBaseURL);
   if (parentURLRef) {
     // If the parent path is longer than file's path then 
     // CFURLCreateCopyDeletingLastPathComponent must have simply added
     // two dots at the end - in this case indicate that there is no parent.
     // See bug 332389.
-    CFStringRef path = ::CFURLGetString(mBaseRef);
+    CFStringRef path = ::CFURLGetString(mBaseURL);
     CFStringRef newPath = ::CFURLGetString(parentURLRef);
     if (::CFStringGetLength(newPath) < ::CFStringGetLength(path)) {
       rv = NS_ERROR_FAILURE;
       nsRefPtr<nsLocalFile> newFile = new nsLocalFile;
       if (newFile) {
         rv = newFile->InitWithCFURL(parentURLRef);
         if (NS_SUCCEEDED(rv)) {
           NS_ADDREF(*aParent = newFile);
@@ -1486,17 +1486,17 @@ NS_IMETHODIMP nsLocalFile::OpenANSIFileD
     return NS_ERROR_FAILURE;
 
   return NS_OK;
 }
 
 NS_IMETHODIMP nsLocalFile::Load(PRLibrary **_retval)
 {
   // Check we are correctly initialized.
-  CHECK_mBaseRef();
+  CHECK_mBaseURL();
 
   NS_ENSURE_ARG_POINTER(_retval);
 
   NS_TIMELINE_START_TIMER("PR_LoadLibrary");
 
   nsCAutoString path;
   nsresult rv = GetPathInternal(path);
   if (NS_FAILED(rv))
@@ -1521,17 +1521,17 @@ NS_IMETHODIMP nsLocalFile::Load(PRLibrar
   return NS_OK;
 }
 
 NS_IMETHODIMP nsLocalFile::GetDiskSpaceAvailable(PRInt64 *aDiskSpaceAvailable)
 {
   NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
 
   // Check we are correctly initialized.
-  CHECK_mBaseRef();
+  CHECK_mBaseURL();
 
   NS_ENSURE_ARG_POINTER(aDiskSpaceAvailable);
   
   FSRef fsRef;
   nsresult rv = GetFSRefInternal(fsRef);
   if (NS_FAILED(rv))
     return rv;
     
@@ -1750,17 +1750,17 @@ NS_IMETHODIMP nsLocalFile::InitToAppWith
   NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
 }
 
 NS_IMETHODIMP nsLocalFile::GetCFURL(CFURLRef *_retval)
 {
   NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
 
   NS_ENSURE_ARG_POINTER(_retval);
-  CFURLRef whichURLRef = mFollowLinks ? mTargetRef : mBaseRef;
+  CFURLRef whichURLRef = mFollowLinks ? mTargetURL : mBaseURL;
   if (whichURLRef)
     ::CFRetain(whichURLRef);
   *_retval = whichURLRef;
   return whichURLRef ? NS_OK : NS_ERROR_FAILURE;
 
   NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
 }
 
@@ -1770,17 +1770,17 @@ NS_IMETHODIMP nsLocalFile::GetFSRef(FSRe
   return GetFSRefInternal(*_retval);
 }
 
 NS_IMETHODIMP nsLocalFile::GetFSSpec(FSSpec *_retval)
 {
   NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
 
   NS_ENSURE_ARG_POINTER(_retval);
-  CHECK_mBaseRef();
+  CHECK_mBaseURL();
 
   FSRef fsRef;
   nsresult rv = GetFSRefInternal(fsRef);
   if (NS_SUCCEEDED(rv)) {
     OSErr err = ::FSGetCatalogInfo(&fsRef, kFSCatInfoNone, nsnull, nsnull, _retval, nsnull);
     return MacErrorMapper(err); 
   }
   return rv;
@@ -1812,82 +1812,82 @@ NS_IMETHODIMP nsLocalFile::GetFileSizeWi
 }
 
 NS_IMETHODIMP nsLocalFile::GetFileType(OSType *aFileType)
 {
   NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
 
   NS_ENSURE_ARG_POINTER(aFileType);
 
-  CHECK_mBaseRef();
+  CHECK_mBaseURL();
   
   nsresult rv = NS_ERROR_FAILURE;
 
   NSAutoreleasePool* ap = [[NSAutoreleasePool alloc] init];
-  NSDictionary* dict = [[NSFileManager defaultManager] fileAttributesAtPath:[(NSURL*)mBaseRef path] traverseLink:YES];
+  NSDictionary* dict = [[NSFileManager defaultManager] fileAttributesAtPath:[(NSURL*)mBaseURL path] traverseLink:YES];
   NSNumber* typeNum = (NSNumber*)[dict objectForKey:NSFileHFSTypeCode];
   if (typeNum) {
     *aFileType = [typeNum unsignedLongValue];
     rv = NS_OK;
   }
   [ap release];
 
   return rv;
 
   NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
 }
 
 NS_IMETHODIMP nsLocalFile::SetFileType(OSType aFileType)
 {
   NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
 
-  CHECK_mBaseRef();
+  CHECK_mBaseURL();
 
   NSAutoreleasePool* ap = [[NSAutoreleasePool alloc] init];
   NSDictionary* dict = [NSDictionary dictionaryWithObject:[NSNumber numberWithUnsignedLong:aFileType] forKey:NSFileHFSTypeCode];
-  BOOL success = [[NSFileManager defaultManager] changeFileAttributes:dict atPath:[(NSURL*)mBaseRef path]];
+  BOOL success = [[NSFileManager defaultManager] changeFileAttributes:dict atPath:[(NSURL*)mBaseURL path]];
   [ap release];
   return (success ? NS_OK : NS_ERROR_FAILURE);
 
   NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
 }
 
 NS_IMETHODIMP nsLocalFile::GetFileCreator(OSType *aFileCreator)
 {
   NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
 
   NS_ENSURE_ARG_POINTER(aFileCreator);
 
-  CHECK_mBaseRef();
+  CHECK_mBaseURL();
 
   nsresult rv = NS_ERROR_FAILURE;
 
   NSAutoreleasePool* ap = [[NSAutoreleasePool alloc] init];
-  NSDictionary* dict = [[NSFileManager defaultManager] fileAttributesAtPath:[(NSURL*)mBaseRef path] traverseLink:YES];
+  NSDictionary* dict = [[NSFileManager defaultManager] fileAttributesAtPath:[(NSURL*)mBaseURL path] traverseLink:YES];
   id creatorNum = (NSNumber*)[dict objectForKey:NSFileHFSCreatorCode];
   if (creatorNum) {
     *aFileCreator = [creatorNum unsignedLongValue];
     rv = NS_OK;
   }
   [ap release];
 
   return rv;
 
   NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
 }
 
 NS_IMETHODIMP nsLocalFile::SetFileCreator(OSType aFileCreator)
 {
   NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
 
-  CHECK_mBaseRef();
+  CHECK_mBaseURL();
 
   NSAutoreleasePool* ap = [[NSAutoreleasePool alloc] init];
   NSDictionary* dict = [NSDictionary dictionaryWithObject:[NSNumber numberWithUnsignedLong:aFileCreator] forKey:NSFileHFSCreatorCode];
-  BOOL success = [[NSFileManager defaultManager] changeFileAttributes:dict atPath:[(NSURL*)mBaseRef path]];
+  BOOL success = [[NSFileManager defaultManager] changeFileAttributes:dict atPath:[(NSURL*)mBaseURL path]];
   [ap release];
   return (success ? NS_OK : NS_ERROR_FAILURE);
 
   NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
 }
 
 NS_IMETHODIMP nsLocalFile::SetFileTypeAndCreatorFromMIMEType(const char *aMIMEType)
 {
@@ -2083,67 +2083,67 @@ nsLocalFile::GetBundleIdentifier(nsACStr
 
 nsresult nsLocalFile::SetBaseRef(CFURLRef aCFURLRef)
 {
   NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
 
   NS_ENSURE_ARG(aCFURLRef);
   
   ::CFRetain(aCFURLRef);
-  if (mBaseRef)
-    ::CFRelease(mBaseRef);
-  mBaseRef = aCFURLRef;
+  if (mBaseURL)
+    ::CFRelease(mBaseURL);
+  mBaseURL = aCFURLRef;
 
   mFollowLinksDirty = PR_TRUE;  
   UpdateTargetRef();
   return NS_OK;
 
   NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
 }
 
 nsresult nsLocalFile::UpdateTargetRef()
 {
   NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
 
   // Check we are correctly initialized.
-  CHECK_mBaseRef();
+  CHECK_mBaseURL();
   
   if (mFollowLinksDirty) {
-    if (mTargetRef) {
-      ::CFRelease(mTargetRef);
-      mTargetRef = nsnull;
+    if (mTargetURL) {
+      ::CFRelease(mTargetURL);
+      mTargetURL = nsnull;
     }
     if (mFollowLinks) {
-      mTargetRef = mBaseRef;
-      ::CFRetain(mTargetRef);
+      mTargetURL = mBaseURL;
+      ::CFRetain(mTargetURL);
 
       FSRef fsRef;
-      if (::CFURLGetFSRef(mBaseRef, &fsRef)) {
+      if (::CFURLGetFSRef(mBaseURL, &fsRef)) {
         Boolean targetIsFolder, wasAliased;
         if (FSResolveAliasFile(&fsRef, true /*resolveAliasChains*/, 
             &targetIsFolder, &wasAliased) == noErr && wasAliased) {
-          ::CFRelease(mTargetRef);
-          mTargetRef = CFURLCreateFromFSRef(NULL, &fsRef);
-          if (!mTargetRef)
+          ::CFRelease(mTargetURL);
+          mTargetURL = ::CFURLCreateFromFSRef(NULL, &fsRef);
+          if (!mTargetURL)
             return NS_ERROR_FAILURE;
         }
       }
       mFollowLinksDirty = PR_FALSE;
     }
   }
   return NS_OK;
 
   NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
 }
 
 nsresult nsLocalFile::GetFSRefInternal(FSRef& aFSRef)
 {
   NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
 
-  CFURLRef whichURLRef = mFollowLinks ? mTargetRef : mBaseRef;
+  CFURLRef whichURLRef = mFollowLinks ? mTargetURL : mBaseURL;
   NS_ENSURE_TRUE(whichURLRef, NS_ERROR_NULL_POINTER);
   if (::CFURLGetFSRef(whichURLRef, &aFSRef))
     return NS_OK;
 
   // See if we are a symlink, and construct an FSRef for that
   nsCAutoString path;
   nsresult rv = GetNativePath(path); // XXXjag inline and use whichURLRef?
   if (NS_FAILED(rv))
@@ -2187,17 +2187,17 @@ nsresult nsLocalFile::GetFSRefInternal(F
 }
 
 nsresult nsLocalFile::GetPathInternal(nsACString& path)
 {
   NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
 
   nsresult rv = NS_ERROR_FAILURE;
   
-  CFURLRef whichURLRef = mFollowLinks ? mTargetRef : mBaseRef;
+  CFURLRef whichURLRef = mFollowLinks ? mTargetURL : mBaseURL;
   NS_ENSURE_TRUE(whichURLRef, NS_ERROR_NULL_POINTER);
    
   CFStringRef pathStrRef = ::CFURLCopyFileSystemPath(whichURLRef, kCFURLPOSIXPathStyle);
   if (pathStrRef) {
     rv = CFStringReftoUTF8(pathStrRef, path);
     ::CFRelease(pathStrRef);
   }
   return rv;
@@ -2207,17 +2207,17 @@ nsresult nsLocalFile::GetPathInternal(ns
 
 nsresult nsLocalFile::CopyInternal(nsIFile* aParentDir,
                                    const nsAString& newName,
                                    PRBool followLinks)
 {
   NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
 
   // Check we are correctly initialized.
-  CHECK_mBaseRef();
+  CHECK_mBaseURL();
 
   StFollowLinksState srcFollowState(*this, followLinks);
 
   nsresult rv;
   OSErr err;
   FSRef srcFSRef;
 
   rv = GetFSRefInternal(srcFSRef);
@@ -2325,17 +2325,17 @@ nsLocalFile::Equals(nsIHashable* aOther,
     return EqualsInternal(aOther, aResult);
 }
 
 NS_IMETHODIMP
 nsLocalFile::GetHashCode(PRUint32 *aResult)
 {
     NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
 
-    CFStringRef pathStrRef = ::CFURLCopyFileSystemPath(mBaseRef, kCFURLPOSIXPathStyle);
+    CFStringRef pathStrRef = ::CFURLCopyFileSystemPath(mBaseURL, kCFURLPOSIXPathStyle);
     nsCAutoString path;
     CFStringReftoUTF8(pathStrRef, path);
     ::CFRelease(pathStrRef);
     *aResult = HashString(path);
     return NS_OK;
 
     NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
 }