WebCore:
authormjs <mjs@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 13 Oct 2006 05:22:05 +0000 (05:22 +0000)
committermjs <mjs@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 13 Oct 2006 05:22:05 +0000 (05:22 +0000)
        Reviewed by Oliver.

        - moved a bunch of WebFrameBridge code down to WebCoreFrameBridge, now that it no longer has any WebKit dependencies

        * WebCore.xcodeproj/project.pbxproj:
        * bridge/mac/WebCoreFrameBridge.h:
        * bridge/mac/WebCoreFrameBridge.mm:
        (stringByCollapsingNonPrintingCharacters):
        (-[WebCoreFrameBridge setTitle:]):
        (-[WebCoreFrameBridge didFirstLayout]):
        (-[WebCoreFrameBridge notifyIconChanged:]):
        (-[WebCoreFrameBridge originalRequestURL]):
        (-[WebCoreFrameBridge isLoadTypeReload]):
        (-[WebCoreFrameBridge frameDetached]):
        (-[WebCoreFrameBridge tokenizerProcessedData]):
        (-[WebCoreFrameBridge receivedData:textEncodingName:]):
        (-[WebCoreFrameBridge startLoadingResource:withMethod:URL:customHeaders:]):
        (-[WebCoreFrameBridge objectLoadedFromCacheWithURL:response:data:]):
        (-[WebCoreFrameBridge startLoadingResource:withMethod:URL:customHeaders:postData:]):
        (-[WebCoreFrameBridge reportClientRedirectToURL:delay:fireDate:lockHistory:isJavaScriptFormAction:]):
        (-[WebCoreFrameBridge reportClientRedirectCancelled:]):
        (-[WebCoreFrameBridge loadURL:referrer:reload:userGesture:target:triggeringEvent:form:formValues:]):
        (-[WebCoreFrameBridge postWithURL:referrer:target:data:contentType:triggeringEvent:form:formValues:]):
        (-[WebCoreFrameBridge syncLoadResourceWithMethod:URL:customHeaders:postData:finalURL:responseHeaders:statusCode:]):
        (-[WebCoreFrameBridge incomingReferrer]):
        (-[WebCoreFrameBridge isReloading]):
        (-[WebCoreFrameBridge handledOnloadEvents]):
        (-[WebCoreFrameBridge mainResourceURLResponse]):
        (-[WebCoreFrameBridge loadEmptyDocumentSynchronously]):
        * loader/mac/LoaderNSURLExtras.h:
        * loader/mac/LoaderNSURLRequestExtras.h: Added.
        * loader/mac/LoaderNSURLRequestExtras.m: Added.
        (isConditionalRequest):
        (setHTTPReferrer):
        * loader/mac/WebFrameLoader.mm:
        * loader/mac/WebSubresourceLoader.mm:

WebKit:

        Reviewed by Oliver.

        - liberate more WebKit code down to WebCore

        * WebCoreSupport/WebFrameBridge.h:
        * WebCoreSupport/WebFrameBridge.m:

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

12 files changed:
WebCore/ChangeLog
WebCore/WebCore.xcodeproj/project.pbxproj
WebCore/bridge/mac/WebCoreFrameBridge.h
WebCore/bridge/mac/WebCoreFrameBridge.mm
WebCore/loader/mac/LoaderNSURLExtras.h
WebCore/loader/mac/LoaderNSURLRequestExtras.h [new file with mode: 0644]
WebCore/loader/mac/LoaderNSURLRequestExtras.m [new file with mode: 0644]
WebCore/loader/mac/WebFrameLoader.mm
WebCore/loader/mac/WebSubresourceLoader.mm
WebKit/ChangeLog
WebKit/WebCoreSupport/WebFrameBridge.h
WebKit/WebCoreSupport/WebFrameBridge.m

index 27a37a52ae354f5e7ebab8fc8d3e54aef357c286..a2fc0fcb2e122f6ee79c5d645eca34419ca2abd0 100644 (file)
@@ -1,3 +1,42 @@
+2006-10-12  Maciej Stachowiak  <mjs@apple.com>
+
+        Reviewed by Oliver.
+
+        - moved a bunch of WebFrameBridge code down to WebCoreFrameBridge, now that it no longer has any WebKit dependencies
+
+        * WebCore.xcodeproj/project.pbxproj:
+        * bridge/mac/WebCoreFrameBridge.h:
+        * bridge/mac/WebCoreFrameBridge.mm:
+        (stringByCollapsingNonPrintingCharacters):
+        (-[WebCoreFrameBridge setTitle:]):
+        (-[WebCoreFrameBridge didFirstLayout]):
+        (-[WebCoreFrameBridge notifyIconChanged:]):
+        (-[WebCoreFrameBridge originalRequestURL]):
+        (-[WebCoreFrameBridge isLoadTypeReload]):
+        (-[WebCoreFrameBridge frameDetached]):
+        (-[WebCoreFrameBridge tokenizerProcessedData]):
+        (-[WebCoreFrameBridge receivedData:textEncodingName:]):
+        (-[WebCoreFrameBridge startLoadingResource:withMethod:URL:customHeaders:]):
+        (-[WebCoreFrameBridge objectLoadedFromCacheWithURL:response:data:]):
+        (-[WebCoreFrameBridge startLoadingResource:withMethod:URL:customHeaders:postData:]):
+        (-[WebCoreFrameBridge reportClientRedirectToURL:delay:fireDate:lockHistory:isJavaScriptFormAction:]):
+        (-[WebCoreFrameBridge reportClientRedirectCancelled:]):
+        (-[WebCoreFrameBridge loadURL:referrer:reload:userGesture:target:triggeringEvent:form:formValues:]):
+        (-[WebCoreFrameBridge postWithURL:referrer:target:data:contentType:triggeringEvent:form:formValues:]):
+        (-[WebCoreFrameBridge syncLoadResourceWithMethod:URL:customHeaders:postData:finalURL:responseHeaders:statusCode:]):
+        (-[WebCoreFrameBridge incomingReferrer]):
+        (-[WebCoreFrameBridge isReloading]):
+        (-[WebCoreFrameBridge handledOnloadEvents]):
+        (-[WebCoreFrameBridge mainResourceURLResponse]):
+        (-[WebCoreFrameBridge loadEmptyDocumentSynchronously]):
+        * loader/mac/LoaderNSURLExtras.h:
+        * loader/mac/LoaderNSURLRequestExtras.h: Added.
+        * loader/mac/LoaderNSURLRequestExtras.m: Added.
+        (isConditionalRequest):
+        (setHTTPReferrer):
+        * loader/mac/WebFrameLoader.mm:
+        * loader/mac/WebSubresourceLoader.mm:
+
 2006-10-12  Adele Peterson  <adele@apple.com>
 
         RS by Geoff.
