Reviewed by Darin.
authormjs <mjs@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 6 Jun 2005 00:15:12 +0000 (00:15 +0000)
committermjs <mjs@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 6 Jun 2005 00:15:12 +0000 (00:15 +0000)
- use WebKitSystemInterface wrappers for NSURLFileTypeMappings and NSURLResponse SPI

        * Misc.subproj/WebNSPasteboardExtras.m:
        (-[NSPasteboard _web_declareAndWriteDragImage:URL:title:archive:source:]):
        * Misc.subproj/WebNSURLExtras.m:
        (-[NSURL _webkit_suggestedFilenameWithMIMEType:]):
        * Misc.subproj/WebNSViewExtras.m:
        (-[NSView _web_dragImage:rect:event:pasteboard:source:offset:]):
        * Plugins.subproj/WebBaseNetscapePluginStream.m:
        (-[WebBaseNetscapePluginStream startStreamWithResponse:]):
        * Plugins.subproj/WebNetscapePluginStream.m:
        (-[WebNetscapePluginConnectionDelegate didReceiveResponse:]):
        * Plugins.subproj/WebPluginDatabase.m:
        (-[WebPluginDatabase pluginForExtension:]):
        * WebCoreSupport.subproj/WebBridge.m:
        (-[WebBridge expiresTimeForResponse:]):
        (-[WebBridge determineObjectFromMIMEType:URL:]):
        (-[WebBridge MIMETypeForPath:]):
        * WebCoreSupport.subproj/WebImageRendererFactory.m:
        (-[WebImageRendererFactory supportedMIMETypes]):
        * WebView.subproj/WebBaseResourceHandleDelegate.m:
        (-[WebBaseResourceHandleDelegate _canUseResourceWithResponse:]):
        * WebView.subproj/WebDataSource.m:
        (-[WebDataSource _commitIfReady:]):
        * WebView.subproj/WebHTMLView.m:
        (-[WebHTMLView _imageExistsAtPaths:]):
        (-[WebHTMLView _documentFragmentWithPaths:]):
        (-[WebHTMLView resourceForData:preferredFilename:]):
        * WebView.subproj/WebMainResourceClient.m:
        * WebView.subproj/WebView.m:
        (+[WebView _supportedFileExtensions]):
        (+[WebView suggestedFileExtensionForMIMEType:]):
        (+[WebView _MIMETypeForFile:]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@9283 268f45cc-cd09-0410-ab3c-d52691b4dbfc

16 files changed:
WebKit/ChangeLog
WebKit/Misc.subproj/WebNSPasteboardExtras.m
WebKit/Misc.subproj/WebNSURLExtras.m
WebKit/Misc.subproj/WebNSViewExtras.m
WebKit/Plugins.subproj/WebBaseNetscapePluginStream.m
WebKit/Plugins.subproj/WebNetscapePluginStream.m
WebKit/Plugins.subproj/WebPluginDatabase.m
WebKit/WebCoreSupport.subproj/WebBridge.m
WebKit/WebCoreSupport.subproj/WebImageRendererFactory.m
WebKit/WebView.subproj/WebBaseResourceHandleDelegate.m
WebKit/WebView.subproj/WebDataSource.m
WebKit/WebView.subproj/WebHTMLView.m
WebKit/WebView.subproj/WebLoader.m
WebKit/WebView.subproj/WebMainResourceClient.m
WebKit/WebView.subproj/WebMainResourceLoader.m
WebKit/WebView.subproj/WebView.m

index cb5725da72a4bee188676c8a625816bc8198992c..e1654987ed26f3f1ac19ea659378df868bbd735a 100644 (file)
@@ -1,3 +1,41 @@
+2005-06-05  Maciej Stachowiak  <mjs@apple.com>
+
+        Reviewed by Darin.
+
+       - use WebKitSystemInterface wrappers for NSURLFileTypeMappings and NSURLResponse SPI
+
+        * Misc.subproj/WebNSPasteboardExtras.m:
+        (-[NSPasteboard _web_declareAndWriteDragImage:URL:title:archive:source:]):
+        * Misc.subproj/WebNSURLExtras.m:
+        (-[NSURL _webkit_suggestedFilenameWithMIMEType:]):
+        * Misc.subproj/WebNSViewExtras.m:
+        (-[NSView _web_dragImage:rect:event:pasteboard:source:offset:]):
+        * Plugins.subproj/WebBaseNetscapePluginStream.m:
+        (-[WebBaseNetscapePluginStream startStreamWithResponse:]):
+        * Plugins.subproj/WebNetscapePluginStream.m:
+        (-[WebNetscapePluginConnectionDelegate didReceiveResponse:]):
+        * Plugins.subproj/WebPluginDatabase.m:
+        (-[WebPluginDatabase pluginForExtension:]):
+        * WebCoreSupport.subproj/WebBridge.m:
+        (-[WebBridge expiresTimeForResponse:]):
+        (-[WebBridge determineObjectFromMIMEType:URL:]):
+        (-[WebBridge MIMETypeForPath:]):
+        * WebCoreSupport.subproj/WebImageRendererFactory.m:
+        (-[WebImageRendererFactory supportedMIMETypes]):
+        * WebView.subproj/WebBaseResourceHandleDelegate.m:
+        (-[WebBaseResourceHandleDelegate _canUseResourceWithResponse:]):
+        * WebView.subproj/WebDataSource.m:
+        (-[WebDataSource _commitIfReady:]):
+        * WebView.subproj/WebHTMLView.m:
+        (-[WebHTMLView _imageExistsAtPaths:]):
+        (-[WebHTMLView _documentFragmentWithPaths:]):
+        (-[WebHTMLView resourceForData:preferredFilename:]):
+        * WebView.subproj/WebMainResourceClient.m:
+        * WebView.subproj/WebView.m:
+        (+[WebView _supportedFileExtensions]):
+        (+[WebView suggestedFileExtensionForMIMEType:]):
+        (+[WebView _MIMETypeForFile:]):
+
 2005-06-05  Darin Adler  <darin@apple.com>
 
         Reviewed by Hyatt.
index 0e7ec3e0d0c4a69f15449c60978a293ab1646741..f607199a9540dbfb4bcc2ddbed8166047b34ba26 100644 (file)
@@ -36,8 +36,7 @@
 #import <WebKit/WebResourcePrivate.h>
 #import <WebKit/WebURLsWithTitles.h>
 #import <WebKit/WebViewPrivate.h>
-
-#import <Foundation/NSURLFileTypeMappings.h>
+#import <WebKitSystemInterface.h>
 
 #import <HIServices/CoreTranslationFlavorTypeNames.h>
 
@@ -257,7 +256,7 @@ static NSArray *_writableTypesForImageWithArchive (void)
     [self _web_writeImage:image URL:URL title:title archive:archive types:types];
     [types release];
     
-    NSString *extension = [[NSURLFileTypeMappings sharedMappings] preferredExtensionForMIMEType:[image MIMEType]];
+    NSString *extension = WKGetPreferredExtensionForMIMEType([image MIMEType]);
     if (extension == nil) {
         extension = @"";
     }
index a8edb70e77a23afa2668a23033470afeee759fe1..4bc208fd427afa84e86e7916f9d3d210aa74cd79 100644 (file)
 #import <WebKit/WebNSObjectExtras.h>
 #import <WebKit/WebLocalizableStrings.h>
 
+#import <WebKitSystemInterface.h>
+
 #import <Foundation/NSURLProtocolPrivate.h>
 #import <Foundation/NSURLRequest.h>
-#import <Foundation/NSURLFileTypeMappings.h>
 
 #import <unicode/uchar.h>
 #import <unicode/uidna.h>
@@ -784,12 +785,11 @@ typedef struct {
 
     // If the type is known, check the extension and correct it if necessary.
     if (![MIMEType isEqualToString:@"application/octet-stream"] && ![MIMEType isEqualToString:@"text/plain"]) {
-        NSURLFileTypeMappings *mappings = [NSURLFileTypeMappings sharedMappings];
-        NSArray *extensions = [mappings extensionsForMIMEType:MIMEType];
+        NSArray *extensions = WKGetExtensionsForMIMEType(MIMEType);
 
         if (![extension length] || (extensions && ![extensions containsObject:extension])) {
             // The extension doesn't match the MIME type. Correct this.
-            NSString *correctExtension = [mappings preferredExtensionForMIMEType:MIMEType];
+            NSString *correctExtension = WKGetPreferredExtensionForMIMEType(MIMEType);
             if ([correctExtension length] != 0) {
                 // Append the correct extension.
                 filename = [filename stringByAppendingPathExtension:correctExtension];
index 5cf6c18d3f79545911d7305da2d1ed2f561333bf..8ee57cabbf32b2ea38de594286c7043f77943c64 100644 (file)
@@ -35,8 +35,7 @@
 #import <WebKit/WebNSImageExtras.h>
 #import <WebKit/WebNSPasteboardExtras.h>
 #import <WebKit/WebNSURLExtras.h>
-
-#import <Foundation/NSURLFileTypeMappings.h>
+#import <WebKitSystemInterface.h>
 
 #define WebDragStartHysteresisX                        5.0
 #define WebDragStartHysteresisY                        5.0
         origin.y = origin.y + originalSize.height;
         origin.y = mouseDownPoint.y - (((mouseDownPoint.y - origin.y) / originalSize.height) * newSize.height);
     } else {
-        NSString *extension = [[NSURLFileTypeMappings sharedMappings] preferredExtensionForMIMEType:[wir MIMEType]];
+        NSString *extension = WKGetPreferredExtensionForMIMEType([wir MIMEType]);
         if (extension == nil) {
             extension = @"";
         }
index a4f94118eb653483f0584c0dee1576ffbd8fd734..5bc920e5696e7af24012ecd6948d48da597f1a41 100644 (file)
@@ -34,9 +34,9 @@
 #import <WebKit/WebNetscapePluginPackage.h>
 #import <WebKit/WebNSObjectExtras.h>
 #import <WebKit/WebNSURLExtras.h>
+#import <WebKitSystemInterface.h>
 
 #import <Foundation/NSURLResponse.h>
-#import <Foundation/NSURLResponsePrivate.h>
 
 static const char *CarbonPathFromPOSIXPath(const char *posixPath);
 
@@ -243,7 +243,7 @@ static const char *CarbonPathFromPOSIXPath(const char *posixPath);
 {
     [self startStreamResponseURL:[r URL]
            expectedContentLength:[r expectedContentLength]
-                lastModifiedDate:[r _lastModifiedDate]
+                lastModifiedDate:WKGetNSURLResponseLastModifiedDate(r)
                         MIMEType:[r MIMEType]];
 }
 
index 76cee75188b62f9ec0340d57d9de1a7cffeb71cb..a2da650ac61380352f323d4ceb0b141429667abe 100644 (file)
@@ -39,7 +39,6 @@
 #import <WebKit/WebViewPrivate.h>
 
 #import <Foundation/NSURLConnection.h>
-#import <Foundation/NSURLResponsePrivate.h>
 
 @interface WebNetscapePluginConnectionDelegate : WebBaseResourceHandleDelegate
 {
         [super didReceiveResponse:theResponse];
         if (stream) {
             if ([theResponse isKindOfClass:[NSHTTPURLResponse class]] &&
-                [NSHTTPURLResponse isErrorStatusCode:[(NSHTTPURLResponse *)theResponse statusCode]]) {
+                ([(NSHTTPURLResponse *)theResponse statusCode] >= 400 || [(NSHTTPURLResponse *)theResponse statusCode] < 100)) {
                 NSError *error = [NSError _webKitErrorWithDomain:NSURLErrorDomain
                                                             code:NSURLErrorFileDoesNotExist
                                                             URL:[theResponse URL]];
index 0fa14c2769e58913e100b3165d4333b89f0ad968..ee65aca157df2a94f7af1612850b9dfa9b9284e7 100644 (file)
 #import <WebKit/WebPluginDocumentView.h>
 #import <WebKit/WebPluginPackage.h>
 #import <WebKit/WebViewPrivate.h>
+#import <WebKitSystemInterface.h>
 
 #import <CoreGraphics/CPSProcesses.h>
 
-#import <Foundation/NSURLFileTypeMappings.h>
-
 @implementation WebPluginDatabase
 
 static WebPluginDatabase *database = nil;
@@ -120,7 +119,7 @@ static WebPluginDatabase *database = nil;
         // If no plug-in was found from the extension, attempt to map from the extension to a MIME type
         // and find the a plug-in from the MIME type. This is done in case the plug-in has not fully specified
         // an extension <-> MIME type mapping.
-        NSString *MIMEType = [[NSURLFileTypeMappings sharedMappings] MIMETypeForExtension:extension];
+        NSString *MIMEType = WKGetMIMETypeForExtension(extension);
         if ([MIMEType length] > 0) {
             plugin = [self pluginForMIMEType:MIMEType];
         }
index fa3385112f343e1ec092c4f94b787b63d2b5cb9d..77b26e19b734c655eaa082e343c9d2bba7b26764 100644 (file)
 #import <WebKit/WebViewInternal.h>
 #import <WebKit/WebViewPrivate.h>
 #import <WebKit/WebUIDelegatePrivate.h>
+#import <WebKitSystemInterface.h>
 
 #import <Foundation/NSURLRequest.h>
 #import <Foundation/NSURLConnection.h>
 #import <Foundation/NSURLResponse.h>
-#import <Foundation/NSURLResponsePrivate.h>
-#import <Foundation/NSURLFileTypeMappings.h>
 
 #import <WebKit/WebLocalizableStrings.h>
 
@@ -578,7 +577,7 @@ NSString *WebPluginContainerKey =   @"WebPluginContainer";
 
     // Fall back to the older calculation
     time_t now = time(NULL);
-    NSTimeInterval lifetime = [response _freshnessLifetime];
+    NSTimeInterval lifetime = WKGetNSURLResponseFreshnessLifetime(response);
     if (lifetime < 0)
         lifetime = 0;
     
@@ -1087,7 +1086,7 @@ static BOOL loggedObjectCacheSize = NO;
         // Try to guess the MIME type based off the extension.
         NSString *extension = [[URL path] pathExtension];
         if ([extension length] > 0) {
-            MIMEType = [[NSURLFileTypeMappings sharedMappings] MIMETypeForExtension:extension];
+            MIMEType = WKGetMIMETypeForExtension(extension);
             if ([MIMEType length] == 0 && [[WebPluginDatabase installedPlugins] pluginForExtension:extension])
                 // If no MIME type is specified, use a plug-in if we have one that can handle the extension.
                 return ObjectElementPlugin;
@@ -1126,7 +1125,7 @@ static BOOL loggedObjectCacheSize = NO;
 {
     ASSERT(path);
     NSString *extension = [path pathExtension];
-    NSString *type = [[NSURLFileTypeMappings sharedMappings] MIMETypeForExtension:extension];
+    NSString *type = WKGetMIMETypeForExtension(extension);
     return [type length] == 0 ? @"application/octet-stream" : type;
 }
 
index 9ddcebb1dd3c24cb917fa12dce1ca79caee896cf..0d01d8aca48b318ef6404ab81328f324e367116e 100644 (file)
@@ -30,7 +30,7 @@
 #import <WebKit/WebImageRenderer.h>
 
 #import <WebKit/WebAssertions.h>
-#import <Foundation/NSURLFileTypeMappings.h>
+#import <WebKitSystemInterface.h>
 
 @implementation WebImageRendererFactory
 
@@ -198,12 +198,11 @@ struct CompositeOperator NSCompositingOperations[NUM_COMPOSITE_OPERATORS] = {
 
     if (imageMIMETypes == nil) {
         NSEnumerator *enumerator = [[NSImage imageFileTypes] objectEnumerator];
-        NSURLFileTypeMappings *mappings = [NSURLFileTypeMappings sharedMappings];
         NSMutableSet *mimes = [NSMutableSet set];
         NSString *type;
 
         while ((type = [enumerator nextObject]) != nil) {
-            NSString *mime = [mappings MIMETypeForExtension:type];
+            NSString *mime = WKGetMIMETypeForExtension(type);
             if (mime != nil && ![mime isEqualToString:@"application/octet-stream"]) {
                 [mimes addObject:mime];
             }
index aefb79db39e74ddc7bf28a39a7ece9d1091a3555..6721c063b7b2d35f019515b24cb9cabfe8ef58a4 100644 (file)
@@ -33,7 +33,6 @@
 #import <Foundation/NSURLConnectionPrivate.h>
 #import <Foundation/NSURLRequest.h>
 #import <Foundation/NSURLResponse.h>
-#import <Foundation/NSURLResponsePrivate.h>
 
 #import <WebKit/WebAssertions.h>
 #import <WebKit/WebDataProtocol.h>
@@ -48,6 +47,7 @@
 #import <WebKit/WebResourceLoadDelegate.h>
 #import <WebKit/WebResourcePrivate.h>
 #import <WebKit/WebViewPrivate.h>
+#import <WebKitSystemInterface.h>
 
 static unsigned inNSURLConnectionCallback;
 static BOOL NSURLConnectionSupportsBufferedData;
@@ -216,9 +216,9 @@ static BOOL NSURLConnectionSupportsBufferedData;
 
 - (BOOL)_canUseResourceWithResponse:(NSURLResponse *)theResponse
 {
-    if ([theResponse _mustRevalidate]) {
+    if (WKGetNSURLResponseMustRevalidate(theResponse)) {
         return NO;
-    } else if ([theResponse _calculatedExpiration] - CFAbsoluteTimeGetCurrent() < 1) {
+    } else if (WKGetNSURLResponseCalculatedExpiration(theResponse) - CFAbsoluteTimeGetCurrent() < 1) {
         return NO;
     } else {
         return YES;
index 917cd9f19e8f20e5673e82edd6747d3e3b96b136..7b9845a6e36bac91ac6bab40883282d1f2e78124 100644 (file)
 #import <WebKit/WebResourcePrivate.h>
 #import <WebKit/WebTextRepresentation.h>
 #import <WebKit/WebViewPrivate.h>
+#import <WebKitSystemInterface.h>
 
 #import <Foundation/NSURLConnection.h>
 #import <Foundation/NSURLRequest.h>
-#import <Foundation/NSURLResponsePrivate.h>
 
 @implementation WebDataSourcePrivate 
 
                          reload:reload 
                     contentType:[_private->response MIMEType]
                         refresh:[headers objectForKey:@"Refresh"]
-                   lastModified:(pageCache ? nil : [_private->response _lastModifiedDate])
+                   lastModified:(pageCache ? nil : WKGetNSURLResponseLastModifiedDate(_private->response))
                       pageCache:pageCache];
 
         [frame _opened];
index 65adb2b2bf433d0e694a4a5fe576284f3ba59f8c..15c1450bc34e1a1232fee3f9d77eab60a853f357 100644 (file)
 #import <WebKit/WebUIDelegatePrivate.h>
 #import <WebKit/WebViewInternal.h>
 #import <WebKit/WebViewPrivate.h>
+#import <WebKitSystemInterface.h>
 
 #import <AppKit/NSAccessibility.h>
 #import <AppKit/NSGraphicsContextPrivate.h>
 #import <AppKit/NSResponder_Private.h>
 
-#import <Foundation/NSURLFileTypeMappings.h>
-
 #import <CoreGraphics/CGContextGState.h>
 
 // Included to help work around this bug:
@@ -267,13 +266,12 @@ void *_NSSoftLinkingGetFrameworkFuncPtr(NSString *inUmbrellaFrameworkName,
 
 - (BOOL)_imageExistsAtPaths:(NSArray *)paths
 {
-    NSURLFileTypeMappings *mappings = [NSURLFileTypeMappings sharedMappings];
     NSArray *imageMIMETypes = [[WebImageRendererFactory sharedFactory] supportedMIMETypes];
     NSEnumerator *enumerator = [paths objectEnumerator];
     NSString *path;
     
     while ((path = [enumerator nextObject]) != nil) {
-        NSString *MIMEType = [mappings MIMETypeForExtension:[path pathExtension]];
+        NSString *MIMEType = WKGetMIMETypeForExtension([path pathExtension]);
         if ([imageMIMETypes containsObject:MIMEType]) {
             return YES;
         }
@@ -285,14 +283,13 @@ void *_NSSoftLinkingGetFrameworkFuncPtr(NSString *inUmbrellaFrameworkName,
 - (DOMDocumentFragment *)_documentFragmentWithPaths:(NSArray *)paths
 {
     DOMDocumentFragment *fragment = [[[self _bridge] DOMDocument] createDocumentFragment];
-    NSURLFileTypeMappings *mappings = [NSURLFileTypeMappings sharedMappings];
     NSArray *imageMIMETypes = [[WebImageRendererFactory sharedFactory] supportedMIMETypes];
     NSEnumerator *enumerator = [paths objectEnumerator];
     WebDataSource *dataSource = [self _dataSource];
     NSString *path;
     
     while ((path = [enumerator nextObject]) != nil) {
-        NSString *MIMEType = [mappings MIMETypeForExtension:[path pathExtension]];
+        NSString *MIMEType = WKGetMIMETypeForExtension([path pathExtension]);
         if ([imageMIMETypes containsObject:MIMEType]) {
             WebResource *resource = [[WebResource alloc] initWithData:[NSData dataWithContentsOfFile:path]
                                                                   URL:[NSURL fileURLWithPath:path]
@@ -435,7 +432,7 @@ void *_NSSoftLinkingGetFrameworkFuncPtr(NSString *inUmbrellaFrameworkName,
     NSString *extension = [name pathExtension];
     NSString *MIMEType = nil;
     if ([extension length] != 0) {
-        MIMEType = [[NSURLFileTypeMappings sharedMappings] MIMETypeForExtension:extension];
+        MIMEType = WKGetMIMETypeForExtension(extension);
     }
     // Only support image resources.
     if (MIMEType == nil || ![[[WebImageRendererFactory sharedFactory] supportedMIMETypes] containsObject:MIMEType]) {
index aefb79db39e74ddc7bf28a39a7ece9d1091a3555..6721c063b7b2d35f019515b24cb9cabfe8ef58a4 100644 (file)
@@ -33,7 +33,6 @@
 #import <Foundation/NSURLConnectionPrivate.h>
 #import <Foundation/NSURLRequest.h>
 #import <Foundation/NSURLResponse.h>
-#import <Foundation/NSURLResponsePrivate.h>
 
 #import <WebKit/WebAssertions.h>
 #import <WebKit/WebDataProtocol.h>
@@ -48,6 +47,7 @@
 #import <WebKit/WebResourceLoadDelegate.h>
 #import <WebKit/WebResourcePrivate.h>
 #import <WebKit/WebViewPrivate.h>
+#import <WebKitSystemInterface.h>
 
 static unsigned inNSURLConnectionCallback;
 static BOOL NSURLConnectionSupportsBufferedData;
@@ -216,9 +216,9 @@ static BOOL NSURLConnectionSupportsBufferedData;
 
 - (BOOL)_canUseResourceWithResponse:(NSURLResponse *)theResponse
 {
-    if ([theResponse _mustRevalidate]) {
+    if (WKGetNSURLResponseMustRevalidate(theResponse)) {
         return NO;
-    } else if ([theResponse _calculatedExpiration] - CFAbsoluteTimeGetCurrent() < 1) {
+    } else if (WKGetNSURLResponseCalculatedExpiration(theResponse) - CFAbsoluteTimeGetCurrent() < 1) {
         return NO;
     } else {
         return YES;
index dc20f812fdff3a20a975b638f78588bfc17e024c..b1e25a5b1dab8c886fa215be1a03a6958d09249f 100644 (file)
@@ -34,7 +34,6 @@
 #import <Foundation/NSURLDownloadPrivate.h>
 #import <Foundation/NSURLRequest.h>
 #import <Foundation/NSURLResponse.h>
-#import <Foundation/NSURLResponsePrivate.h>
 
 #import <WebKit/WebDataProtocol.h>
 #import <WebKit/WebDataSourcePrivate.h>
index dc20f812fdff3a20a975b638f78588bfc17e024c..b1e25a5b1dab8c886fa215be1a03a6958d09249f 100644 (file)
@@ -34,7 +34,6 @@
 #import <Foundation/NSURLDownloadPrivate.h>
 #import <Foundation/NSURLRequest.h>
 #import <Foundation/NSURLResponse.h>
-#import <Foundation/NSURLResponsePrivate.h>
 
 #import <WebKit/WebDataProtocol.h>
 #import <WebKit/WebDataSourcePrivate.h>
index 3145c06eb2ab80a5311d9f8c2e079bc3cdb16de5..6faaa4fec3fd927ecd12cf21e374b669e1bd033d 100644 (file)
@@ -79,6 +79,7 @@
 #import <WebKit/WebTextRenderer.h>
 #import <WebKit/WebUIDelegate.h>
 #import <WebKit/WebUIDelegatePrivate.h>
+#import <WebKitSystemInterface.h>
 
 #import <WebCore/WebCoreEncodings.h>
 #import <WebCore/WebCoreSettings.h>
@@ -86,7 +87,6 @@
 
 #import <Foundation/NSURLConnection.h>
 #import <Foundation/NSURLDownloadPrivate.h>
-#import <Foundation/NSURLFileTypeMappings.h>
 
 #if !BUILDING_ON_PANTHER         
 #include <CoreGraphics/CGSConnection.h>
@@ -343,9 +343,8 @@ static bool debugWidget = true;
     NSArray *MIMETypes = [self _supportedMIMETypes];
     NSEnumerator *enumerator = [MIMETypes objectEnumerator];
     NSString *MIMEType;
-    NSURLFileTypeMappings *mappings = [NSURLFileTypeMappings sharedMappings];
     while ((MIMEType = [enumerator nextObject]) != nil) {
-        NSArray *extensionsForType = [mappings extensionsForMIMEType:MIMEType];
+        NSArray *extensionsForType = WKGetExtensionsForMIMEType(MIMEType);
         if (extensionsForType) {
             [extensions addObjectsFromArray:extensionsForType];
         }
@@ -413,7 +412,7 @@ static bool debugWidget = true;
 
 + (NSString *)suggestedFileExtensionForMIMEType:(NSString *)type
 {
-    return [[NSURLFileTypeMappings sharedMappings] preferredExtensionForMIMEType:type];
+    return WKGetPreferredExtensionForMIMEType(type);
 }
 
 - (void)_close
@@ -534,7 +533,7 @@ static bool debugWidget = true;
     
     // Get the MIME type from the extension.
     if ([extension length] != 0) {
-        MIMEType = [[NSURLFileTypeMappings sharedMappings] MIMETypeForExtension:extension];
+        MIMEType = WKGetMIMETypeForExtension(extension);
     }
 
     // If we can't get a known MIME type from the extension, sniff.