Reviewed by Adele.
authormjs <mjs@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 3 Jun 2005 04:16:44 +0000 (04:16 +0000)
committermjs <mjs@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 3 Jun 2005 04:16:44 +0000 (04:16 +0000)
- remove use of NSURLRequest and NSUserDefaults SPI

        * History.subproj/WebHistoryItem.m:
        (-[WebHistoryItem _setFormInfoFromRequest:]):
        * Misc.subproj/WebNSURLRequestExtras.h: Added.
        * Misc.subproj/WebNSURLRequestExtras.m: Added.
        (-[NSURLRequest _web_HTTPReferrer]):
        (-[NSURLRequest _web_HTTPContentType]):
        (-[NSMutableURLRequest _web_setHTTPContentType:]):
        (-[NSMutableURLRequest _web_setHTTPReferrer:]):
        (-[NSMutableURLRequest _web_setHTTPUserAgent:]):
        * Misc.subproj/WebNSUserDefaultsExtras.h: Added.
        * Misc.subproj/WebNSUserDefaultsExtras.m: Added.
        (-[NSString _webkit_HTTPStyleLanguageCode]):
        (makeLock):
        (+[NSUserDefaults _ensureAndLockPreferredLanguageLock]):
        (+[NSUserDefaults _webkit_defaultsDidChange]):
        (addDefaultsChangeObserver):
        (+[NSUserDefaults _webkit_addDefaultsChangeObserver]):
        (+[NSUserDefaults _webkit_preferredLanguageCode]):
        * Plugins.subproj/WebBaseNetscapePluginView.m:
        (-[WebBaseNetscapePluginView requestWithURLCString:]):
        * Plugins.subproj/WebNetscapePluginEmbeddedView.m:
        (-[WebNetscapePluginEmbeddedView didStart]):
        * Plugins.subproj/WebNetscapePluginStream.m:
        (-[WebNetscapePluginStream initWithRequest:pluginPointer:notifyData:sendNotification:]):
        * WebCoreSupport.subproj/WebBridge.m:
        (-[WebBridge createWindowWithURL:frameName:]):
        (-[WebBridge syncLoadResourceWithURL:customHeaders:postData:finalURL:responseHeaders:statusCode:]):
        (-[WebBridge incomingReferrer]):
        (-[WebBridge createModalDialogWithURL:]):
        * WebCoreSupport.subproj/WebSubresourceClient.m:
        (+[WebSubresourceClient startLoadingResource:withRequest:customHeaders:referrer:forDataSource:]):
        * WebCoreSupport.subproj/WebViewFactory.m:
        (-[WebViewFactory defaultLanguageCode]):
        * WebKit.pbproj/project.pbxproj:
        * WebView.subproj/WebBaseResourceHandleDelegate.m:
        (-[WebBaseResourceHandleDelegate willSendRequest:redirectResponse:]):
        * WebView.subproj/WebDefaultContextMenuDelegate.m:
        (-[WebDefaultUIDelegate openNewWindowWithURL:element:]):
        * WebView.subproj/WebFrame.m:
        (-[WebFrame _loadItem:withLoadType:]):
        (-[WebFrame _addExtraFieldsToRequest:alwaysFromRequest:]):
        (-[WebFrame _loadURL:referrer:loadType:target:triggeringEvent:form:formValues:]):
        (-[WebFrame _postWithURL:referrer:target:data:contentType:triggeringEvent:form:formValues:]):
        * WebView.subproj/WebMainResourceClient.m:
        * WebView.subproj/WebView.m:
        (-[WebView _cachedResponseForURL:]):
        (-[WebView userAgentForURL:]):

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

21 files changed:
WebKit/ChangeLog
WebKit/History.subproj/WebHistoryItem.m
WebKit/Misc.subproj/WebNSURLRequestExtras.h [new file with mode: 0644]
WebKit/Misc.subproj/WebNSURLRequestExtras.m [new file with mode: 0644]
WebKit/Misc.subproj/WebNSUserDefaultsExtras.h [new file with mode: 0644]
WebKit/Misc.subproj/WebNSUserDefaultsExtras.m [new file with mode: 0644]
WebKit/Plugins.subproj/WebBaseNetscapePluginView.m
WebKit/Plugins.subproj/WebNetscapePluginEmbeddedView.m
WebKit/Plugins.subproj/WebNetscapePluginStream.m
WebKit/WebCoreSupport.subproj/WebBridge.m
WebKit/WebCoreSupport.subproj/WebSubresourceClient.m
WebKit/WebCoreSupport.subproj/WebSubresourceLoader.m
WebKit/WebCoreSupport.subproj/WebViewFactory.m
WebKit/WebKit.pbproj/project.pbxproj
WebKit/WebView.subproj/WebBaseResourceHandleDelegate.m
WebKit/WebView.subproj/WebDefaultContextMenuDelegate.m
WebKit/WebView.subproj/WebFrame.m
WebKit/WebView.subproj/WebLoader.m
WebKit/WebView.subproj/WebMainResourceClient.m
WebKit/WebView.subproj/WebMainResourceLoader.m
WebKit/WebView.subproj/WebView.m

