Reviewed by Adele.
authormjs <mjs@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 2 Jun 2005 23:54:31 +0000 (23:54 +0000)
committermjs <mjs@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 2 Jun 2005 23:54:31 +0000 (23:54 +0000)
- remove dependencies on NSDictionary and NSURL extras

        * History.subproj/WebHistoryItem.m:
        (-[WebHistoryItem initFromDictionaryRepresentation:]):
        * Misc.subproj/WebKitNSStringExtras.h:
        * Misc.subproj/WebKitNSStringExtras.m:
        (-[NSString _webkit_hasCaseInsensitiveSuffix:]):
        (-[NSString _webkit_hasCaseInsensitiveSubstring:]):
        (-[NSString _webkit_filenameByFixingIllegalCharacters]):
        * Misc.subproj/WebNSDictionaryExtras.h: Added.
        * Misc.subproj/WebNSDictionaryExtras.m: Added.
        (-[NSDictionary _webkit_numberForKey:]):
        (-[NSDictionary _webkit_intForKey:]):
        (-[NSDictionary _webkit_stringForKey:]):
        (-[NSDictionary _webkit_objectForMIMEType:]):
        (-[NSMutableDictionary _webkit_setObject:forUncopiedKey:]):
        (-[NSMutableDictionary _webkit_setInt:forKey:]):
        (-[NSMutableDictionary _webkit_setBool:forKey:]):
        * Misc.subproj/WebNSPasteboardExtras.m:
        * Misc.subproj/WebNSURLExtras.h:
        * Misc.subproj/WebNSURLExtras.m:
        (-[NSURL _webkit_URLByRemovingFragment]):
        (-[NSURL _webkit_scriptIfJavaScriptURL]):
        (-[NSURL _webkit_isFileURL]):
        (-[NSURL _web_hostString]):
        (-[NSURL _webkit_suggestedFilenameWithMIMEType:]):
        * Misc.subproj/WebNSViewExtras.m:
        * Panels.subproj/WebPanelAuthenticationHandler.m:
        * Plugins.subproj/WebBaseNetscapePluginStream.m:
        * Plugins.subproj/WebBaseNetscapePluginView.m:
        (-[WebBaseNetscapePluginView evaluateJavaScriptPluginRequest:]):
        (-[WebBaseNetscapePluginView loadPluginRequest:]):
        (-[WebBaseNetscapePluginView loadRequest:inTarget:withNotifyData:sendNotification:]):
        * Plugins.subproj/WebPluginController.m:
        (-[WebPluginController webPlugInContainerLoadRequest:inFrame:]):
        * WebCoreSupport.subproj/WebBridge.m:
        * WebKit.pbproj/project.pbxproj:
        * WebView.subproj/WebDataSource.m:
        * WebView.subproj/WebFrame.m:
        * WebView.subproj/WebFrameView.m:
        * WebView.subproj/WebHTMLView.m:
        * WebView.subproj/WebPreferences.m:
        (-[WebPreferences _setIntegerValue:forKey:]):
        (-[WebPreferences _setBoolValue:forKey:]):
        * WebView.subproj/WebResource.m:
        (-[WebResource _initWithPropertyList:]):
        (-[WebResource _fileWrapperRepresentation]):
        * WebView.subproj/WebView.m:

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

23 files changed:
WebKit/ChangeLog
WebKit/History.subproj/WebHistoryItem.m
WebKit/Misc.subproj/WebKitNSStringExtras.h
WebKit/Misc.subproj/WebKitNSStringExtras.m
WebKit/Misc.subproj/WebNSDictionaryExtras.h [new file with mode: 0644]
WebKit/Misc.subproj/WebNSDictionaryExtras.m [new file with mode: 0644]
WebKit/Misc.subproj/WebNSPasteboardExtras.m
WebKit/Misc.subproj/WebNSURLExtras.h
WebKit/Misc.subproj/WebNSURLExtras.m
WebKit/Misc.subproj/WebNSViewExtras.m
WebKit/Panels.subproj/WebPanelAuthenticationHandler.m
WebKit/Plugins.subproj/WebBaseNetscapePluginStream.m
WebKit/Plugins.subproj/WebBaseNetscapePluginView.m
WebKit/Plugins.subproj/WebPluginController.m
WebKit/WebCoreSupport.subproj/WebBridge.m
WebKit/WebKit.pbproj/project.pbxproj
WebKit/WebView.subproj/WebDataSource.m
WebKit/WebView.subproj/WebFrame.m
WebKit/WebView.subproj/WebFrameView.m
WebKit/WebView.subproj/WebHTMLView.m
WebKit/WebView.subproj/WebPreferences.m
WebKit/WebView.subproj/WebResource.m
WebKit/WebView.subproj/WebView.m