index 600bc2af238509bc7f0e4a736de3b043b5b4ea0a..265bfe45e1c7406f5db7cfe2b7c8ddda40e69c0f 100644 (file)
                6550B6A6099DF0270090D781 /* Text.h in Headers */ = {isa = PBXBuildFile; fileRef = 6550B69C099DF0270090D781 /* Text.h */; };
                6552E7AA096AA11B0006F248 /* WebCoreFrameNamespaces.h in Headers */ = {isa = PBXBuildFile; fileRef = 6552E7A8096AA11B0006F248 /* WebCoreFrameNamespaces.h */; settings = {ATTRIBUTES = (Private, ); }; };
                6552E7AB096AA11B0006F248 /* WebCoreFrameNamespaces.mm in Sources */ = {isa = PBXBuildFile; fileRef = 6552E7A9096AA11B0006F248 /* WebCoreFrameNamespaces.mm */; };
+               6563A9A70ADF4094000ED2CD /* LoaderNSURLRequestExtras.h in Headers */ = {isa = PBXBuildFile; fileRef = 6563A9A50ADF4094000ED2CD /* LoaderNSURLRequestExtras.h */; };
+               6563A9A80ADF4094000ED2CD /* LoaderNSURLRequestExtras.m in Sources */ = {isa = PBXBuildFile; fileRef = 6563A9A60ADF4094000ED2CD /* LoaderNSURLRequestExtras.m */; };
                656580F409D12B20000E61D7 /* CSSPropertyNames.h in Headers */ = {isa = PBXBuildFile; fileRef = 656580EF09D12B20000E61D7 /* CSSPropertyNames.h */; };
                6565815109D13043000E61D7 /* CSSValueKeywords.h in Headers */ = {isa = PBXBuildFile; fileRef = 6565814809D13043000E61D7 /* CSSValueKeywords.h */; };
                656581B209D14EE6000E61D7 /* UserAgentStyleSheets.h in Headers */ = {isa = PBXBuildFile; fileRef = 656581AE09D14EE6000E61D7 /* UserAgentStyleSheets.h */; };
                6550B69C099DF0270090D781 /* Text.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Text.h; sourceTree = "<group>"; };
                6552E7A8096AA11B0006F248 /* WebCoreFrameNamespaces.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = WebCoreFrameNamespaces.h; sourceTree = "<group>"; };
                6552E7A9096AA11B0006F248 /* WebCoreFrameNamespaces.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = WebCoreFrameNamespaces.mm; sourceTree = "<group>"; };
+               6563A9A50ADF4094000ED2CD /* LoaderNSURLRequestExtras.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = LoaderNSURLRequestExtras.h; sourceTree = "<group>"; };
+               6563A9A60ADF4094000ED2CD /* LoaderNSURLRequestExtras.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = LoaderNSURLRequestExtras.m; sourceTree = "<group>"; };
                656580ED09D12B20000E61D7 /* CSSPropertyNames.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = CSSPropertyNames.c; sourceTree = "<group>"; };
                656580EE09D12B20000E61D7 /* CSSPropertyNames.gperf */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = CSSPropertyNames.gperf; sourceTree = "<group>"; };
                656580EF09D12B20000E61D7 /* CSSPropertyNames.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CSSPropertyNames.h; sourceTree = "<group>"; };
                                51A1D2C50AB69120000D732C /* IconLoaderMac.mm */,
                                656D371A0ADBA5DE00A4554D /* LoaderNSURLExtras.h */,
                                656D371B0ADBA5DE00A4554D /* LoaderNSURLExtras.m */,
+                               6563A9A50ADF4094000ED2CD /* LoaderNSURLRequestExtras.h */,
+                               6563A9A60ADF4094000ED2CD /* LoaderNSURLRequestExtras.m */,
                                656D371C0ADBA5DE00A4554D /* WebDataProtocol.h */,
                                656D371D0ADBA5DE00A4554D /* WebDataProtocol.mm */,
                                656D371E0ADBA5DE00A4554D /* WebDocumentLoader.h */,
                                656D37480ADBA5DE00A4554D /* WebSubresourceLoader.h in Headers */,
                                65BAAABE0ADCA015005BB5A4 /* RetainPtr.h in Headers */,
                                0668E18B0ADD9624004128E0 /* PopupMenu.h in Headers */,