index de91cec8f20eede1847b29960c41a917046d48c8..7012acca1ba847a9a1db139aba8a19f750146ce1 100644 (file)
@@ -1,3 +1,57 @@
+2005-06-02  Maciej Stachowiak  <mjs@apple.com>
+
+        Reviewed by Adele.
+
+       - remove use of NSURLRequest and NSUserDefaults SPI
+
+        * History.subproj/WebHistoryItem.m:
+        (-[WebHistoryItem _setFormInfoFromRequest:]):
+        * Misc.subproj/WebNSURLRequestExtras.h: Added.
+        * Misc.subproj/WebNSURLRequestExtras.m: Added.
+        (-[NSURLRequest _web_HTTPReferrer]):
+        (-[NSURLRequest _web_HTTPContentType]):
+        (-[NSMutableURLRequest _web_setHTTPContentType:]):
+        (-[NSMutableURLRequest _web_setHTTPReferrer:]):
+        (-[NSMutableURLRequest _web_setHTTPUserAgent:]):
+        * Misc.subproj/WebNSUserDefaultsExtras.h: Added.
+        * Misc.subproj/WebNSUserDefaultsExtras.m: Added.
+        (-[NSString _webkit_HTTPStyleLanguageCode]):
+        (makeLock):
+        (+[NSUserDefaults _ensureAndLockPreferredLanguageLock]):
+        (+[NSUserDefaults _webkit_defaultsDidChange]):
+        (addDefaultsChangeObserver):
+        (+[NSUserDefaults _webkit_addDefaultsChangeObserver]):
+        (+[NSUserDefaults _webkit_preferredLanguageCode]):
+        * Plugins.subproj/WebBaseNetscapePluginView.m:
+        (-[WebBaseNetscapePluginView requestWithURLCString:]):
+        * Plugins.subproj/WebNetscapePluginEmbeddedView.m:
+        (-[WebNetscapePluginEmbeddedView didStart]):
+        * Plugins.subproj/WebNetscapePluginStream.m:
+        (-[WebNetscapePluginStream initWithRequest:pluginPointer:notifyData:sendNotification:]):
+        * WebCoreSupport.subproj/WebBridge.m:
+        (-[WebBridge createWindowWithURL:frameName:]):
+        (-[WebBridge syncLoadResourceWithURL:customHeaders:postData:finalURL:responseHeaders:statusCode:]):
+        (-[WebBridge incomingReferrer]):
+        (-[WebBridge createModalDialogWithURL:]):
+        * WebCoreSupport.subproj/WebSubresourceClient.m:
+        (+[WebSubresourceClient startLoadingResource:withRequest:customHeaders:referrer:forDataSource:]):
+        * WebCoreSupport.subproj/WebViewFactory.m:
+        (-[WebViewFactory defaultLanguageCode]):
+        * WebKit.pbproj/project.pbxproj:
+        * WebView.subproj/WebBaseResourceHandleDelegate.m:
+        (-[WebBaseResourceHandleDelegate willSendRequest:redirectResponse:]):
+        * WebView.subproj/WebDefaultContextMenuDelegate.m:
+        (-[WebDefaultUIDelegate openNewWindowWithURL:element:]):
+        * WebView.subproj/WebFrame.m:
+        (-[WebFrame _loadItem:withLoadType:]):
+        (-[WebFrame _addExtraFieldsToRequest:alwaysFromRequest:]):
+        (-[WebFrame _loadURL:referrer:loadType:target:triggeringEvent:form:formValues:]):
+        (-[WebFrame _postWithURL:referrer:target:data:contentType:triggeringEvent:form:formValues:]):
+        * WebView.subproj/WebMainResourceClient.m:
+        * WebView.subproj/WebView.m:
+        (-[WebView _cachedResponseForURL:]):
+        (-[WebView userAgentForURL:]):
+
 2005-06-02  Maciej Stachowiak  <mjs@apple.com>
 
         Reviewed by Don.
index 32e75adbbd604e4215c0259669cf1f2e530d9fb3..70810b81ef64510b03084c581a3d23d7ebc7c811 100644 (file)
 #import <WebKit/WebNSDictionaryExtras.h>
 #import <WebKit/WebNSObjectExtras.h>
 #import <WebKit/WebNSURLExtras.h>
+#import <WebKit/WebNSURLRequestExtras.h>
 #import <WebKit/WebNSViewExtras.h>
 #import <WebKit/WebPluginController.h>
 
-#import <Foundation/NSURLRequestPrivate.h>
-
 #import <CoreGraphics/CoreGraphicsPrivate.h>
 
 // Private keys used in the WebHistoryItem's dictionary representation.
@@ -465,8 +464,8 @@ NSString *WebHistoryItemChangedNotification = @"WebHistoryItemChangedNotificatio
             [body release];
         }
 
-        newContentType = [[request HTTPContentType] copy];
-        newReferrer = [[request HTTPReferrer] copy];
+        newContentType = [[request _web_HTTPContentType] copy];
+        newReferrer = [[request _web_HTTPReferrer] copy];
     }
 
     [_private->formData release];