index 2a2dff92ba06ce748ae02b73468e30602dabbc3c..ebbca9425f24b507ab7bc328ef3446fbcf073eb1 100644 (file)
@@ -1,3 +1,56 @@
+2005-06-02  Maciej Stachowiak  <mjs@apple.com>
+
+        Reviewed by Adele.
+
+       - remove dependencies on NSDictionary and NSURL extras
+
+        * History.subproj/WebHistoryItem.m:
+        (-[WebHistoryItem initFromDictionaryRepresentation:]):
+        * Misc.subproj/WebKitNSStringExtras.h:
+        * Misc.subproj/WebKitNSStringExtras.m:
+        (-[NSString _webkit_hasCaseInsensitiveSuffix:]):
+        (-[NSString _webkit_hasCaseInsensitiveSubstring:]):
+        (-[NSString _webkit_filenameByFixingIllegalCharacters]):
+        * Misc.subproj/WebNSDictionaryExtras.h: Added.
+        * Misc.subproj/WebNSDictionaryExtras.m: Added.
+        (-[NSDictionary _webkit_numberForKey:]):
+        (-[NSDictionary _webkit_intForKey:]):
+        (-[NSDictionary _webkit_stringForKey:]):
+        (-[NSDictionary _webkit_objectForMIMEType:]):
+        (-[NSMutableDictionary _webkit_setObject:forUncopiedKey:]):
+        (-[NSMutableDictionary _webkit_setInt:forKey:]):
+        (-[NSMutableDictionary _webkit_setBool:forKey:]):
+        * Misc.subproj/WebNSPasteboardExtras.m:
+        * Misc.subproj/WebNSURLExtras.h:
+        * Misc.subproj/WebNSURLExtras.m:
+        (-[NSURL _webkit_URLByRemovingFragment]):
+        (-[NSURL _webkit_scriptIfJavaScriptURL]):
+        (-[NSURL _webkit_isFileURL]):
+        (-[NSURL _web_hostString]):
+        (-[NSURL _webkit_suggestedFilenameWithMIMEType:]):
+        * Misc.subproj/WebNSViewExtras.m:
+        * Panels.subproj/WebPanelAuthenticationHandler.m:
+        * Plugins.subproj/WebBaseNetscapePluginStream.m:
+        * Plugins.subproj/WebBaseNetscapePluginView.m:
+        (-[WebBaseNetscapePluginView evaluateJavaScriptPluginRequest:]):
+        (-[WebBaseNetscapePluginView loadPluginRequest:]):
+        (-[WebBaseNetscapePluginView loadRequest:inTarget:withNotifyData:sendNotification:]):
+        * Plugins.subproj/WebPluginController.m:
+        (-[WebPluginController webPlugInContainerLoadRequest:inFrame:]):
+        * WebCoreSupport.subproj/WebBridge.m:
+        * WebKit.pbproj/project.pbxproj:
+        * WebView.subproj/WebDataSource.m:
+        * WebView.subproj/WebFrame.m:
+        * WebView.subproj/WebFrameView.m:
+        * WebView.subproj/WebHTMLView.m:
+        * WebView.subproj/WebPreferences.m:
+        (-[WebPreferences _setIntegerValue:forKey:]):
+        (-[WebPreferences _setBoolValue:forKey:]):
+        * WebView.subproj/WebResource.m:
+        (-[WebResource _initWithPropertyList:]):
+        (-[WebResource _fileWrapperRepresentation]):
+        * WebView.subproj/WebView.m:
+
 2005-06-02  Maciej Stachowiak  <mjs@apple.com>
 
         Reviewed by Vicki.
index d6755d23e20aed4260443804389192df69147a18..32e75adbbd604e4215c0259669cf1f2e530d9fb3 100644 (file)
 #import <WebKit/WebIconLoader.h>
 #import <WebKit/WebKitLogging.h>
 #import <WebKit/WebKitNSStringExtras.h>
+#import <WebKit/WebNSDictionaryExtras.h>
 #import <WebKit/WebNSObjectExtras.h>
 #import <WebKit/WebNSURLExtras.h>
 #import <WebKit/WebNSViewExtras.h>
 #import <WebKit/WebPluginController.h>
 
-#import <Foundation/NSDictionary_NSURLExtras.h>
 #import <Foundation/NSURLRequestPrivate.h>
 
 #import <CoreGraphics/CoreGraphicsPrivate.h>
@@ -574,12 +574,12 @@ NSString *WebHistoryItemChangedNotification = @"WebHistoryItemChangedNotificatio
 
 - (id)initFromDictionaryRepresentation:(NSDictionary *)dict
 {
-    NSString *URLString = [dict _web_stringForKey:@""];
-    NSString *title = [dict _web_stringForKey:WebTitleKey];
+    NSString *URLString = [dict _webkit_stringForKey:@""];
+    NSString *title = [dict _webkit_stringForKey:WebTitleKey];
 
     // Do an existence check to avoid calling doubleValue on a nil string. Leave
     // time interval at 0 if there's no value in dict.
-    NSString *timeIntervalString = [dict _web_stringForKey:WebLastVisitedTimeIntervalKey];
+    NSString *timeIntervalString = [dict _webkit_stringForKey:WebLastVisitedTimeIntervalKey];
     NSTimeInterval lastVisited = timeIntervalString == nil ? 0 : [timeIntervalString doubleValue];
 
     self = [self initWithURLString:URLString title:title lastVisitedTimeInterval:lastVisited];
@@ -595,9 +595,9 @@ NSString *WebHistoryItemChangedNotification = @"WebHistoryItemChangedNotificatio
         _private->originalURLString = [_private->URLString retain];
     }
 
-    [self setAlternateTitle:[dict _web_stringForKey:WebDisplayTitleKey]];
+    [self setAlternateTitle:[dict _webkit_stringForKey:WebDisplayTitleKey]];
 