+                               6563A9A70ADF4094000ED2CD /* LoaderNSURLRequestExtras.h in Headers */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
                0867D690FE84028FC02AAC07 /* Project object */ = {
                        isa = PBXProject;
                        buildConfigurationList = 149C284308902B11008A9EFC /* Build configuration list for PBXProject "WebCore" */;
-                       compatibilityVersion = "Xcode 2.4";
                        hasScannedForEncodings = 1;
                        knownRegions = (
                                English,
                        mainGroup = 0867D691FE84028FC02AAC07 /* WebKit */;
                        productRefGroup = 034768DFFF38A50411DB9C8B /* Products */;
                        projectDirPath = "";
-                       projectRoot = "";
-                       shouldCheckCompatibility = 1;
                        targets = (
                                93F198A508245E59001E9ABC /* WebCore */,
                                DD041FBE09D9DDBE0010AF2A /* Derived Sources */,
                                656D37490ADBA5DE00A4554D /* WebSubresourceLoader.mm in Sources */,
                                0668E18A0ADD9624004128E0 /* PopupMenu.cpp in Sources */,
                                0668E1900ADD9640004128E0 /* PopupMenuMac.mm in Sources */,
+                               6563A9A80ADF4094000ED2CD /* LoaderNSURLRequestExtras.m in Sources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
index 88b45c51ef6c9b4e8fdd7fb013ecf8f7bf4f34e7..e0a66fd32981ec2d4391531e18e985b25592b07e 100644 (file)
@@ -514,6 +514,28 @@ typedef enum {
 - (void)setFrameLoaderClient:(id<WebFrameLoaderClient>)client;
 - (WebFrameLoader *)frameLoader;
 
+- (void)setTitle:(NSString *)title;
+- (void)didFirstLayout;
+- (void)notifyIconChanged:(NSURL*)iconURL;
+- (NSURL*)originalRequestURL;
+- (BOOL)isLoadTypeReload;
+- (void)frameDetached;
+- (void)tokenizerProcessedData;
+- (void)receivedData:(NSData *)data textEncodingName:(NSString *)textEncodingName;
+- (id <WebCoreResourceHandle>)startLoadingResource:(id <WebCoreResourceLoader>)loader withMethod:(NSString *)method URL:(NSURL *)URL customHeaders:(NSDictionary *)customHeaders;
+- (id <WebCoreResourceHandle>)startLoadingResource:(id <WebCoreResourceLoader>)loader withMethod:(NSString *)method URL:(NSURL *)URL customHeaders:(NSDictionary *)customHeaders postData:(NSArray *)data;
+- (void)objectLoadedFromCacheWithURL:(NSURL *)URL response:(NSURLResponse *)response data:(NSData *)data;
+- (NSData *)syncLoadResourceWithMethod:(NSString *)method URL:(NSURL *)URL customHeaders:(NSDictionary *)requestHeaders postData:(NSArray *)postData finalURL:(NSURL **)finalNSURL responseHeaders:(NSDictionary **)responseHeaderDict statusCode:(int *)statusCode;
+- (BOOL)isReloading;
+- (void)reportClientRedirectToURL:(NSURL *)URL delay:(NSTimeInterval)seconds fireDate:(NSDate *)date lockHistory:(BOOL)lockHistory isJavaScriptFormAction:(BOOL)isJavaScriptFormAction;
+- (void)reportClientRedirectCancelled:(BOOL)cancelWithLoadInProgress;
+- (void)loadURL:(NSURL *)URL referrer:(NSString *)referrer reload:(BOOL)reload userGesture:(BOOL)forUser target:(NSString *)target triggeringEvent:(NSEvent *)event form:(DOMElement *)form formValues:(NSDictionary *)values;
+- (void)postWithURL:(NSURL *)URL referrer:(NSString *)referrer target:(NSString *)target data:(NSArray *)data contentType:(NSString *)contentType triggeringEvent:(NSEvent *)event form:(DOMElement *)form formValues:(NSDictionary *)values;
+- (NSString *)incomingReferrer;
+- (NSURLResponse*)mainResourceURLResponse;
+- (void)loadEmptyDocumentSynchronously;
+- (void)handledOnloadEvents;
+
 @end
 
 // The WebCoreFrameBridge protocol contains methods for use by the WebCore side of the bridge.
@@ -525,12 +547,8 @@ typedef enum {
 
 @protocol WebCoreFrameBridge
 
-- (void)frameDetached;
 - (NSView *)documentView;
 
-- (void)loadURL:(NSURL *)URL referrer:(NSString *)referrer reload:(BOOL)reload userGesture:(BOOL)forUser target:(NSString *)target triggeringEvent:(NSEvent *)event form:(DOMElement *)form formValues:(NSDictionary *)values;
-- (void)postWithURL:(NSURL *)URL referrer:(NSString *)referrer target:(NSString *)target data:(NSArray *)data contentType:(NSString *)contentType triggeringEvent:(NSEvent *)event form:(DOMElement *)form formValues:(NSDictionary *)values;
-
 - (WebCorePageBridge *)createWindowWithURL:(NSURL *)URL;
 - (void)showWindow;
 
@@ -541,7 +559,6 @@ typedef enum {
 
 - (NSString *)userAgentForURL:(NSURL *)URL;
 
-- (void)setTitle:(NSString *)title;
 - (void)setStatusText:(NSString *)status;
 
 - (WebCoreFrameBridge *)createChildFrameNamed:(NSString *)frameName withURL:(NSURL *)URL
@@ -577,18 +594,8 @@ typedef enum {
 - (void)addMessageToConsole:(NSDictionary *)message;
 - (void)runOpenPanelForFileButtonWithResultListener:(id <WebCoreOpenPanelResultListener>)resultListener;
 
-- (id <WebCoreResourceHandle>)startLoadingResource:(id <WebCoreResourceLoader>)loader withMethod:(NSString *)method URL:(NSURL *)URL customHeaders:(NSDictionary *)customHeaders;
-- (id <WebCoreResourceHandle>)startLoadingResource:(id <WebCoreResourceLoader>)loader withMethod:(NSString *)method URL:(NSURL *)URL customHeaders:(NSDictionary *)customHeaders postData:(NSArray *)data;
-- (void)objectLoadedFromCacheWithURL:(NSURL *)URL response:(NSURLResponse *)response data:(NSData *)data;
-
-- (NSData *)syncLoadResourceWithMethod:(NSString *)method URL:(NSURL *)URL customHeaders:(NSDictionary *)requestHeaders postData:(NSArray *)postData finalURL:(NSURL **)finalNSURL responseHeaders:(NSDictionary **)responseHeaderDict statusCode:(int *)statusCode;
-
-- (BOOL)isReloading;
 - (time_t)expiresTimeForResponse:(NSURLResponse *)response;
 
-- (void)reportClientRedirectToURL:(NSURL *)URL delay:(NSTimeInterval)seconds fireDate:(NSDate *)date lockHistory:(BOOL)lockHistory isJavaScriptFormAction:(BOOL)isJavaScriptFormAction;
-- (void)reportClientRedirectCancelled:(BOOL)cancelWithLoadInProgress;
-
 - (void)activateWindow;
 - (void)deactivateWindow;
 
@@ -606,10 +613,6 @@ typedef enum {
 
 - (void)setNeedsReapplyStyles;
 
-- (void)tokenizerProcessedData;
-
-- (NSString *)incomingReferrer;
-
 - (NSView *)viewForPluginWithURL:(NSURL *)URL
                   attributeNames:(NSArray *)attributeNames
                  attributeValues:(NSArray *)attributeValues
@@ -629,8 +632,6 @@ typedef enum {
 
 - (ObjectElementType)determineObjectFromMIMEType:(NSString*)MIMEType URL:(NSURL*)URL;
 
-- (void)loadEmptyDocumentSynchronously;
-
 - (NSString *)MIMETypeForPath:(NSString *)path;
 
 - (void)allowDHTMLDrag:(BOOL *)flagDHTML UADrag:(BOOL *)flagUA;
@@ -689,24 +690,17 @@ typedef enum {
 - (int)spellCheckerDocumentTag;
 - (BOOL)isContinuousSpellCheckingEnabled;
 
-- (void)didFirstLayout;
-
 - (void)dashboardRegionsChanged:(NSMutableDictionary *)regions;
 - (void)willPopupMenu:(NSMenu *)menu;
 
 - (NSRect)customHighlightRect:(NSString*)type forLine:(NSRect)lineRect;
 - (void)paintCustomHighlight:(NSString*)type forBox:(NSRect)boxRect onLine:(NSRect)lineRect behindText:(BOOL)text entireLine:(BOOL)line;
 
-- (void)handledOnloadEvents;
-
 - (WebCoreKeyboardUIMode)keyboardUIMode;
 
-- (NSURLResponse*)mainResourceURLResponse;
 - (NSString*)imageTitleForFilename:(NSString*)filename size:(NSSize)size;
 
-- (void)notifyIconChanged:(NSURL*)iconURL;
-- (NSURL*)originalRequestURL;
-- (BOOL)isLoadTypeReload;
+
 @end
 
 // This interface definition allows those who hold a WebCoreFrameBridge * to call all the methods
index 362b0dcccf92ed5b4486b4c8dad772526c34c1c1..c6f86d21e84be3ffce745f6b229aea4610b37c50 100644 (file)
@@ -48,6 +48,8 @@
 #import "HTMLNames.h"
 #import "Image.h"
 #import "LoaderFunctions.h"
+#import "LoaderNSURLExtras.h"
+#import "LoaderNSURLRequestExtras.h"
 #import "ModifySelectionListLevel.h"
 #import "MoveSelectionCommand.h"
 #import "Page.h"
 #import "WebCoreSystemInterface.h"
 #import "WebCoreViewFactory.h"
 #import "WebCoreWidgetHolder.h"
+#import "WebDocumentLoader.h"
+#import "WebFormDataStream.h"
 #import "WebFrameLoader.h"
+#import "WebFrameLoaderClient.h"
+#import "WebSubresourceLoader.h"
 #import "XMLTokenizer.h"
 #import "csshelper.h"
 #import "htmlediting.h"
@@ -2609,6 +2615,313 @@ static NSCharacterSet *_getPostSmartSet(void)
     return _frameLoader;
 }
 
+static NSString *stringByCollapsingNonPrintingCharacters(NSString *string)
+{
+    NSMutableString *result = [NSMutableString string];
+    static NSCharacterSet *charactersToTurnIntoSpaces = nil;
+    static NSCharacterSet *charactersToNotTurnIntoSpaces = nil;
+    
+    if (charactersToTurnIntoSpaces == nil) {
+        NSMutableCharacterSet *set = [[NSMutableCharacterSet alloc] init];
+        [set addCharactersInRange:NSMakeRange(0x00, 0x21)];
+        [set addCharactersInRange:NSMakeRange(0x7F, 0x01)];
+        charactersToTurnIntoSpaces = [set copy];
+        [set release];
+        charactersToNotTurnIntoSpaces = [[charactersToTurnIntoSpaces invertedSet] retain];
+    }
+    
+    unsigned length = [string length];
+    unsigned position = 0;
+    while (position != length) {
+        NSRange nonSpace = [string rangeOfCharacterFromSet:charactersToNotTurnIntoSpaces
+                                                 options:0 range:NSMakeRange(position, length - position)];
+        if (nonSpace.location == NSNotFound) {
+            break;
+        }
+        
+        NSRange space = [string rangeOfCharacterFromSet:charactersToTurnIntoSpaces
+                                              options:0 range:NSMakeRange(nonSpace.location, length - nonSpace.location)];
+        if (space.location == NSNotFound) {
+            space.location = length;
+        }
+        
+        if (space.location > nonSpace.location) {
+            if (position != 0) {
+                [result appendString:@" "];
+            }
+            [result appendString:[string substringWithRange:
+                NSMakeRange(nonSpace.location, space.location - nonSpace.location)]];
+        }
+        
+        position = space.location;
+    }
+    
+    return result;
+}
+
+- (void)setTitle:(NSString *)title
+{
+    [[[self frameLoader] documentLoader] setTitle:stringByCollapsingNonPrintingCharacters(title)];
+}
+
+- (void)didFirstLayout
+{
+    [[self frameLoader] didFirstLayout];
+}
+
+- (void)notifyIconChanged:(NSURL*)iconURL
+{
+    [[self frameLoader] _notifyIconChanged:iconURL];
+}
+
+- (NSURL*)originalRequestURL
+{
+    return [[[[self frameLoader] activeDocumentLoader] initialRequest] URL];
+}
+
+- (BOOL)isLoadTypeReload
+{
+    return [[self frameLoader] loadType] == FrameLoadTypeReload;
+}
+
+- (void)frameDetached
+{
+    [[self frameLoader] stopLoading];
+    [[self frameLoader] detachFromParent];
+}
+
+- (void)tokenizerProcessedData
+{
+    [[self frameLoader] checkLoadComplete];
+}
+
+- (void)receivedData:(NSData *)data textEncodingName:(NSString *)textEncodingName
+{
+    // Set the encoding. This only needs to be done once, but it's harmless to do it again later.
+    NSString *encoding = [[[self frameLoader] documentLoader] overrideEncoding];
+    BOOL userChosen = encoding != nil;
+    if (encoding == nil) {
+        encoding = textEncodingName;
+    }
+    [self setEncoding:encoding userChosen:userChosen];
+    
+    [self addData:data];
+}
+
+- (id <WebCoreResourceHandle>)startLoadingResource:(id <WebCoreResourceLoader>)resourceLoader withMethod:(NSString *)method URL:(NSURL *)URL customHeaders:(NSDictionary *)customHeaders
+{
+    // If we are no longer attached to a Page, this must be an attempted load from an
+    // onUnload handler, so let's just block it.
+    if ([self page] == nil)
+        return nil;
+    
+    // Since this is a subresource, we can load any URL (we ignore the return value).
+    // But we still want to know whether we should hide the referrer or not, so we call the canLoadURL method.
+    BOOL hideReferrer;
+    [self canLoadURL:URL fromReferrer:[self referrer] hideReferrer:&hideReferrer];
+    
+    return [WebSubresourceLoader startLoadingResource:resourceLoader
+                                           withMethod:method
+                                                  URL:URL
+                                        customHeaders:customHeaders
+                                             referrer:(hideReferrer ? nil : [self referrer])
+                                       forFrameLoader:[self frameLoader]];
+}
+
+- (void)objectLoadedFromCacheWithURL:(NSURL *)URL response:(NSURLResponse *)response data:(NSData *)data
+{
+    // FIXME: If the WebKit client changes or cancels the request, WebCore does not respect this and continues the load.
+    NSError *error;
+    id identifier;
+    NSURLRequest *request = [[NSURLRequest alloc] initWithURL:URL];
+    [[self frameLoader] requestFromDelegateForRequest:request identifier:&identifier error:&error];    
+    [[self frameLoader] sendRemainingDelegateMessagesWithIdentifier:identifier response:response length:[data length] error:error];
+    [request release];
+}
+
+- (id <WebCoreResourceHandle>)startLoadingResource:(id <WebCoreResourceLoader>)resourceLoader withMethod:(NSString *)method URL:(NSURL *)URL customHeaders:(NSDictionary *)customHeaders postData:(NSArray *)postData
+{
+    // If we are no longer attached to a Page, this must be an attempted load from an
+    // onUnload handler, so let's just block it.
+    if ([self page] == nil)
+        return nil;
+    
+    // Since this is a subresource, we can load any URL (we ignore the return value).
+    // But we still want to know whether we should hide the referrer or not, so we call the canLoadURL method.
+    BOOL hideReferrer;
+    [self canLoadURL:URL fromReferrer:[self referrer] hideReferrer:&hideReferrer];
+    
+    return [WebSubresourceLoader startLoadingResource:resourceLoader
+                                           withMethod:method 
+                                                  URL:URL
+                                        customHeaders:customHeaders
+                                             postData:postData
+                                             referrer:(hideReferrer ? nil : [self referrer])
+                                       forFrameLoader:[self frameLoader]];
+}
+
+- (void)reportClientRedirectToURL:(NSURL *)URL delay:(NSTimeInterval)seconds fireDate:(NSDate *)date lockHistory:(BOOL)lockHistory isJavaScriptFormAction:(BOOL)isJavaScriptFormAction
+{
+    [[self frameLoader] clientRedirectedTo:URL delay:seconds fireDate:date lockHistory:lockHistory isJavaScriptFormAction:(BOOL)isJavaScriptFormAction];
+}
+
+- (void)reportClientRedirectCancelled:(BOOL)cancelWithLoadInProgress
+{
+    [[self frameLoader] clientRedirectCancelledOrFinished:cancelWithLoadInProgress];
+}
+
+- (void)loadURL:(NSURL *)URL referrer:(NSString *)referrer reload:(BOOL)reload userGesture:(BOOL)forUser target:(NSString *)target triggeringEvent:(NSEvent *)event form:(DOMElement *)form formValues:(NSDictionary *)values
+{
+    BOOL hideReferrer;
+    if (![self canLoadURL:URL fromReferrer:referrer hideReferrer:&hideReferrer])
+        return;
+    
+    if ([target length] == 0) {
+        target = nil;
+    }
+    
+    WebCoreFrameBridge *targetFrame = [self findFrameNamed:target];
+    if (![self canTargetLoadInFrame:targetFrame]) {
+        return;
+    }
+    
+    FrameLoadType loadType;
+    
+    if (reload)
+        loadType = FrameLoadTypeReload;
+    else if (!forUser)
+        loadType = FrameLoadTypeInternal;
+    else
+        loadType = FrameLoadTypeStandard;
+    [[self frameLoader] loadURL:URL referrer:(hideReferrer ? nil : referrer) loadType:loadType target:target triggeringEvent:event form:form formValues:values];
+    
+    if (targetFrame != nil && self != targetFrame) {
+        [targetFrame activateWindow];
+    }
+}
+
+- (void)postWithURL:(NSURL *)URL referrer:(NSString *)referrer target:(NSString *)target data:(NSArray *)postData contentType:(NSString *)contentType triggeringEvent:(NSEvent *)event form:(DOMElement *)form formValues:(NSDictionary *)values
+{
+    BOOL hideReferrer;
+    if (![self canLoadURL:URL fromReferrer:referrer hideReferrer:&hideReferrer])
+        return;
+    
+    if ([target length] == 0)
+        target = nil;
+    
+    WebCoreFrameBridge *targetFrame = [self findFrameNamed:target];
+    if (![self canTargetLoadInFrame:targetFrame])
+        return;
+    
+    [[self frameLoader] postWithURL:URL referrer:(hideReferrer ? nil : referrer) target:target
+                               data:postData contentType:contentType
+                    triggeringEvent:event form:form formValues:values];
+    
+    if (targetFrame != nil && self != targetFrame)
+        [targetFrame activateWindow];
+}
+
+- (NSData *)syncLoadResourceWithMethod:(NSString *)method URL:(NSURL *)URL customHeaders:(NSDictionary *)requestHeaders postData:(NSArray *)postData finalURL:(NSURL **)finalURL responseHeaders:(NSDictionary **)responseHeaderDict statusCode:(int *)statusCode
+{
+    // Since this is a subresource, we can load any URL (we ignore the return value).
+    // But we still want to know whether we should hide the referrer or not, so we call the canLoadURL method.
+    BOOL hideReferrer;
+    [self canLoadURL:URL fromReferrer:[self referrer] hideReferrer:&hideReferrer];
+    
+    NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:URL];
+    [request setTimeoutInterval:10];
+    
+    // setHTTPMethod is not called for GET requests to work around <rdar://4464032>.
+    if (![method isEqualToString:@"GET"])
+        [request setHTTPMethod:method];
+    
+    if (postData)        
+        webSetHTTPBody(request, postData);
+    
+    NSEnumerator *e = [requestHeaders keyEnumerator];
+    NSString *key;
+    while ((key = (NSString *)[e nextObject]) != nil) {
+        [request addValue:[requestHeaders objectForKey:key] forHTTPHeaderField:key];
+    }
+    
+    if (isConditionalRequest(request))
+        [request setCachePolicy:NSURLRequestReloadIgnoringCacheData];
+    else
+        [request setCachePolicy:[[[[self frameLoader] documentLoader] request] cachePolicy]];
+    if (!hideReferrer)
+        setHTTPReferrer(request, [self referrer]);
+    
+    WebCorePageBridge *page = [self page];
+    [request setMainDocumentURL:[[[[[page mainFrame] frameLoader] documentLoader] request] URL]];
+    [request setValue:[self userAgentForURL:[request URL]] forHTTPHeaderField:@"User-Agent"];
+    
+    NSError *error = nil;
+    id identifier = nil;    
+    NSURLRequest *newRequest = [[self frameLoader] requestFromDelegateForRequest:request identifier:&identifier error:&error];
+    
+    NSURLResponse *response = nil;
+    NSData *result = nil;
+    if (error == nil) {
+        ASSERT(newRequest != nil);
+        result = [NSURLConnection sendSynchronousRequest:newRequest returningResponse:&response error:&error];
+    }
+    
+    if (error == nil) {
+        *finalURL = [response URL];
+        if ([response isKindOfClass:[NSHTTPURLResponse class]]) {
+            NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *)response; 
+            *responseHeaderDict = [httpResponse allHeaderFields];
+            *statusCode = [httpResponse statusCode];
+        } else {
+            *responseHeaderDict = [NSDictionary dictionary];
+            *statusCode = 200;
+        }
+    } else {
+        *finalURL = URL;
+        *responseHeaderDict = [NSDictionary dictionary];
+        if ([error domain] == NSURLErrorDomain) {
+            *statusCode = [error code];
+        } else {
+            *statusCode = 404;
+        }
+    }
+    
+    [[self frameLoader] sendRemainingDelegateMessagesWithIdentifier:identifier response:response length:[result length] error:error];
+    [request release];
+    
+    return result;
+}
+// -------------------
+
+- (NSString *)incomingReferrer
+{
+    return [[[[self frameLoader] documentLoader] request] valueForHTTPHeaderField:@"Referer"];
+}
+
+- (BOOL)isReloading
+{
+    return [[[[self frameLoader] documentLoader] request] cachePolicy] == NSURLRequestReloadIgnoringCacheData;
+}
+
+- (void)handledOnloadEvents
+{
+    [[[self frameLoader] client] _dispatchDidHandleOnloadEventsForFrame];
+}
+
+- (NSURLResponse*)mainResourceURLResponse
+{
+    return [[[self frameLoader] documentLoader] response];
+}
+
+- (void)loadEmptyDocumentSynchronously
+{
+    NSURL *url = [[NSURL alloc] initWithString:@""];
+    NSURLRequest *request = [[NSURLRequest alloc] initWithURL:url];
+    [[self frameLoader] loadRequest:request];
+    [request release];
+    [url release];
+}
+
 @end
 
 @implementation WebCoreFrameBridge (WebCoreBridgeInternal)
index e3c06014fcfaca515acc5a6e6458b95a60f010d0..41e4667d8e0efeb6da19b400c9486f20368c5016 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2005 Apple Computer, Inc.  All rights reserved.
+ * Copyright (C) 2005, 2006 Apple Computer, Inc.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
diff --git a/WebCore/loader/mac/LoaderNSURLRequestExtras.h b/WebCore/loader/mac/LoaderNSURLRequestExtras.h
new file mode 100644 (file)
index 0000000..0c4f3e2
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2005, 2006 Apple Computer, Inc.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer. 
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution. 
+ * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ *     its contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission. 
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import <Foundation/Foundation.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void setHTTPReferrer(NSMutableURLRequest *request, NSString *theReferrer);
+BOOL isConditionalRequest(NSURLRequest *request);
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/WebCore/loader/mac/LoaderNSURLRequestExtras.m b/WebCore/loader/mac/LoaderNSURLRequestExtras.m
new file mode 100644 (file)
index 0000000..8795f2f
--- /dev/null
@@ -0,0 +1,60 @@
+/*
+ * Copyright (C) 2005, 2006 Apple Computer, Inc.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer. 
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution. 
+ * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ *     its contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission. 
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import "config.h"
+#import "LoaderNSURLRequestExtras.h"
+
+#import "LoaderNSURLExtras.h"
+
+BOOL isConditionalRequest(NSURLRequest *request)
+{
+    if ([request valueForHTTPHeaderField:@"If-Match"] ||
+        [request valueForHTTPHeaderField:@"If-Modified-Since"] ||
+        [request valueForHTTPHeaderField:@"If-None-Match"] ||
+        [request valueForHTTPHeaderField:@"If-Range"] ||
+        [request valueForHTTPHeaderField:@"If-Unmodified-Since"])
+        return YES;
+    return NO;
+}
+
+#define WebReferrer     (@"Referer")
+
+void setHTTPReferrer(NSMutableURLRequest *request, NSString *theReferrer)
+{
+    // Do not set the referrer to a string that refers to a file URL.
+    // That is a potential security hole.
+    if (stringIsFileURL(theReferrer))
+        return;
+    
+    // Don't allow empty Referer: headers; some servers refuse them
+    if([theReferrer length] == 0)
+        theReferrer = nil;
+    
+    [request setValue:theReferrer forHTTPHeaderField:WebReferrer];
+}
+
index 034218d2338182638d57edcb0e12ddbb55c666df..bf01e74b40ecdd0438038bfa08685c02066871fc 100644 (file)
@@ -29,6 +29,7 @@
 #import "WebFrameLoader.h"
 
 #import "LoaderNSURLExtras.h"
+#import "LoaderNSURLRequestExtras.h"
 #import "WebDataProtocol.h"
 #import "WebDocumentLoader.h"
 #import "WebFormDataStream.h"
@@ -555,20 +556,6 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
              [urlByRemovingFragment(currentURL) isEqual:urlByRemovingFragment(destinationURL)]);
 }
 
-static void setHTTPReferrer(NSMutableURLRequest *request, NSString *referrer)
-{
-    // Do not set the referrer to a string that refers to a file URL.
-    // That is a potential security hole.
-    if (stringIsFileURL(referrer))
-        return;
-
-    // Don't allow empty Referer: headers; some servers refuse them
-    if ([referrer length] == 0)
-        return;
-
-    [request setValue:referrer forHTTPHeaderField:@"Referer"];
-}
-
 // main funnel for navigating via callback from WebCore (e.g., clicking a link, redirect)
 - (void)loadURL:(NSURL *)URL referrer:(NSString *)referrer loadType:(FrameLoadType)_loadType target:(NSString *)target triggeringEvent:(NSEvent *)event form:(DOMElement *)form formValues:(NSDictionary *)values
 {
index 3fca512ec12451bbfe4e018203355df40decf225..9d843199641e82f4bf90ddebf34a9ee51fdaaa73 100644 (file)
@@ -29,6 +29,8 @@
 #import "config.h"
 #import "WebSubresourceLoader.h"
 
+#import "LoaderNSURLExtras.h"
+#import "LoaderNSURLRequestExtras.h"
 #import "WebFormDataStream.h"
 #import "WebFrameLoader.h"
 #import <Foundation/NSURLResponse.h>
     [super dealloc];
 }
 
-static BOOL isConditionalRequest(NSURLRequest *request)
-{
-    if ([request valueForHTTPHeaderField:@"If-Match"] ||
-        [request valueForHTTPHeaderField:@"If-Modified-Since"] ||
-        [request valueForHTTPHeaderField:@"If-None-Match"] ||
-        [request valueForHTTPHeaderField:@"If-Range"] ||
-        [request valueForHTTPHeaderField:@"If-Unmodified-Since"])
-        return YES;
-    return NO;
-}
-
-static BOOL hasCaseInsensitivePrefix(NSString *str, NSString *prefix)
-{
-    return str && ([str rangeOfString:prefix options:(NSCaseInsensitiveSearch | NSAnchoredSearch)].location != NSNotFound);
-}
-
-static BOOL isFileURLString(NSString *URL)
-{
-    return hasCaseInsensitivePrefix(URL, @"file:");
-}
-
-#define WebReferrer     (@"Referer")
-
-static void setHTTPReferrer(NSMutableURLRequest *request, NSString *theReferrer)
-{
-    // Do not set the referrer to a string that refers to a file URL.
-    // That is a potential security hole.
-    if (isFileURLString(theReferrer))
-        return;
-    
-    // Don't allow empty Referer: headers; some servers refuse them
-    if([theReferrer length] == 0)
-        theReferrer = nil;
-    
-    [request setValue:theReferrer forHTTPHeaderField:WebReferrer];
-}
-
 + (WebSubresourceLoader *)startLoadingResource:(id <WebCoreResourceLoader>)rLoader
                                    withRequest:(NSMutableURLRequest *)newRequest
                                  customHeaders:(NSDictionary *)customHeaders
index 98874b4e537ca50e4d167edb0f6293810f3a2973..9e19abc6fd9ebea9ead4e34dc05adf095a3aea29 100644 (file)
@@ -1,3 +1,12 @@
+2006-10-12  Maciej Stachowiak  <mjs@apple.com>
+
+        Reviewed by Oliver.
+        
+        - liberate more WebKit code down to WebCore
+
+        * WebCoreSupport/WebFrameBridge.h:
+        * WebCoreSupport/WebFrameBridge.m:
+
 2006-10-12  Adele Peterson  <adele@apple.com>
 
         Reviewed by Maciej.
index a0ead921e5056195f09a050d73847f321521e2f2..56af0c0105b153abb5060a51fa9f922340fa8c09 100644 (file)
@@ -53,7 +53,6 @@
 
 - (void)close;
 
-- (void)receivedData:(NSData *)data textEncodingName:(NSString *)textEncodingName;
 - (BOOL)inNextKeyViewOutsideWebFrameViews;
 
 - (WebFrame *)webFrame;
index 075d28aaec583b9fd124e0901e9077f8b33e5140..d220e97d160839642ed1f5f68c9e5ee1295b3bbc 100644 (file)
@@ -479,11 +479,6 @@ NSString *WebPluginContainerKey =   @"WebPluginContainer";
     return dataSource;
 }
 
-- (void)setTitle:(NSString *)title
-{
-    [[[self frameLoader] documentLoader] setTitle:[title _webkit_stringByCollapsingNonPrintingCharacters]];
-}
-
 - (void)setStatusText:(NSString *)status
 {
     ASSERT(_frame != nil);
@@ -491,147 +486,6 @@ NSString *WebPluginContainerKey =   @"WebPluginContainer";
     [[wv _UIDelegateForwarder] webView:wv setStatusText:status];
 }
 
-- (void)receivedData:(NSData *)data textEncodingName:(NSString *)textEncodingName
-{
-    // Set the encoding. This only needs to be done once, but it's harmless to do it again later.
-    NSString *encoding = [[[self frameLoader] documentLoader] overrideEncoding];
-    BOOL userChosen = encoding != nil;
-    if (encoding == nil) {
-        encoding = textEncodingName;
-    }
-    [self setEncoding:encoding userChosen:userChosen];
-
-    [self addData:data];
-}
-
-- (id <WebCoreResourceHandle>)startLoadingResource:(id <WebCoreResourceLoader>)resourceLoader withMethod:(NSString *)method URL:(NSURL *)URL customHeaders:(NSDictionary *)customHeaders
-{
-    // If we are no longer attached to a WebView, this must be an attempted load from an
-    // onUnload handler, so let's just block it.
-    if ([[self webFrame] webView] == nil)
-        return nil;
-
-    // Since this is a subresource, we can load any URL (we ignore the return value).
-    // But we still want to know whether we should hide the referrer or not, so we call the canLoadURL method.
-    BOOL hideReferrer;
-    [self canLoadURL:URL fromReferrer:[self referrer] hideReferrer:&hideReferrer];
-
-    return [WebSubresourceLoader startLoadingResource:resourceLoader
-                                           withMethod:method
-                                                  URL:URL
-                                        customHeaders:customHeaders
-                                             referrer:(hideReferrer ? nil : [self referrer])
-                                       forFrameLoader:[self frameLoader]];
-}
-
-- (id <WebCoreResourceHandle>)startLoadingResource:(id <WebCoreResourceLoader>)resourceLoader withMethod:(NSString *)method URL:(NSURL *)URL customHeaders:(NSDictionary *)customHeaders postData:(NSArray *)postData
-{
-    // If we are no longer attached to a WebView, this must be an attempted load from an
-    // onUnload handler, so let's just block it.
-    if ([[self webFrame] webView] == nil)
-        return nil;
-
-    // Since this is a subresource, we can load any URL (we ignore the return value).
-    // But we still want to know whether we should hide the referrer or not, so we call the canLoadURL method.
-    BOOL hideReferrer;
-    [self canLoadURL:URL fromReferrer:[self referrer] hideReferrer:&hideReferrer];
-
-    return [WebSubresourceLoader startLoadingResource:resourceLoader
-                                           withMethod:method 
-                                                  URL:URL
-                                        customHeaders:customHeaders
-                                             postData:postData
-                                             referrer:(hideReferrer ? nil : [self referrer])
-                                       forFrameLoader:[self frameLoader]];
-}
-
-- (void)objectLoadedFromCacheWithURL:(NSURL *)URL response:(NSURLResponse *)response data:(NSData *)data
-{
-    // FIXME: If the WebKit client changes or cancels the request, WebCore does not respect this and continues the load.
-    NSError *error;
-    id identifier;
-    NSURLRequest *request = [[NSURLRequest alloc] initWithURL:URL];
-    [[self frameLoader] requestFromDelegateForRequest:request identifier:&identifier error:&error];    
-    [[self frameLoader] sendRemainingDelegateMessagesWithIdentifier:identifier response:response length:[data length] error:error];
-    [request release];
-}
-
-- (NSData *)syncLoadResourceWithMethod:(NSString *)method URL:(NSURL *)URL customHeaders:(NSDictionary *)requestHeaders postData:(NSArray *)postData finalURL:(NSURL **)finalURL responseHeaders:(NSDictionary **)responseHeaderDict statusCode:(int *)statusCode
-{
-    // Since this is a subresource, we can load any URL (we ignore the return value).
-    // But we still want to know whether we should hide the referrer or not, so we call the canLoadURL method.
-    BOOL hideReferrer;
-    [self canLoadURL:URL fromReferrer:[self referrer] hideReferrer:&hideReferrer];
-
-    NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:URL];
-    [request setTimeoutInterval:10];
-
-    // setHTTPMethod is not called for GET requests to work around <rdar://4464032>.
-    if (![method isEqualToString:@"GET"])
-        [request setHTTPMethod:method];
-
-    if (postData)        
-        webSetHTTPBody(request, postData);
-
-    NSEnumerator *e = [requestHeaders keyEnumerator];
-    NSString *key;
-    while ((key = (NSString *)[e nextObject]) != nil) {
-        [request addValue:[requestHeaders objectForKey:key] forHTTPHeaderField:key];
-    }
-    
-    if ([request _web_isConditionalRequest])
-        [request setCachePolicy:NSURLRequestReloadIgnoringCacheData];
-    else
-        [request setCachePolicy:[[[self dataSource] request] cachePolicy]];
-    if (!hideReferrer)
-        [request _web_setHTTPReferrer:[self referrer]];
-    
-    WebView *webView = [self webView];
-    [request setMainDocumentURL:[[[[webView mainFrame] dataSource] request] URL]];
-    [request _web_setHTTPUserAgent:[webView userAgentForURL:[request URL]]];
-    
-    NSError *error = nil;
-    id identifier = nil;    
-    NSURLRequest *newRequest = [[self frameLoader] requestFromDelegateForRequest:request identifier:&identifier error:&error];
-    
-    NSURLResponse *response = nil;
-    NSData *result = nil;
-    if (error == nil) {
-        ASSERT(newRequest != nil);
-        result = [NSURLConnection sendSynchronousRequest:newRequest returningResponse:&response error:&error];
-    }
-    
-    if (error == nil) {
-        *finalURL = [response URL];
-        if ([response isKindOfClass:[NSHTTPURLResponse class]]) {
-            NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *)response; 
-            *responseHeaderDict = [httpResponse allHeaderFields];
-            *statusCode = [httpResponse statusCode];
-        } else {
-            *responseHeaderDict = [NSDictionary dictionary];
-            *statusCode = 200;
-        }
-    } else {
-        *finalURL = URL;
-        *responseHeaderDict = [NSDictionary dictionary];
-        if ([error domain] == NSURLErrorDomain) {
-            *statusCode = [error code];
-        } else {
-            *statusCode = 404;
-        }
-    }
-    
-    [[self frameLoader] sendRemainingDelegateMessagesWithIdentifier:identifier response:response length:[result length] error:error];
-    [request release];
-    
-    return result;
-}
-
-- (BOOL)isReloading
-{
-    return [[[self dataSource] request] cachePolicy] == NSURLRequestReloadIgnoringCacheData;
-}
-
 // We would like a better value for a maximum time_t,
 // but there is no way to do that in C with any certainty.
 // INT_MAX should work well enough for our purposes.
@@ -649,16 +503,6 @@ NSString *WebPluginContainerKey =   @"WebPluginContainer";
     return expiration > MAX_TIME_T ? MAX_TIME_T : (time_t)expiration;
 }
 
-- (void)reportClientRedirectToURL:(NSURL *)URL delay:(NSTimeInterval)seconds fireDate:(NSDate *)date lockHistory:(BOOL)lockHistory isJavaScriptFormAction:(BOOL)isJavaScriptFormAction
-{
-    [[self frameLoader] clientRedirectedTo:URL delay:seconds fireDate:date lockHistory:lockHistory isJavaScriptFormAction:(BOOL)isJavaScriptFormAction];
-}
-
-- (void)reportClientRedirectCancelled:(BOOL)cancelWithLoadInProgress
-{
-    [[self frameLoader] clientRedirectCancelledOrFinished:cancelWithLoadInProgress];
-}
-
 - (void)close
 {
     [super close];
@@ -690,57 +534,6 @@ NSString *WebPluginContainerKey =   @"WebPluginContainer";
     [(WebHTMLView *)[[_frame frameView] documentView] _formControlIsResigningFirstResponder:formControl];
 }
 
-- (void)loadURL:(NSURL *)URL referrer:(NSString *)referrer reload:(BOOL)reload userGesture:(BOOL)forUser target:(NSString *)target triggeringEvent:(NSEvent *)event form:(DOMElement *)form formValues:(NSDictionary *)values
-{
-    BOOL hideReferrer;
-    if (![self canLoadURL:URL fromReferrer:referrer hideReferrer:&hideReferrer])
-        return;
-
-    if ([target length] == 0) {
-        target = nil;
-    }
-
-    WebFrame *targetFrame = [_frame findFrameNamed:target];
-    if (![self canTargetLoadInFrame:[targetFrame _bridge]]) {
-        return;
-    }
-    
-    WebFrameLoadType loadType;
-    
-    if (reload)
-        loadType = WebFrameLoadTypeReload;
-    else if (!forUser)
-        loadType = WebFrameLoadTypeInternal;
-    else
-        loadType = WebFrameLoadTypeStandard;
-    [[self frameLoader] loadURL:URL referrer:(hideReferrer ? nil : referrer) loadType:loadType target:target triggeringEvent:event form:form formValues:values];
-
-    if (targetFrame != nil && _frame != targetFrame) {
-        [[targetFrame _bridge] activateWindow];
-    }
-}
-
-- (void)postWithURL:(NSURL *)URL referrer:(NSString *)referrer target:(NSString *)target data:(NSArray *)postData contentType:(NSString *)contentType triggeringEvent:(NSEvent *)event form:(DOMElement *)form formValues:(NSDictionary *)values
-{
-    BOOL hideReferrer;
-    if (![self canLoadURL:URL fromReferrer:referrer hideReferrer:&hideReferrer])
-        return;
-
-    if ([target length] == 0)
-        target = nil;
-
-    WebFrame *targetFrame = [_frame findFrameNamed:target];
-    if (![self canTargetLoadInFrame:[targetFrame _bridge]])
-        return;
-
-    [[self frameLoader] postWithURL:URL referrer:(hideReferrer ? nil : referrer) target:target
-        data:postData contentType:contentType
-        triggeringEvent:event form:form formValues:values];
-
-    if (targetFrame != nil && _frame != targetFrame)
-        [[targetFrame _bridge] activateWindow];
-}
-
 - (WebCoreFrameBridge *)createChildFrameNamed:(NSString *)frameName 
                                       withURL:(NSURL *)URL
                                      referrer:(NSString *)referrer
@@ -868,16 +661,6 @@ NSString *WebPluginContainerKey =   @"WebPluginContainer";
     }
 }
 
-- (void)tokenizerProcessedData
-{
-    [[self frameLoader] checkLoadComplete];
-}
-
-- (NSString *)incomingReferrer
-{
-    return [[[self dataSource] request] _web_HTTPReferrer];
-}
-
 - (NSView *)pluginViewWithPackage:(WebPluginPackage *)pluginPackage
                    attributeNames:(NSArray *)attributeNames
                   attributeValues:(NSArray *)attributeValues
@@ -1160,15 +943,6 @@ static BOOL loggedObjectCacheSize = NO;
     return ObjectElementNone;
 }
 
-- (void)loadEmptyDocumentSynchronously
-{
-    NSURL *url = [[NSURL alloc] initWithString:@""];
-    NSURLRequest *request = [[NSURLRequest alloc] initWithURL:url];
-    [_frame loadRequest:request];
-    [request release];
-    [url release];
-}
-
 - (NSString *)MIMETypeForPath:(NSString *)path
 {
     ASSERT(path);
@@ -1319,12 +1093,6 @@ static id <WebFormDelegate> formDelegate(WebFrameBridge *self)
     return [formDelegate(self) textField:element shouldHandleEvent:event inFrame:_frame];
 }
 
-- (void)frameDetached
-{
-    [_frame stopLoading];
-    [[self frameLoader] detachFromParent];
-}
-
 - (void)setHasBorder:(BOOL)hasBorder
 {
     [[_frame frameView] _setHasBorder:hasBorder];
@@ -1512,11 +1280,6 @@ static id <WebFormDelegate> formDelegate(WebFrameBridge *self)
     return [[self webView] isContinuousSpellCheckingEnabled];
 }
 
-- (void)didFirstLayout
-{
-    [[self frameLoader] didFirstLayout];
-}
-
 - (BOOL)_compareDashboardRegions:(NSDictionary *)regions
 {
     return [lastDashboardRegions isEqualToDictionary:regions];
@@ -1691,40 +1454,15 @@ static id <WebFormDelegate> formDelegate(WebFrameBridge *self)
     }
 }
 
-- (void)handledOnloadEvents
-{
-    [_frame _dispatchDidHandleOnloadEventsForFrame];
-}
-
 - (void)closeURL
 {
     [_frame _willCloseURL];
     [super closeURL];
 }
 
-- (NSURLResponse*)mainResourceURLResponse
-{
-    return [[_frame dataSource] response];
-}
-
 - (NSString*)imageTitleForFilename:(NSString*)filename size:(NSSize)size
 {
     return [NSString stringWithFormat:UI_STRING("%@ %.0f×%.0f pixels", "window title for a standalone image (uses multiplication symbol, not x)"), filename, size.width, size.height];
 }
 
-- (void)notifyIconChanged:(NSURL*)iconURL
-{
-    [[self frameLoader] _notifyIconChanged:iconURL];
-}
-
-- (NSURL*)originalRequestURL
-{
-    return [[[[self frameLoader] activeDocumentLoader] initialRequest] URL];
-}
-
-- (BOOL)isLoadTypeReload
-{
-    return [[self frameLoader] loadType] == WebFrameLoadTypeReload;
-}
-
 @end