diff --git a/WebKit/Misc.subproj/WebNSURLRequestExtras.h b/WebKit/Misc.subproj/WebNSURLRequestExtras.h
new file mode 100644 (file)
index 0000000..2d60522
--- /dev/null
@@ -0,0 +1,22 @@
+/*
+    WebNSURLRequestExtras.h
+    Private (SPI) header
+    Copyright 2003, Apple, Inc. All rights reserved.
+ */
+
+#import <Foundation/Foundation.h>
+
+@interface NSURLRequest (WebNSURLRequestExtras)
+
+- (NSString *)_web_HTTPReferrer;
+- (NSString *)_web_HTTPContentType;
+
+@end
+
+@interface NSMutableURLRequest (WebNSURLRequestExtras)
+
+- (void)_web_setHTTPContentType:(NSString *)contentType;
+- (void)_web_setHTTPReferrer:(NSString *)theReferrer;
+- (void)_web_setHTTPUserAgent:(NSString *)theUserAgent;
+
+@end
diff --git a/WebKit/Misc.subproj/WebNSURLRequestExtras.m b/WebKit/Misc.subproj/WebNSURLRequestExtras.m
new file mode 100644 (file)
index 0000000..2657dd6
--- /dev/null
@@ -0,0 +1,59 @@
+/*
+    WebNSURLRequestExtras.m
+    Private (SPI) header
+    Copyright 2005, Apple, Inc. All rights reserved.
+ */
+
+#import <WebKit/WebNSURLRequestExtras.h>
+
+#import <WebKit/WebAssertions.h>
+#import <WebKit/WebNSURLExtras.h>
+
+#define WebContentType (@"Content-Type")
+#define WebUserAgent   (@"User-Agent")
+#define WebReferrer    (@"Referer")
+
+@implementation NSURLRequest (WebNSURLRequestExtras)
+
+- (NSString *)_web_HTTPReferrer
+{
+    return [self valueForHTTPHeaderField:WebReferrer];
+}
+
+- (NSString *)_web_HTTPContentType
+{
+    return [self valueForHTTPHeaderField:WebContentType];
+}
+
+@end
+
+
+@implementation NSMutableURLRequest (WebNSURLRequestExtras)
+
+- (void)_web_setHTTPContentType:(NSString *)contentType
+{
+    [self setValue:contentType forHTTPHeaderField:WebContentType];
+}
+
+- (void)_web_setHTTPReferrer:(NSString *)theReferrer
+{
+    // Do not set the referrer to a string that refers to a file URL.
+    // That is a potential security hole.
+    if ([theReferrer _webkit_isFileURL]) {
+        return;
+    }
+
+    // Don't allow empty Referer: headers; some servers refuse them
+    if( [theReferrer length] == 0 )
+        theReferrer = nil;
+
+    [self setValue:theReferrer forHTTPHeaderField:WebReferrer];
+}
+
+- (void)_web_setHTTPUserAgent:(NSString *)theUserAgent
+{
+    [self setValue:theUserAgent forHTTPHeaderField:WebUserAgent];
+}
+
+@end
+
diff --git a/WebKit/Misc.subproj/WebNSUserDefaultsExtras.h b/WebKit/Misc.subproj/WebNSUserDefaultsExtras.h
new file mode 100644 (file)
index 0000000..fe72797
--- /dev/null
@@ -0,0 +1,11 @@
+/*
+    WebNSUserDefaultsExtras.h
+    Private (SPI) header
+    Copyright 2003, Apple, Inc. All rights reserved.
+ */
+
+#import <Foundation/Foundation.h>
+
+@interface NSUserDefaults (WebNSUserDefaultsExtras)
++ (NSString *)_webkit_preferredLanguageCode;
+@end
diff --git a/WebKit/Misc.subproj/WebNSUserDefaultsExtras.m b/WebKit/Misc.subproj/WebNSUserDefaultsExtras.m
new file mode 100644 (file)
index 0000000..ee50a08
--- /dev/null
@@ -0,0 +1,111 @@
+/*
+    WebNSUserDefaultsExtras.m
+    Private (SPI) header
+    Copyright 2005, Apple, Inc. All rights reserved.
+ */
+
+#import <WebKit/WebNSUserDefaultsExtras.h>
+
+#import <CoreFoundation/CFBundlePriv.h>
+#import <WebKit/WebAssertions.h>
+
+@implementation NSString (WebNSUserDefaultsPrivate)
+
+- (NSString *)_webkit_HTTPStyleLanguageCode
+{
+    // Look up the language code using CFBundle.
+    NSString *languageCode = self;
+    SInt32 languageCodeNumber, regionCodeNumber;
+    if (CFBundleGetLocalizationInfoForLocalization((CFStringRef)self, &languageCodeNumber, &regionCodeNumber, NULL, NULL)) {
+        CFStringRef shortName = CFMakeCollectable(CFBundleCopyLocalizationForLocalizationInfo(languageCodeNumber, regionCodeNumber, -1, 0xFFFF));
+        if (shortName) {
+            languageCode = [(id)shortName autorelease];
+        }
+    }
+    
+    // Make the string lowercase.
+    NSString *lowercaseLanguageCode = [languageCode lowercaseString];
+    
+    // Turn a '_' into a '-' if it appears after a 2-letter language code.
+    if ([lowercaseLanguageCode length] < 3 || [lowercaseLanguageCode characterAtIndex:2] != '_') {
+        return lowercaseLanguageCode;
+    }
+    NSMutableString *result = [lowercaseLanguageCode mutableCopy];
+    [result replaceCharactersInRange:NSMakeRange(2, 1) withString:@"-"];
+    return [result autorelease];
+}
+
+@end
+
+@implementation NSUserDefaults (WebNSUserDefaultsExtras)
+
+static NSString *preferredLanguageCode = nil;
+static NSLock *preferredLanguageLock = nil;
+static pthread_once_t preferredLanguageLockOnce = PTHREAD_ONCE_INIT;
+static pthread_once_t addDefaultsChangeObserverOnce = PTHREAD_ONCE_INIT;
+
+static void makeLock(void)
+{
+    preferredLanguageLock = [[NSLock alloc] init]; 
+}
+
++ (void)_ensureAndLockPreferredLanguageLock
+{
+    pthread_once(&preferredLanguageLockOnce, makeLock);
+    [preferredLanguageLock lock];
+}
+
++ (void)_webkit_defaultsDidChange
+{
+    [self _ensureAndLockPreferredLanguageLock];
+
+    [preferredLanguageCode release];
+    preferredLanguageCode = nil;
+
+    [preferredLanguageLock unlock];
+}
+
+static void addDefaultsChangeObserver(void)
+{
+    [[NSNotificationCenter defaultCenter] addObserver:[NSUserDefaults class]
+                                             selector:@selector(_webkit_defaultsDidChange)
+                                                 name:NSUserDefaultsDidChangeNotification
+                                               object:[NSUserDefaults standardUserDefaults]];
+}
+
++ (void)_webkit_addDefaultsChangeObserver
+{
+    pthread_once(&addDefaultsChangeObserverOnce, addDefaultsChangeObserver);
+}
+
++ (NSString *)_webkit_preferredLanguageCode
+{
+    // Get this outside the lock since it might block on the defaults lock, while we are inside registerDefaults:.
+    NSUserDefaults *standardDefaults = [self standardUserDefaults];
+
+    BOOL addObserver = NO;
+
+    [self _ensureAndLockPreferredLanguageLock];
+
+    if (!preferredLanguageCode) {
+        NSArray *languages = [standardDefaults stringArrayForKey:@"AppleLanguages"];
+        if ([languages count] == 0) {
+            preferredLanguageCode = [@"en" retain];
+        } else {
+            preferredLanguageCode = [[[languages objectAtIndex:0] _webkit_HTTPStyleLanguageCode] copy];
+        }
+        addObserver = YES;
+    }
+
+    NSString *code = [[preferredLanguageCode retain] autorelease];
+    
+    [preferredLanguageLock unlock];
+
+    if (addObserver) {
+        [self _webkit_addDefaultsChangeObserver];
+    }
+
+    return code;
+}
+
+@end
index f2b9a3b06c5bc282bae41b92fcda380f40504ef3..acac6297e5ad9559e0ab7210def08a6d9a80cb47 100644 (file)
 #import <WebKit/WebNSDictionaryExtras.h>
 #import <WebKit/WebNSObjectExtras.h>
 #import <WebKit/WebNSURLExtras.h>
