[iOS] Remove soft linking of MobileCoreServices.framework
[WebKit-https.git] / Source / WebCore / platform / graphics / cg / ImageSourceCGMac.mm
index bd50a31..a65fbb7 100644 (file)
 #import <wtf/RetainPtr.h>
 #import <wtf/text/WTFString.h>
 
+#if PLATFORM(IOS)
+#import <MobileCoreServices/MobileCoreServices.h>
+#endif
+
 namespace WebCore {
 
 String MIMETypeForImageSourceType(const String& uti)
 {
-    RetainPtr<CFStringRef> utiref(AdoptCF, uti.createCFString());
-    RetainPtr<CFStringRef> mime(AdoptCF, UTTypeCopyPreferredTagWithClass(utiref.get(), kUTTagClassMIMEType));
-    return mime.get();
+    return adoptCF(UTTypeCopyPreferredTagWithClass(uti.createCFString().get(), kUTTagClassMIMEType)).get();
 }
 
 String preferredExtensionForImageSourceType(const String& uti)
 {
-    RetainPtr<CFStringRef> type(AdoptCF, uti.createCFString());
-    RetainPtr<CFStringRef> extension(AdoptCF, UTTypeCopyPreferredTagWithClass(type.get(), kUTTagClassFilenameExtension));
-    return extension.get();
+    return adoptCF(UTTypeCopyPreferredTagWithClass(uti.createCFString().get(), kUTTagClassFilenameExtension)).get();
 }
 
 } // namespace WebCore