-    _private->visitCount = [dict _web_intForKey:WebVisitCountKey];
+    _private->visitCount = [dict _webkit_intForKey:WebVisitCountKey];
 
     NSArray *childDicts = [dict objectForKey:WebChildrenKey];
     if (childDicts) {
index a9692d32ed352e356a25c4f3ce0801a16ceef897..241a6aabb91bed7b576daf560e70fcb785047ebf 100644 (file)
@@ -24,6 +24,9 @@
 
 - (BOOL)_webkit_isCaseInsensitiveEqualToString:(NSString *)string;
 - (BOOL)_webkit_hasCaseInsensitivePrefix:(NSString *)suffix;
+- (BOOL)_webkit_hasCaseInsensitiveSuffix:(NSString *)suffix;
+- (BOOL)_webkit_hasCaseInsensitiveSubstring:(NSString *)substring;
+- (NSString *)_webkit_filenameByFixingIllegalCharacters;
 
 - (NSString *)_webkit_stringByTrimmingWhitespace;
 - (NSString *)_webkit_stringByCollapsingNonPrintingCharacters;
index 40091af3b6d437aec6c7e95f2f5a76707e4d5264..a0fde733b00d963df6619129de5f38b8c6a55495 100644 (file)
@@ -192,6 +192,38 @@ static BOOL canUseFastRenderer(const UniChar *buffer, unsigned length)
     return [self rangeOfString:prefix options:(NSCaseInsensitiveSearch | NSAnchoredSearch)].location != NSNotFound;
 }
 
+-(BOOL)_webkit_hasCaseInsensitiveSuffix:(NSString *)suffix
+{
+    return [self rangeOfString:suffix options:(NSCaseInsensitiveSearch | NSBackwardsSearch | NSAnchoredSearch)].location != NSNotFound;
+}
+
+-(BOOL)_webkit_hasCaseInsensitiveSubstring:(NSString *)substring
+{
+    return [self rangeOfString:substring options:NSCaseInsensitiveSearch].location != NSNotFound;
+}
+
+-(NSString *)_webkit_filenameByFixingIllegalCharacters
+{
+    NSMutableString *filename = [[self mutableCopy] autorelease];
+
+    // Strip null characters.
+       unichar nullChar = 0;
+    [filename replaceOccurrencesOfString:[NSString stringWithCharacters:&nullChar length:0] withString:@"" options:0 range:NSMakeRange(0, [filename length])];
+
+    // Replace "/" with "-".
+    [filename replaceOccurrencesOfString:@"/" withString:@"-" options:0 range:NSMakeRange(0, [filename length])];
+
+    // Replace ":" with "-".
+    [filename replaceOccurrencesOfString:@":" withString:@"-" options:0 range:NSMakeRange(0, [filename length])];
+    
+    // Strip leading dots.
+    while ([filename hasPrefix:@"."]) {
+        [filename deleteCharactersInRange:NSMakeRange(0,1)];
+    }
+    
+    return filename;
+}
+
 -(NSString *)_webkit_stringByTrimmingWhitespace
 {
     NSMutableString *trimmed = [[self mutableCopy] autorelease];
diff --git a/WebKit/Misc.subproj/WebNSDictionaryExtras.h b/WebKit/Misc.subproj/WebNSDictionaryExtras.h
new file mode 100644 (file)
index 0000000..24ce137
--- /dev/null
@@ -0,0 +1,22 @@
+/*
+    WebNSURLExtras.h
+    Private (SPI) header
+    Copyright 2003, Apple, Inc. All rights reserved.
+ */
+
+#import <Foundation/Foundation.h>
+
+@interface NSDictionary (WebNSDictionaryExtras)
+- (int)_webkit_intForKey:(id)key;
+- (NSString *)_webkit_stringForKey:(id)key; // Returns nil if the value is not an NSString.
+
+// Searches for the full MIME type, then the prefix (e.g., "text/" for "text/html")
+- (id)_webkit_objectForMIMEType:(NSString *)MIMEType;
+@end
+
+@interface NSMutableDictionary (WebNSDictionaryExtras)
+- (void)_webkit_setObject:(id)object forUncopiedKey:(id)key;
+- (void)_webkit_setInt:(int)value forKey:(id)key;
+- (void)_webkit_setBool:(BOOL)value forKey:(id)key;
+@end
+
diff --git a/WebKit/Misc.subproj/WebNSDictionaryExtras.m b/WebKit/Misc.subproj/WebNSDictionaryExtras.m
new file mode 100644 (file)
index 0000000..346e6e5
--- /dev/null
@@ -0,0 +1,71 @@
+/*
+    WebNSDataExtras.m
+    Private (SPI) header
+    Copyright 2003, Apple, Inc. All rights reserved.
+ */
+
+#import <WebKit/WebNSDataExtras.h>
+
+#import <WebKit/WebAssertions.h>
+
+@implementation NSDictionary (WebNSDictionaryExtras)
+-(NSNumber *)_webkit_numberForKey:(id)key
+{
+    id object = [self objectForKey:key];
+    return [object isKindOfClass:[NSNumber class]] ? object : nil;
+}
+
+-(int)_webkit_intForKey:(NSString *)key
+{
+    NSNumber *number = [self _webkit_numberForKey:key];
+    return number == nil ? 0 : [number intValue];
+}
+
+-(NSString *)_webkit_stringForKey:(id)key
+{
+    id object = [self objectForKey:key];
+    return [object isKindOfClass:[NSString class]] ? object : nil;
+}
+
+-(id)_webkit_objectForMIMEType:(NSString *)MIMEType
+{
+    id result;
+    NSRange slashRange;
+    
+    result = [self objectForKey:MIMEType];
+    if (result) {
+        return result;
+    }
+    
+    slashRange = [MIMEType rangeOfString:@"/"];
+    if (slashRange.location == NSNotFound) {
+        return nil;
+    }
+    
+    return [self objectForKey:[MIMEType substringToIndex:slashRange.location + 1]];
+}
+
+@end
+
+@implementation NSMutableDictionary (WebNSDictionaryExtras)
+-(void)_webkit_setObject:(id)object forUncopiedKey:(id)key
+{
+    CFDictionarySetValue((CFMutableDictionaryRef)self, key, object);
+}
+
+-(void)_webkit_setInt:(int)value forKey:(id)key
+{
+    NSNumber *object = [[NSNumber alloc] initWithInt:value];
+    [self setObject:object forKey:key];
+    [object release];
+}
+
+-(void)_webkit_setBool:(BOOL)value forKey:(id)key
+{
+    NSNumber *object = [[NSNumber alloc] initWithBool:value];
+    [self setObject:object forKey:key];
+    [object release];
+}
+
+@end
+
index 95127fb93f296ca0da817ace51ec00ae7ff4c22b..cb00a659703b0b7e6557b2479b71be178874c38c 100644 (file)
@@ -17,7 +17,6 @@
 #import <WebKit/WebURLsWithTitles.h>
 #import <WebKit/WebViewPrivate.h>
 
-#import <Foundation/NSURL_NSURLExtras.h>
 #import <Foundation/NSURLFileTypeMappings.h>
 
 #import <HIServices/CoreTranslationFlavorTypeNames.h>
index bbbf69cbfd931aa3c892fff924bc91d1cedb8b39..fe22cb2ad1b938d5e94a44aaae67f2161c08dd5e 100644 (file)
@@ -42,6 +42,8 @@
 
 - (BOOL)_webkit_shouldLoadAsEmptyDocument;
 
+- (NSString *)_webkit_suggestedFilenameWithMIMEType:(NSString *)MIMEType;
+
 @end
 
 @interface NSString (WebNSURLExtras)
 // FIXME: change these names back to _web_ when identically-named
 // methods are removed from or renamed in Foundation
 - (BOOL)_webkit_isJavaScriptURL;
-- (NSString *)_webkit_scriptIfJavaScriptURL;
 - (BOOL)_webkit_isFTPDirectoryURL;
 - (BOOL)_webkit_isFileURL;
 - (BOOL)_webkit_looksLikeAbsoluteURL;
 - (NSString *)_webkit_URLFragment;
+- (NSString *)_webkit_scriptIfJavaScriptURL;
 
 @end
index a9ceeffb3b6473fb705bef94709a39c93372e58e..2597e479bf08f20b56f00c84a92bbc2096818a81 100644 (file)
 #import <WebKit/WebKitNSStringExtras.h>
 #import <WebKit/WebNSDataExtras.h>
 #import <WebKit/WebNSObjectExtras.h>
+#import <WebKit/WebLocalizableStrings.h>
 
 #import <Foundation/NSURLProtocolPrivate.h>
 #import <Foundation/NSURLRequest.h>
-#import <Foundation/NSURL_NSURLExtras.h>
+#import <Foundation/NSURLFileTypeMappings.h>
 
 #import <unicode/uchar.h>
 #import <unicode/uidna.h>
@@ -508,19 +509,43 @@ static NSString *mapHostNames(NSString *string, BOOL encode)
     return result;
 }
 