+#import <WebKit/WebNSURLRequestExtras.h>
 #import <WebKit/WebNSViewExtras.h>
 #import <WebKit/WebNetscapePluginPackage.h>
 #import <WebKit/WebPreferences.h>
 #import <WebKit/WebViewPrivate.h>
 #import <WebKit/WebUIDelegate.h>
 
-#import <Foundation/NSURLRequestPrivate.h>
-
 #import <AppKit/NSEvent_Private.h>
 #import <Carbon/Carbon.h>
 #import <CoreGraphics/CoreGraphicsPrivate.h>
@@ -1351,7 +1350,7 @@ static OSStatus TSMEventHandler(EventHandlerCallRef inHandlerRef, EventRef inEve
         return nil;
     }
     NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:URL];
-    [request setHTTPReferrer:[[[self webFrame] _bridge] referrer]];
+    [request _web_setHTTPReferrer:[[[self webFrame] _bridge] referrer]];
     return request;
 }
 
index b061a629253348da0a8db4ca907af38daa72593e..921cd0eb314b6aa7d148a3b3cec2422e4f43e293 100644 (file)
 #import <WebKit/WebNetscapePluginPackage.h>
 #import <WebKit/WebNSViewExtras.h>
 #import <WebKit/WebNSURLExtras.h>
+#import <WebKit/WebNSURLRequestExtras.h>
 #import <WebKit/WebView.h>
 
-#import <Foundation/NSURLRequestPrivate.h>
-
 @implementation WebNetscapePluginEmbeddedView
 
 - (id)initWithFrame:(NSRect)frame
@@ -59,7 +58,7 @@
     // Check for this and don't start a load in this case.
     if (URL != nil && ![URL _web_isEmpty]) {
         NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:URL];
-        [request setHTTPReferrer:[[[self webFrame] _bridge] referrer]];
+        [request _web_setHTTPReferrer:[[[self webFrame] _bridge] referrer]];
         [self loadRequest:request inTarget:nil withNotifyData:nil sendNotification:NO];
     }
 }
index 3072c6d1f645f0a2f71b7b4dc14d9046e2742534..0beab1103685158158934dd4b8cde6a75991c85e 100644 (file)
 #import <WebKit/WebKitLogging.h>
 #import <WebKit/WebNetscapePluginEmbeddedView.h>
 #import <WebKit/WebNetscapePluginPackage.h>
