Remove setFileTypeAndCreatorFromMIMEType and setFileTypeAndCreatorFromExtension from nsILocalFileMac. b=491099 sr=roc
authorJosh Aas <joshmoz@gmail.com>
Sat, 02 May 2009 11:01:25 -0700
changeset 27946 d51bc20e79bf6190d63f5eadac1f4e7ea2285bad
parent 27945 d3a9f84b14d0281aa993d41b07deb94f26ee6f0d
child 27947 711f92f7e860d1ce1860b35c47fa731fbe54713a
push id6794
push userjosh@mozilla.com
push dateSat, 02 May 2009 17:59:41 +0000
treeherdermozilla-central@d51bc20e79bf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs491099
milestone1.9.2a1pre
Remove setFileTypeAndCreatorFromMIMEType and setFileTypeAndCreatorFromExtension from nsILocalFileMac. b=491099 sr=roc
embedding/components/webbrowserpersist/src/nsWebBrowserPersist.cpp
xpcom/io/nsILocalFileMac.idl
xpcom/io/nsLocalFileOSX.h
xpcom/io/nsLocalFileOSX.mm
--- a/embedding/components/webbrowserpersist/src/nsWebBrowserPersist.cpp
+++ b/embedding/components/webbrowserpersist/src/nsWebBrowserPersist.cpp
@@ -37,19 +37,16 @@
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "nspr.h"
 
 #include "nsIFileStreams.h"       // New Necko file streams
 
-#ifdef XP_MAC
-#include "nsILocalFileMac.h"
-#endif
 #ifdef XP_OS2
 #include "nsILocalFileOS2.h"
 #endif
 
 #include "nsNetUtil.h"
 #include "nsComponentManagerUtils.h"
 #include "nsIComponentRegistrar.h"
 #include "nsIStorageStream.h"
@@ -2241,25 +2238,16 @@ nsWebBrowserPersist::CalculateAndAppendF
                 }
                 else
                 {
                     url->SetFileName(newFileName);
                 }
             }
 
         }
-
-#ifdef  XP_MAC
-        // Set appropriate Mac file type/creator for this mime type
-        nsCOMPtr<nsILocalFileMac> macFile(do_QueryInterface(localFile));
-        if (macFile)
-        {
-            macFile->SetFileTypeAndCreatorFromMIMEType(contentType.get());
-        }
-#endif            
     }
 
     return NS_OK;
 }
 
 nsresult
 nsWebBrowserPersist::MakeOutputStream(
     nsIURI *aURI, nsIOutputStream **aOutputStream)
--- a/xpcom/io/nsILocalFileMac.idl
+++ b/xpcom/io/nsILocalFileMac.idl
@@ -41,22 +41,21 @@
 
 %{C++
 #include <Carbon/Carbon.h>
 #include <CoreFoundation/CoreFoundation.h>
 %}
 
       native OSType(OSType);
       native FSSpec(FSSpec);
-[ptr] native FSSpecPtr(FSSpec);
       native FSRef(FSRef);
 [ptr] native FSRefPtr(FSRef);
       native CFURLRef(CFURLRef);
 
-[scriptable, uuid(7224E826-3F6C-4BB2-9C6E-02DA44575743)]
+[scriptable, uuid(86D685E5-EE3F-405A-B521-446529DB82E5)]
 interface nsILocalFileMac : nsILocalFile
 {
    /**
     * initWithCFURL
     *
     * Init this object with a CFURLRef
     *
     * NOTE: Supported only for XP_MACOSX or TARGET_CARBON
@@ -159,39 +158,17 @@ interface nsILocalFileMac : nsILocalFile
    /**
     * fileType, creator
     *
     * File type and creator attributes
     *
     */
    [noscript] attribute OSType fileType;
    [noscript] attribute OSType fileCreator;
-    
-   /**
-    * setFileTypeAndCreatorFromMIMEType
-    *
-    * Sets the file type and creator code from a MIME type.
-    * Internet Config is used to determine the mapping.
-    *
-    * @param   aMIMEType
-    *
-    */
-   void setFileTypeAndCreatorFromMIMEType(in string aMIMEType);
-    
-   /**
-    * setFileTypeAndCreatorFromExtension
-    *
-    * Sets the file type and creator code from a file extension
-    * Internet Config is used to determine the mapping.
-    *
-    * @param   aExtension
-    *
-    */
-   void setFileTypeAndCreatorFromExtension(in string aExtension);
-    
+
    /**
     * launchWithDoc
     *
     * Launch the application that this file points to with a document.
     *
     * @param   aDocToLoad          Must not be NULL. If no document, use nsILocalFile::launch
     * @param   aLaunchInBackground TRUE if the application should not come to the front.
     *
--- a/xpcom/io/nsLocalFileOSX.h
+++ b/xpcom/io/nsLocalFileOSX.h
@@ -37,17 +37,16 @@
  * ***** END LICENSE BLOCK ***** */
 
 #ifndef nsLocalFileMac_h_
 #define nsLocalFileMac_h_
 
 #include "nsILocalFileMac.h"
 #include "nsString.h"
 #include "nsIHashable.h"
-#include "nsIClassInfoImpl.h"
 
 class nsDirEnumerator;
 
 // Mac OS X 10.4 does not have stat64/lstat64
 #if defined(HAVE_STAT64) && defined(HAVE_LSTAT64) && (MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_4)
 #define STAT stat64
 #define LSTAT lstat64
 #else
--- a/xpcom/io/nsLocalFileOSX.mm
+++ b/xpcom/io/nsLocalFileOSX.mm
@@ -1853,30 +1853,16 @@ NS_IMETHODIMP nsLocalFile::SetFileCreato
   NSDictionary* dict = [NSDictionary dictionaryWithObject:[NSNumber numberWithUnsignedLong:aFileCreator] forKey:NSFileHFSCreatorCode];
   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)
-{
-  // XXX - This should be cut from the API. Would create an evil dependency.
-  NS_ERROR("NS_ERROR_NOT_IMPLEMENTED");
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP nsLocalFile::SetFileTypeAndCreatorFromExtension(const char *aExtension)
-{
-  // XXX - This should be cut from the API. Would create an evil dependency.
-  NS_ERROR("NS_ERROR_NOT_IMPLEMENTED");
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
 NS_IMETHODIMP nsLocalFile::LaunchWithDoc(nsILocalFile *aDocToLoad, PRBool aLaunchInBackground)
 {
   NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
 
   PRBool isExecutable;
   nsresult rv = IsExecutable(&isExecutable);
   if (NS_FAILED(rv))
     return rv;