+typedef struct {
+    NSString *scheme;
+    NSString *user;
+    NSString *password;
+    NSString *host;
+    CFIndex port; // kCFNotFound means ignore/omit
+    NSString *path;
+    NSString *query;
+    NSString *fragment;
+} WebKitURLComponents;
+
+
+
 - (NSURL *)_webkit_URLByRemovingFragment
 {
+    CFRange fragRg = CFURLGetByteRangeForComponent((CFURLRef)self, kCFURLComponentFragment, NULL);
     // Check to see if a fragment exists before decomposing the URL.
-    CFStringRef frag = CFURLCopyFragment((CFURLRef)self, NULL);
-    if (!frag) {
+    if (fragRg.location == kCFNotFound) {
         return self;
     }
-    CFRelease(frag);
-    
-    WebURLComponents components = [self _web_URLComponents];
-    components.fragment = nil;
-    NSURL *result = [NSURL _web_URLWithComponents:components];
-    return result ? result : self;
+    UInt8 *urlBytes, buffer[2048];
+    CFIndex numBytes = CFURLGetBytes((CFURLRef)self, buffer, 2048);
+    if (numBytes == -1) {
+        numBytes = CFURLGetBytes((CFURLRef)self, NULL, 0);
+        urlBytes = malloc(numBytes);
+        CFURLGetBytes((CFURLRef)self, urlBytes, numBytes);
+    } else {
+        urlBytes = buffer;
+    }
+
+    NSURL *result = (NSURL *)CFMakeCollectable(CFURLCreateWithBytes(NULL, urlBytes, fragRg.location - 1, kCFStringEncodingUTF8, NULL));
+    if (!result) {
+        result = (NSURL *)CFMakeCollectable(CFURLCreateWithBytes(NULL, urlBytes, fragRg.location - 1, kCFStringEncodingISOLatin1, NULL));
+    }
+
+    if (urlBytes != buffer) free(urlBytes);
+    return result ? [result autorelease] : self;
 }
 
 - (BOOL)_webkit_isJavaScriptURL
@@ -528,14 +553,14 @@ static NSString *mapHostNames(NSString *string, BOOL encode)
     return [[self _web_originalDataAsString] _webkit_isJavaScriptURL];
 }
 