+#import <WebKit/WebNSURLRequestExtras.h>
 #import <WebKit/WebViewPrivate.h>
 
 #import <Foundation/NSError_NSURLExtras.h>
 #import <Foundation/NSURLConnection.h>
 #import <Foundation/NSURLResponsePrivate.h>
-#import <Foundation/NSURLRequestPrivate.h>
 
 @interface WebNetscapePluginConnectionDelegate : WebBaseResourceHandleDelegate
 {
@@ -59,7 +59,7 @@
         
     request = [theRequest mutableCopy];
     if (hideReferrer) {
-        [(NSMutableURLRequest *)request setHTTPReferrer:nil];
+        [(NSMutableURLRequest *)request _web_setHTTPReferrer:nil];
     }
 
     _loader = [[WebNetscapePluginConnectionDelegate alloc] initWithStream:self view:view]; 
index 3b05a97668e7c306ef90ce28b3a772fab0b1c49b..c9c7d2f0f4f604a368ae28f02e395a3cd12048d6 100644 (file)
@@ -35,6 +35,7 @@
 #import <WebKit/WebNetscapePluginPackage.h>
 #import <WebKit/WebNSObjectExtras.h>
 #import <WebKit/WebNSURLExtras.h>
+#import <WebKit/WebNSURLRequestExtras.h>
 #import <WebKit/WebNullPluginView.h>
 #import <WebKit/WebPlugin.h>
 #import <WebKit/WebPluginController.h>
@@ -51,7 +52,6 @@
 #import <WebKit/WebUIDelegatePrivate.h>
 
 #import <Foundation/NSURLRequest.h>
-#import <Foundation/NSURLRequestPrivate.h>
 #import <Foundation/NSURLConnection.h>
 #import <Foundation/NSURLResponse.h>
 #import <Foundation/NSURLResponsePrivate.h>
@@ -186,7 +186,7 @@ NSString *WebPluginContainerKey =   @"WebPluginContainer";
 
     if (URL != nil && ![URL _web_isEmpty]) {
        request = [NSMutableURLRequest requestWithURL:URL];
-       [request setHTTPReferrer:[self referrer]];
+       [request _web_setHTTPReferrer:[self referrer]];
     }
 
     WebView *currentWebView = [_frame webView];
@@ -490,11 +490,11 @@ NSString *WebPluginContainerKey =   @"WebPluginContainer";
     // Never use cached data for these requests (xmlhttprequests).
     [request setCachePolicy:[[[self dataSource] request] cachePolicy]];
     if (!hideReferrer)
-        [request setHTTPReferrer:[self referrer]];
+        [request _web_setHTTPReferrer:[self referrer]];
     
     WebView *webView = [_frame webView];
     [request setMainDocumentURL:[[[[webView mainFrame] dataSource] request] URL]];
-    [request setHTTPUserAgent:[webView userAgentForURL:[request URL]]];
+    [request _web_setHTTPUserAgent:[webView userAgentForURL:[request URL]]];
     
     NSError *error = nil;
     id identifier = nil;    
@@ -831,7 +831,7 @@ NSString *WebPluginContainerKey =   @"WebPluginContainer";
 
 - (NSString *)incomingReferrer
 {
-    return [[[self dataSource] request] HTTPReferrer];
+    return [[[self dataSource] request] _web_HTTPReferrer];
 }
 
 - (NSView *)pluginViewWithPackage:(WebPluginPackage *)pluginPackage
@@ -1606,7 +1606,7 @@ static NSCharacterSet *_getPostSmartSet(void)
 
     if (URL != nil && ![URL _web_isEmpty]) {
        request = [NSMutableURLRequest requestWithURL:URL];
-       [request setHTTPReferrer:[self referrer]];
+       [request _web_setHTTPReferrer:[self referrer]];
     }
 
     WebView *currentWebView = [_frame webView];
index 9fc1816d8ad3b3d333bb14528cea7b9f6c381943..49bbfe53c79fa580a83ca8642d08d5a97ea2e000 100644 (file)
 #import <WebKit/WebFormDataStream.h>
 #import <WebKit/WebFrame.h>
 #import <WebKit/WebKitErrorsPrivate.h>
+#import <WebKit/WebNSURLRequestExtras.h>
 #import <WebKit/WebViewPrivate.h>
 
 #import <Foundation/NSError_NSURLExtras.h>
-#import <Foundation/NSURLRequestPrivate.h>
 #import <Foundation/NSURLResponse.h>
 
 #import <WebCore/WebCoreResourceLoader.h>
     //    not affect any other resources. Such changes need to be done
     //    per request.
     [newRequest setCachePolicy:[[source _originalRequest] cachePolicy]];
-    [newRequest setHTTPReferrer:referrer];
+    [newRequest _web_setHTTPReferrer:referrer];
     
     WebView *_webView = [source _webView];
     [newRequest setMainDocumentURL:[[[[_webView mainFrame] dataSource] request] URL]];
-    [newRequest setHTTPUserAgent:[_webView userAgentForURL:[newRequest URL]]];
+    [newRequest _web_setHTTPUserAgent:[_webView userAgentForURL:[newRequest URL]]];
             
     if (![client loadWithRequest:newRequest]) {
         client = nil;
index 9fc1816d8ad3b3d333bb14528cea7b9f6c381943..49bbfe53c79fa580a83ca8642d08d5a97ea2e000 100644 (file)
 #import <WebKit/WebFormDataStream.h>
 #import <WebKit/WebFrame.h>
 #import <WebKit/WebKitErrorsPrivate.h>
+#import <WebKit/WebNSURLRequestExtras.h>
 #import <WebKit/WebViewPrivate.h>
 
 #import <Foundation/NSError_NSURLExtras.h>
-#import <Foundation/NSURLRequestPrivate.h>
 #import <Foundation/NSURLResponse.h>
 
 #import <WebCore/WebCoreResourceLoader.h>
     //    not affect any other resources. Such changes need to be done
     //    per request.
     [newRequest setCachePolicy:[[source _originalRequest] cachePolicy]];
-    [newRequest setHTTPReferrer:referrer];
+    [newRequest _web_setHTTPReferrer:referrer];
     
     WebView *_webView = [source _webView];
     [newRequest setMainDocumentURL:[[[[_webView mainFrame] dataSource] request] URL]];
-    [newRequest setHTTPUserAgent:[_webView userAgentForURL:[newRequest URL]]];
+    [newRequest _web_setHTTPUserAgent:[_webView userAgentForURL:[newRequest URL]]];
             
     if (![client loadWithRequest:newRequest]) {
         client = nil;
index e2b2bc5a29f6e318c0c366cab937764a709636fc..c22d4a8ab776741d1b6cad144a0dd14006b78d2f 100644 (file)
@@ -8,12 +8,12 @@
 
 #import <WebKit/WebViewFactory.h>
 
-#import <Foundation/NSUserDefaults_NSURLExtras.h>
 #import <WebKit/WebAssertions.h>
 #import <WebKit/WebBridge.h>
 #import <WebKit/WebControllerSets.h>
 #import <WebKit/WebHTMLViewPrivate.h>
 #import <WebKit/WebLocalizableStrings.h>
+#import <WebKit/WebNSUserDefaultsExtras.h>
 #import <WebKit/WebNSViewExtras.h>
 #import <WebKit/WebPluginDatabase.h>
 
 
 - (NSString *)defaultLanguageCode
 {
-    return [NSUserDefaults _web_preferredLanguageCode];
+    return [NSUserDefaults _webkit_preferredLanguageCode];
 }
 
 @end
index 5a49501f622bdae381a0e5126ba5e1db8438ce51..22303b270ba276245b5c573d834830dbafffba25 100644 (file)
                                ED2B2475033A2DA800C1A526,
                                EDD1A5C605C83987008E3150,
                                EDD1A5C705C83987008E3150,
-                               BE6DC39A04C62C4E004D0EF6,
                                BE6DC39904C62C4E004D0EF6,
+                               BE6DC39A04C62C4E004D0EF6,
+                               65E0F88308500917007E5CB9,
+                               65E0F88208500917007E5CB9,
+                               65E0F9E408500F23007E5CB9,
+                               65E0F9E508500F23007E5CB9,
                                F508946902B71D59018A9CD4,
                                F508946A02B71D59018A9CD4,
                                9345DDAE0365FB27008635CE,
                        refType = 4;
                        sourceTree = "<group>";
                };
+               65E0F88208500917007E5CB9 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       path = WebNSURLRequestExtras.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               65E0F88308500917007E5CB9 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.objc;
+                       path = WebNSURLRequestExtras.m;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               65E0F88408500917007E5CB9 = {
+                       fileRef = 65E0F88208500917007E5CB9;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               65E0F88508500917007E5CB9 = {
+                       fileRef = 65E0F88308500917007E5CB9;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               65E0F9E408500F23007E5CB9 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       path = WebNSUserDefaultsExtras.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               65E0F9E508500F23007E5CB9 = {
+                       fileEncoding = 30;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.objc;
+                       path = WebNSUserDefaultsExtras.m;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               65E0F9E608500F23007E5CB9 = {
+                       fileRef = 65E0F9E408500F23007E5CB9;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               65E0F9E708500F23007E5CB9 = {
+                       fileRef = 65E0F9E508500F23007E5CB9;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
                65E1150307EFFEBF009B8BF7 = {
                        fileEncoding = 30;
                        isa = PBXFileReference;
                                65488DA1084FBCCB00831AD0,
                                65EEDE53084FFB920002DB25,
                                65EEDE57084FFC9E0002DB25,
+                               65E0F88408500917007E5CB9,
+                               65E0F9E608500F23007E5CB9,
                        );
                        isa = PBXHeadersBuildPhase;
                        runOnlyForDeploymentPostprocessing = 0;
                                65488DA2084FBCCB00831AD0,
                                65EEDE54084FFB920002DB25,
                                65EEDE58084FFC9E0002DB25,
+                               65E0F88508500917007E5CB9,
+                               65E0F9E708500F23007E5CB9,
                        );
                        isa = PBXSourcesBuildPhase;
                        runOnlyForDeploymentPostprocessing = 0;
index 169afe72b0d7e051f2566e25b2a53a80a5544a91..ac073c2a45a39a39d2c6baddff50bc5768da0ea4 100644 (file)
@@ -9,7 +9,6 @@
 #import <Foundation/NSURLConnection.h>
 #import <Foundation/NSURLConnectionPrivate.h>
 #import <Foundation/NSURLRequest.h>
-#import <Foundation/NSURLRequestPrivate.h>
 #import <Foundation/NSURLResponse.h>
 #import <Foundation/NSURLResponsePrivate.h>
 #import <Foundation/NSError_NSURLExtras.h>
@@ -20,6 +19,7 @@
 #import <WebKit/WebDefaultResourceLoadDelegate.h>
 #import <WebKit/WebKitErrors.h>
 #import <WebKit/WebKitErrorsPrivate.h>
+#import <WebKit/WebNSURLRequestExtras.h>
 #import <WebKit/WebKitNSStringExtras.h>
 #import <WebKit/WebPreferences.h>
 #import <WebKit/WebPreferencesPrivate.h>
@@ -367,7 +367,7 @@ static BOOL NSURLConnectionSupportsBufferedData;
     // anything including possibly releasing self; one example of this is 3266216
     [self retain];
 
-    [mutableRequest setHTTPUserAgent:[webView userAgentForURL:[newRequest URL]]];
+    [mutableRequest _web_setHTTPUserAgent:[webView userAgentForURL:[newRequest URL]]];
     newRequest = [mutableRequest autorelease];
 
     clientRequest = [newRequest _webDataRequestExternalRequest];
index 0b5c5de1d44473b7cd4da747bade6017826e73e3..cad6f3c026bdc266d9722ed12bf25dfda976a497 100644 (file)
@@ -15,6 +15,7 @@
 #import <WebKit/WebHTMLViewPrivate.h>
 #import <WebKit/WebLocalizableStrings.h>
 #import <WebKit/WebNSPasteboardExtras.h>
+#import <WebKit/WebNSURLRequestExtras.h>
 #import <WebKit/WebFrameView.h>
 #import <WebKit/WebPolicyDelegate.h>
 #import <WebKit/WebViewPrivate.h>
@@ -25,7 +26,6 @@
 
 #import <Foundation/NSURLConnection.h>
 #import <Foundation/NSURLRequest.h>
-#import <Foundation/NSURLRequestPrivate.h>
 
 @implementation WebDefaultUIDelegate (WebContextMenu)
 
@@ -317,7 +317,7 @@ static NSString *localizedMenuTitleFromAppKit(NSString *key, NSString *comment)
     NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:URL];
     NSString *referrer = [[webFrame _bridge] referrer];
     if (referrer) {
-       [request setHTTPReferrer:referrer];
+       [request _web_setHTTPReferrer:referrer];
     }
     
     [webView _openNewWindowWithRequest:request];
index 69adba3994b55071ebf4351143e6846817e36707..bfe88cf2888cacb3a49fd82df0c7f5e46e7a145f 100644 (file)
@@ -29,6 +29,7 @@
 #import <WebKit/WebNetscapePluginEmbeddedView.h>
 #import <WebKit/WebNSObjectExtras.h>
 #import <WebKit/WebNSURLExtras.h>
+#import <WebKit/WebNSURLRequestExtras.h>
 #import <WebKit/WebNullPluginView.h>
 #import <WebKit/WebPreferencesPrivate.h>
 #import <WebKit/WebPlugin.h>
@@ -39,8 +40,6 @@
 #import <WebKit/WebViewInternal.h>
 #import <WebKit/WebUIDelegate.h>
 
-#import <Foundation/NSURLRequestPrivate.h>
-
 #import <objc/objc-runtime.h>
 
 #ifndef NDEBUG
@@ -1381,9 +1380,9 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
             NSDictionary *action;
             if (formData) {
                 [request setHTTPMethod:@"POST"];
-                [request setHTTPReferrer:[item formReferrer]];
+                [request _web_setHTTPReferrer:[item formReferrer]];
                 webSetHTTPBody(request, formData);
-                [request setHTTPContentType:[item formContentType]];
+                [request _web_setHTTPContentType:[item formContentType]];
 
                 // Slight hack to test if the WF cache contains the page we're going to.  We want
                 // to know this before talking to the policy delegate, since it affects whether we
@@ -1808,7 +1807,7 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
 
 - (void)_addExtraFieldsToRequest:(NSMutableURLRequest *)request alwaysFromRequest: (BOOL)f
 {
-    [request setHTTPUserAgent:[[self webView] userAgentForURL:[request URL]]];
+    [request _web_setHTTPUserAgent:[[self webView] userAgentForURL:[request URL]]];
     
     // Don't set the cookie policy URL if it's already been set.
     if ([request mainDocumentURL] == nil){
@@ -1848,7 +1847,7 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
     BOOL isFormSubmission = (values != nil);
 
     NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:URL];
-    [request setHTTPReferrer:referrer];
+    [request _web_setHTTPReferrer:referrer];
     [self _addExtraFieldsToRequest:request alwaysFromRequest: (event != nil || isFormSubmission)];
     if (loadType == WebFrameLoadTypeReload) {
         [request setCachePolicy:NSURLRequestReloadIgnoringCacheData];
@@ -1994,10 +1993,10 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
 
     NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:URL];
     [self _addExtraFieldsToRequest:request alwaysFromRequest:YES];
-    [request setHTTPReferrer:referrer];
+    [request _web_setHTTPReferrer:referrer];
     [request setHTTPMethod:@"POST"];
     webSetHTTPBody(request, postData);
-    [request setHTTPContentType:contentType];
+    [request _web_setHTTPContentType:contentType];
 
     NSDictionary *action = [self _actionInformationForLoadType:WebFrameLoadTypeStandard isFormSubmission:YES event:event originalURL:URL];
     WebFormState *formState = nil;
index 169afe72b0d7e051f2566e25b2a53a80a5544a91..ac073c2a45a39a39d2c6baddff50bc5768da0ea4 100644 (file)
@@ -9,7 +9,6 @@
 #import <Foundation/NSURLConnection.h>
 #import <Foundation/NSURLConnectionPrivate.h>
 #import <Foundation/NSURLRequest.h>
-#import <Foundation/NSURLRequestPrivate.h>
 #import <Foundation/NSURLResponse.h>
 #import <Foundation/NSURLResponsePrivate.h>
 #import <Foundation/NSError_NSURLExtras.h>
@@ -20,6 +19,7 @@
 #import <WebKit/WebDefaultResourceLoadDelegate.h>
 #import <WebKit/WebKitErrors.h>
 #import <WebKit/WebKitErrorsPrivate.h>
+#import <WebKit/WebNSURLRequestExtras.h>
 #import <WebKit/WebKitNSStringExtras.h>
 #import <WebKit/WebPreferences.h>
 #import <WebKit/WebPreferencesPrivate.h>
@@ -367,7 +367,7 @@ static BOOL NSURLConnectionSupportsBufferedData;
     // anything including possibly releasing self; one example of this is 3266216
     [self retain];
 
-    [mutableRequest setHTTPUserAgent:[webView userAgentForURL:[newRequest URL]]];
+    [mutableRequest _web_setHTTPUserAgent:[webView userAgentForURL:[newRequest URL]]];
     newRequest = [mutableRequest autorelease];
 
     clientRequest = [newRequest _webDataRequestExternalRequest];
index ca5dd815fe1ff0d26285b5f46511429bca378d44..bceca60451e649c6f12c6ec306e616e538b2def4 100644 (file)
@@ -11,7 +11,6 @@
 #import <Foundation/NSURLConnectionPrivate.h>
 #import <Foundation/NSURLDownloadPrivate.h>
 #import <Foundation/NSURLRequest.h>
-#import <Foundation/NSURLRequestPrivate.h>
 #import <Foundation/NSURLResponse.h>
 #import <Foundation/NSURLResponsePrivate.h>
 
index ca5dd815fe1ff0d26285b5f46511429bca378d44..bceca60451e649c6f12c6ec306e616e538b2def4 100644 (file)
@@ -11,7 +11,6 @@
 #import <Foundation/NSURLConnectionPrivate.h>
 #import <Foundation/NSURLDownloadPrivate.h>
 #import <Foundation/NSURLRequest.h>
-#import <Foundation/NSURLRequestPrivate.h>
 #import <Foundation/NSURLResponse.h>
 #import <Foundation/NSURLResponsePrivate.h>
 
index 1fe8ea644f5c3f3c81b7d503b04a5828933ac4a9..3d98b2e7cf5cd41d58292f3e5cfa70010d91d22a 100644 (file)
@@ -45,6 +45,8 @@
 #import <WebKit/WebNSPrintOperationExtras.h>
 #import <WebKit/WebNSEventExtras.h>
 #import <WebKit/WebNSURLExtras.h>
+#import <WebKit/WebNSURLRequestExtras.h>
+#import <WebKit/WebNSUserDefaultsExtras.h>
 #import <WebKit/WebNSViewExtras.h>
 #import <WebKit/WebPluginDatabase.h>
 #import <WebKit/WebPolicyDelegate.h>
@@ -63,8 +65,6 @@
 #import <Foundation/NSURLConnection.h>
 #import <Foundation/NSURLDownloadPrivate.h>
 #import <Foundation/NSURLFileTypeMappings.h>
-#import <Foundation/NSURLRequestPrivate.h>
-#import <Foundation/NSUserDefaults_NSURLExtras.h>
 
 #if !BUILDING_ON_PANTHER         
 #include <CoreGraphics/CGSConnection.h>
@@ -1230,7 +1230,7 @@ static bool debugWidget = true;
 - (NSCachedURLResponse *)_cachedResponseForURL:(NSURL *)URL
 {
     NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:URL];
-    [request setHTTPUserAgent:[self userAgentForURL:URL]];
+    [request _web_setHTTPUserAgent:[self userAgentForURL:URL]];
     NSCachedURLResponse *cachedResponse = [[NSURLCache sharedURLCache] cachedResponseForRequest:request];
     [request release];
     return cachedResponse;
@@ -1913,7 +1913,7 @@ NS_ENDHANDLER
     
     // FIXME: Some day we will start reporting the actual CPU here instead of hardcoding PPC.
 
-    NSString *language = [NSUserDefaults _web_preferredLanguageCode];
+    NSString *language = [NSUserDefaults _webkit_preferredLanguageCode];
     id sourceVersion = [[NSBundle bundleForClass:[WebView class]]
         objectForInfoDictionaryKey:(id)kCFBundleVersionKey];
     NSString *applicationName = _private->applicationNameForUserAgent;