-- (BOOL)_webkit_isFileURL
+- (NSString *)_webkit_scriptIfJavaScriptURL
 {
-    return [[self _web_originalDataAsString] _webkit_isFileURL];
+    return [[self absoluteString] _webkit_scriptIfJavaScriptURL];
 }
 
-- (NSString *)_webkit_scriptIfJavaScriptURL
+- (BOOL)_webkit_isFileURL
 {
-    return [[self _web_originalDataAsString] _webkit_scriptIfJavaScriptURL];
+    return [[self _web_originalDataAsString] _webkit_isFileURL];
 }
 
 - (BOOL)_webkit_isFTPDirectoryURL
@@ -703,6 +728,56 @@ static NSString *mapHostNames(NSString *string, BOOL encode)
     return [[[NSString alloc] initWithData:[self _web_hostData] encoding:NSUTF8StringEncoding] autorelease];
 }
 
+- (NSString *)_webkit_suggestedFilenameWithMIMEType:(NSString *)MIMEType
+{
+    // Get the filename from the URL. Try the lastPathComponent first.
+    NSString *lastPathComponent = [[self path] lastPathComponent];
+    NSString *filename = [lastPathComponent _webkit_filenameByFixingIllegalCharacters];
+    NSString *extension = nil;
+
+    if ([filename length] == 0 || [lastPathComponent isEqualToString:@"/"]) {
+        // lastPathComponent is no good, try the host.
+        filename = [[self _web_hostString] _webkit_filenameByFixingIllegalCharacters];
+        if ([filename length] == 0) {
+            // Can't make a filename using this URL, use "unknown".
+            filename = UI_STRING("unknown", "Unknown filename");
+        }
+    } else {
+        // Save the extension for later correction. Only correct the extension of the lastPathComponent.
+        // For example, if the filename ends up being the host, we wouldn't want to correct ".com" in "www.apple.com".
+        extension = [filename pathExtension];
+    }
+
+    // No mime type reported. Just return the filename we have now.
+    if (!MIMEType) {
+        return filename;
+    }
+
+    // Do not correct filenames that are reported with a mime type of tar, and 
+    // have a filename which has .tar in it or ends in .tgz
+    if (([MIMEType isEqualToString:@"application/tar"] || [MIMEType isEqualToString:@"application/x-tar"]) &&
+        ([filename _webkit_hasCaseInsensitiveSubstring:@".tar"] || [filename _webkit_hasCaseInsensitiveSuffix:@".tgz"])) {
+        return filename;
+    }
+
+    // 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];
+
+        if (![extension length] || (extensions && ![extensions containsObject:extension])) {
+            // The extension doesn't match the MIME type. Correct this.
+            NSString *correctExtension = [mappings preferredExtensionForMIMEType:MIMEType];
+            if ([correctExtension length] != 0) {
+                // Append the correct extension.
+                filename = [filename stringByAppendingPathExtension:correctExtension];
+            }
+        }
+    }
+
+    return filename;
+}
+
 @end
 
 @implementation NSString (WebNSURLExtras)
index a26b4fa7d9fde2fb24ca4dd028aabdd166ba0de8..771f1e68e7dad1a5d4b992ac0ca384b42b47acbf 100644 (file)
@@ -13,7 +13,6 @@
 #import <WebKit/WebNSPasteboardExtras.h>
 #import <WebKit/WebNSURLExtras.h>
 
-#import <Foundation/NSURL_NSURLExtras.h>
 #import <Foundation/NSURLFileTypeMappings.h>
 
 #define WebDragStartHysteresisX                        5.0
index 718390f054641aeea40eaa8bb566218bc971a504..045416808efbed346207917c8eee78ff798bd4e6 100644 (file)
@@ -6,24 +6,14 @@
 
 
 #import <WebKit/WebPanelAuthenticationHandler.h>
-#import <WebKit/WebAuthenticationPanel.h>
+
 #import <Foundation/NSURLAuthenticationChallenge.h>
+#import <WebKit/WebAuthenticationPanel.h>
 #import <WebKit/WebAssertions.h>
+#import <WebKit/WebNSDictionaryExtras.h>
 
 static NSString *WebModalDialogPretendWindow = @"WebModalDialogPretendWindow";
 
-@interface NSMutableDictionary (WebExtras)
-- (void)_webkit_setObject:(id)object forUncopiedKey:(id)key;
-@end
-
-@implementation NSMutableDictionary (WebExtras)
--(void)_webkit_setObject:(id)object forUncopiedKey:(id)key
-{
-    CFDictionarySetValue((CFMutableDictionaryRef)self, key, object);
-}
-@end
-
-
 @implementation WebPanelAuthenticationHandler
 
 WebPanelAuthenticationHandler *sharedHandler;
index 1939a76b43e83d48bc309c37bd10265e644b52f9..0791367de3709f4b3d3e54e044cdf12dfc92cc56 100644 (file)
@@ -15,7 +15,6 @@
 #import <Foundation/NSURLResponse.h>
 #import <Foundation/NSURLResponsePrivate.h>
 #import <Foundation/NSFileManager_NSURLExtras.h>
-#import <Foundation/NSURL_NSURLExtras.h>
 
 static const char *CarbonPathFromPOSIXPath(const char *posixPath);
 
index 1662ba1429ee7dfd667e1db1ecc7a05a30b19c98..f2b9a3b06c5bc282bae41b92fcda380f40504ef3 100644 (file)
@@ -16,6 +16,7 @@
 #import <WebKit/WebNetscapePluginStream.h>
 #import <WebKit/WebNullPluginView.h>
 #import <WebKit/WebNSDataExtras.h>
+#import <WebKit/WebNSDictionaryExtras.h>
 #import <WebKit/WebNSObjectExtras.h>
 #import <WebKit/WebNSURLExtras.h>
 #import <WebKit/WebNSViewExtras.h>
@@ -24,8 +25,6 @@
 #import <WebKit/WebViewPrivate.h>
 #import <WebKit/WebUIDelegate.h>
 
-#import <Foundation/NSDictionary_NSURLExtras.h>
-#import <Foundation/NSURL_NSURLExtras.h>
 #import <Foundation/NSURLRequestPrivate.h>
 
 #import <AppKit/NSEvent_Private.h>
@@ -1366,7 +1365,7 @@ static OSStatus TSMEventHandler(EventHandlerCallRef inHandlerRef, EventRef inEve
     }
     
     NSURL *URL = [[JSPluginRequest request] URL];
-    NSString *JSString = [URL _web_scriptIfJavaScriptURL];
+    NSString *JSString = [URL _webkit_scriptIfJavaScriptURL];
     ASSERT(JSString);
     
     NSString *result = [[[self webFrame] _bridge] stringByEvaluatingJavaScriptFromString:JSString forceUserGesture:[JSPluginRequest isCurrentEventUserGesture]];
@@ -1429,7 +1428,7 @@ static OSStatus TSMEventHandler(EventHandlerCallRef inHandlerRef, EventRef inEve
     WebFrame *frame = nil;
     
     NSURL *URL = [request URL];
-    NSString *JSString = [URL _web_scriptIfJavaScriptURL];
+    NSString *JSString = [URL _webkit_scriptIfJavaScriptURL];
     
     ASSERT(frameName || JSString);
     
@@ -1467,7 +1466,7 @@ static OSStatus TSMEventHandler(EventHandlerCallRef inHandlerRef, EventRef inEve
                 ASSERT([view isKindOfClass:[WebBaseNetscapePluginView class]]);
                 [view webFrame:frame didFinishLoadWithReason:NPRES_USER_BREAK];
             }
-            [pendingFrameLoads _web_setObject:pluginRequest forUncopiedKey:frame];
+            [pendingFrameLoads _webkit_setObject:pluginRequest forUncopiedKey:frame];
             [frame _setInternalLoadDelegate:self];
         }
     }
@@ -1481,7 +1480,7 @@ static OSStatus TSMEventHandler(EventHandlerCallRef inHandlerRef, EventRef inEve
         return NPERR_INVALID_URL;
     }
     
-    NSString *JSString = [URL _web_scriptIfJavaScriptURL];
+    NSString *JSString = [URL _webkit_scriptIfJavaScriptURL];
     if (JSString != nil) {
         if (![[[self webView] preferences] isJavaScriptEnabled]) {
             // Return NPERR_GENERIC_ERROR if JS is disabled. This is what Mozilla does.
index 9f21ca5d80f66780a3ac890b63f78881478d91da..8e09e15b5870fcea26271c69d354029fc52d0f0e 100644 (file)
@@ -13,6 +13,7 @@
 #import <WebKit/WebFrameView.h>
 #import <WebKit/WebHTMLViewPrivate.h>
 #import <WebKit/WebKitLogging.h>
+#import <WebKit/WebNSURLExtras.h>
 #import <WebKit/WebNSViewExtras.h>
 #import <WebKit/WebPlugin.h>
 #import <WebKit/WebPluginContainer.h>
@@ -24,7 +25,6 @@
 
 #import <WebCore/WebCoreBridge.h>
 
-#import <Foundation/NSURL_NSURLExtras.h>
 #import <Foundation/NSURLRequest.h>
 
 @interface NSView (PluginSecrets)
@@ -228,7 +228,7 @@ static NSMutableSet *pluginViews = nil;
     if (!target) {
         target = @"_top";
     }
-    NSString *JSString = [[request URL] _web_scriptIfJavaScriptURL];
+    NSString *JSString = [[request URL] _webkit_scriptIfJavaScriptURL];
     if (JSString) {
         if ([frame findFrameNamed:target] != frame) {
             ERROR("JavaScript requests can only be made on the frame that contains the plug-in");
index 655e990dc6d185cbeb0bd30c5baed569d0feec3d..3b05a97668e7c306ef90ce28b3a772fab0b1c49b 100644 (file)
@@ -52,7 +52,6 @@
 
 #import <Foundation/NSURLRequest.h>
 #import <Foundation/NSURLRequestPrivate.h>
-#import <Foundation/NSDictionary_NSURLExtras.h>
 #import <Foundation/NSURLConnection.h>
 #import <Foundation/NSURLResponse.h>
 #import <Foundation/NSURLResponsePrivate.h>
index e646c203fe54937aba3df4295efa520f7cdc6197..dd818774dc88f5fa81ff4255ea89c6584ed4d154 100644 (file)
 //254
                254DC334016E1D3F0ECA149E = {
                        children = (
+                               65488D9F084FBCCB00831AD0,
+                               65488DA0084FBCCB00831AD0,
                                3944607A020F50ED0ECA1767,
                                3944607B020F50ED0ECA1767,
                                F528E3E9031E91AD01CA2ACA,
                        refType = 4;
                        sourceTree = "<group>";
                };
+               65488D9F084FBCCB00831AD0 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       path = WebNSDictionaryExtras.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               65488DA0084FBCCB00831AD0 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.objc;
+                       path = WebNSDictionaryExtras.m;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               65488DA1084FBCCB00831AD0 = {
+                       fileRef = 65488D9F084FBCCB00831AD0;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               65488DA2084FBCCB00831AD0 = {
+                       fileRef = 65488DA0084FBCCB00831AD0;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
                6578F5DE045F817400000128 = {
                        fileEncoding = 30;
                        isa = PBXFileReference;
                                939810AF0824BF01008DF038,
                                939810B00824BF01008DF038,
                                939810B10824BF01008DF038,
+                               65488DA1084FBCCB00831AD0,
                        );
                        isa = PBXHeadersBuildPhase;
                        runOnlyForDeploymentPostprocessing = 0;
                                939811240824BF01008DF038,
                                939811250824BF01008DF038,
                                939811260824BF01008DF038,
+                               65488DA2084FBCCB00831AD0,
                        );
                        isa = PBXSourcesBuildPhase;
                        runOnlyForDeploymentPostprocessing = 0;
index ce80d972ba3a96b0ef1c981aba7204cb8efb86d2..f743ef87d02e4c202365ceed7dac9057bf8f1899 100644 (file)
@@ -41,7 +41,6 @@
 #import <WebKit/WebTextRepresentation.h>
 #import <WebKit/WebViewPrivate.h>
 
-#import <Foundation/NSDictionary_NSURLExtras.h>
 #import <Foundation/NSURLConnection.h>
 #import <Foundation/NSURLRequest.h>
 #import <Foundation/NSURLResponsePrivate.h>
index 64d99a1d8366d322a50ff28aba71b57b3688cfdc..69adba3994b55071ebf4351143e6846817e36707 100644 (file)
@@ -39,7 +39,6 @@
 #import <WebKit/WebViewInternal.h>
 #import <WebKit/WebUIDelegate.h>
 
-#import <Foundation/NSDictionary_NSURLExtras.h>
 #import <Foundation/NSURLRequestPrivate.h>
 
 #import <objc/objc-runtime.h>
index 04676b1ffdf2ea52c8023602e565c57b1de35689..962dea55754312755ff04bc041c33322489e5a17 100644 (file)
@@ -36,7 +36,6 @@
 #import <WebCore/WebCoreFrameView.h>
 #import <WebCore/WebCoreView.h>
 
-#import <Foundation/NSDictionary_NSURLExtras.h>
 #import <Foundation/NSURLRequest.h>
 
 @interface NSClipView (AppKitSecretsIKnow)
index 749797bdfa98e574068729365e11529b376b0dff..930afbf38d621c5cf692bca7710edb929565e58b 100644 (file)
@@ -49,7 +49,6 @@
 #import <AppKit/NSResponder_Private.h>
 
 #import <Foundation/NSFileManager_NSURLExtras.h>
-#import <Foundation/NSURL_NSURLExtras.h>
 #import <Foundation/NSURLFileTypeMappings.h>
 
 #import <CoreGraphics/CGContextGState.h>
index eac4aea1ac8cbc8076e80b376f09b0c6e7a83405..7464354c92c08ae8ab76342773a95f10b01ab48c 100644 (file)
@@ -8,10 +8,9 @@
 
 #import <WebKit/WebKitLogging.h>
 #import <WebKit/WebKitNSStringExtras.h>
+#import <WebKit/WebNSDictionaryExtras.h>
 #import <WebKit/WebNSURLExtras.h>
 
-#import <Foundation/NSDictionary_NSURLExtras.h>
-
 #import <WebCore/WebCoreSettings.h>
 
 #import <Carbon/Carbon.h>                           // For TEC
@@ -257,7 +256,7 @@ NS_ENDHANDLER
 - (void)_setIntegerValue:(int)value forKey:(NSString *)key
 {
     NSString *_key = KEY(key);
-    [_private->values _web_setInt:value forKey:_key];
+    [_private->values _webkit_setInt:value forKey:_key];
     if (_private->autosaves)
         [[NSUserDefaults standardUserDefaults] setInteger:value forKey:_key];
     [self _postPreferencesChangesNotification];
@@ -271,7 +270,7 @@ NS_ENDHANDLER
 - (void)_setBoolValue:(BOOL)value forKey:(NSString *)key
 {
     NSString *_key = KEY(key);
-    [_private->values _web_setBool:value forKey:_key];
+    [_private->values _webkit_setBool:value forKey:_key];
     if (_private->autosaves)
         [[NSUserDefaults standardUserDefaults] setBool:value forKey:_key];
     [self _postPreferencesChangesNotification];
index c5ff886c40ae5d0056fd626633196606204d6a9b..5c001358915e0a0ea593dd31de079b4bd52ec2ef 100644 (file)
@@ -4,11 +4,9 @@
 */
 #import <WebKit/WebBridge.h>
 #import <WebKit/WebResourcePrivate.h>
+#import <WebKit/WebNSDictionaryExtras.h>
 #import <WebKit/WebNSURLExtras.h>
 
-#import <Foundation/NSDictionary_NSURLExtras.h>
-#import <Foundation/NSURL_NSURLExtras.h>
-
 NSString *WebResourceDataKey =              @"WebResourceData";
 NSString *WebResourceFrameNameKey =         @"WebResourceFrameName";
 NSString *WebResourceMIMETypeKey =          @"WebResourceMIMEType";
@@ -225,12 +223,12 @@ NSString *WebResourceResponseKey =          @"WebResourceResponse";
     }
 
     NSData *data = [propertyList objectForKey:WebResourceDataKey];
-    NSString *URLString = [propertyList _web_stringForKey:WebResourceURLKey];
+    NSString *URLString = [propertyList _webkit_stringForKey:WebResourceURLKey];
     return [self _initWithData:[data isKindOfClass:[NSData class]] ? data : nil
                            URL:URLString ? [NSURL _web_URLWithDataAsString:URLString] : nil
-                      MIMEType:[propertyList _web_stringForKey:WebResourceMIMETypeKey]
-              textEncodingName:[propertyList _web_stringForKey:WebResourceTextEncodingNameKey]
-                     frameName:[propertyList _web_stringForKey:WebResourceFrameNameKey]
+                      MIMEType:[propertyList _webkit_stringForKey:WebResourceMIMETypeKey]
+              textEncodingName:[propertyList _webkit_stringForKey:WebResourceTextEncodingNameKey]
+                     frameName:[propertyList _webkit_stringForKey:WebResourceFrameNameKey]
                       response:response
                       copyData:NO];
 }
@@ -238,7 +236,7 @@ NSString *WebResourceResponseKey =          @"WebResourceResponse";
 - (NSFileWrapper *)_fileWrapperRepresentation
 {
     NSFileWrapper *wrapper = [[[NSFileWrapper alloc] initRegularFileWithContents:_private->data] autorelease];
-    [wrapper setPreferredFilename:[_private->URL _web_suggestedFilenameWithMIMEType:_private->MIMEType]];
+    [wrapper setPreferredFilename:[_private->URL _webkit_suggestedFilenameWithMIMEType:_private->MIMEType]];
     return wrapper;
 }
 
index a85a2ef94e1497995587cd1c69986f6a1f57f386..1fe8ea644f5c3f3c81b7d503b04a5828933ac4a9 100644 (file)
@@ -39,6 +39,7 @@
 #import <WebKit/WebKitNSStringExtras.h>
 #import <WebKit/WebKitStatisticsPrivate.h>
 #import <WebKit/WebNSDataExtras.h>
+#import <WebKit/WebNSDictionaryExtras.h>
 #import <WebKit/WebNSObjectExtras.h>
 #import <WebKit/WebNSPasteboardExtras.h>
 #import <WebKit/WebNSPrintOperationExtras.h>
@@ -59,7 +60,6 @@
 #import <WebCore/WebCoreSettings.h>
 #import <WebCore/WebCoreView.h>
 
-#import <Foundation/NSDictionary_NSURLExtras.h>
 #import <Foundation/NSURLConnection.h>
 #import <Foundation/NSURLDownloadPrivate.h>
 #import <Foundation/NSURLFileTypeMappings.h>
@@ -341,8 +341,8 @@ static bool debugWidget = true;
     
     // Simple optimization that avoids loading the plug-in DB and image types for the HTML case.
     if ([self canShowMIMETypeAsHTML:MIMEType]) {
-        viewClass = [[WebFrameView _viewTypesAllowImageTypeOmission:YES] _web_objectForMIMEType:MIMEType];
-        repClass = [[WebDataSource _repTypesAllowImageTypeOmission:YES] _web_objectForMIMEType:MIMEType];
+        viewClass = [[WebFrameView _viewTypesAllowImageTypeOmission:YES] _webkit_objectForMIMEType:MIMEType];
+        repClass = [[WebDataSource _repTypesAllowImageTypeOmission:YES] _webkit_objectForMIMEType:MIMEType];
         if (viewClass && repClass) {
             if (vClass) {
                 *vClass = viewClass;
@@ -358,8 +358,8 @@ static bool debugWidget = true;
     [WebPluginDatabase installedPlugins];
         
     // Load the image types and get the view class and rep class. This should be the fullest picture of all handled types.
-    viewClass = [[WebFrameView _viewTypesAllowImageTypeOmission:NO] _web_objectForMIMEType:MIMEType];
-    repClass = [[WebDataSource _repTypesAllowImageTypeOmission:NO] _web_objectForMIMEType:MIMEType];
+    viewClass = [[WebFrameView _viewTypesAllowImageTypeOmission:NO] _webkit_objectForMIMEType:MIMEType];
+    repClass = [[WebDataSource _repTypesAllowImageTypeOmission:NO] _webkit_objectForMIMEType:MIMEType];
     if (viewClass && repClass) {
         // Special-case WebTextView for text types that shouldn't be shown.
         if (viewClass == [WebTextView class] &&
@@ -1054,7 +1054,7 @@ static bool debugWidget = true;
     if (!_private->progressItems)
         _private->progressItems = [[NSMutableDictionary alloc] init];
         
-    [_private->progressItems _web_setObject:item forUncopiedKey:connectionDelegate];
+    [_private->progressItems _webkit_setObject:item forUncopiedKey:connectionDelegate];
     [item release];
 }