Reviewed by Darin.
authormjs <mjs@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 9 Oct 2006 06:17:56 +0000 (06:17 +0000)
committermjs <mjs@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 9 Oct 2006 06:17:56 +0000 (06:17 +0000)
        - move all WebFrameLoadDelegate methods across client interface

        * Loader/WebFrameLoader.m:
        (-[WebFrameLoader clientRedirectCancelledOrFinished:]):
        (-[WebFrameLoader clientRedirectedTo:delay:fireDate:lockHistory:isJavaScriptFormAction:]):
        (-[WebFrameLoader continueFragmentScrollAfterNavigationPolicy:formState:]):
        (-[WebFrameLoader closeOldDataSources]):
        (-[WebFrameLoader _notifyIconChanged:]):
        (-[WebFrameLoader prepareForLoadStart]):
        (-[WebFrameLoader didChangeTitleForDocument:]):
        (-[WebFrameLoader transitionToCommitted:]):
        (-[WebFrameLoader checkLoadCompleteForThisFrame]):
        * Loader/WebFrameLoaderClient.h:
        * WebView/WebFrame.m:
        (-[WebFrame _dispatchDidCancelClientRedirectForFrame]):
        (-[WebFrame _dispatchWillPerformClientRedirectToURL:delay:fireDate:]):
        (-[WebFrame _dispatchDidChangeLocationWithinPageForFrame]):
        (-[WebFrame _dispatchWillCloseFrame]):
        (-[WebFrame _dispatchDidReceiveIcon:]):
        (-[WebFrame _dispatchDidStartProvisionalLoadForFrame]):
        (-[WebFrame _dispatchDidReceiveTitle:]):
        (-[WebFrame _dispatchDidCommitLoadForFrame]):
        (-[WebFrame _dispatchDidFailProvisionalLoadWithError:]):
        (-[WebFrame _dispatchDidFailLoadWithError:]):
        (-[WebFrame _dispatchDidFinishLoadForFrame]):

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

WebKit/ChangeLog
WebKit/Loader/WebFrameLoader.m
WebKit/Loader/WebFrameLoaderClient.h
WebKit/WebView/WebFrame.m

index 432b3109d9e54e578af00f9a090b2fcb2ef90efd..df7706c5089aeeeb75e1d4611764c778f1cb5756 100644 (file)
@@ -1,3 +1,33 @@
+2006-10-08  Maciej Stachowiak  <mjs@apple.com>
+
+        Reviewed by Darin.
+        
+        - move all WebFrameLoadDelegate methods across client interface
+
+        * Loader/WebFrameLoader.m:
+        (-[WebFrameLoader clientRedirectCancelledOrFinished:]):
+        (-[WebFrameLoader clientRedirectedTo:delay:fireDate:lockHistory:isJavaScriptFormAction:]):
+        (-[WebFrameLoader continueFragmentScrollAfterNavigationPolicy:formState:]):
+        (-[WebFrameLoader closeOldDataSources]):
+        (-[WebFrameLoader _notifyIconChanged:]):
+        (-[WebFrameLoader prepareForLoadStart]):
+        (-[WebFrameLoader didChangeTitleForDocument:]):
+        (-[WebFrameLoader transitionToCommitted:]):
+        (-[WebFrameLoader checkLoadCompleteForThisFrame]):
+        * Loader/WebFrameLoaderClient.h:
+        * WebView/WebFrame.m:
+        (-[WebFrame _dispatchDidCancelClientRedirectForFrame]):
+        (-[WebFrame _dispatchWillPerformClientRedirectToURL:delay:fireDate:]):
+        (-[WebFrame _dispatchDidChangeLocationWithinPageForFrame]):
+        (-[WebFrame _dispatchWillCloseFrame]):
+        (-[WebFrame _dispatchDidReceiveIcon:]):
+        (-[WebFrame _dispatchDidStartProvisionalLoadForFrame]):
+        (-[WebFrame _dispatchDidReceiveTitle:]):
+        (-[WebFrame _dispatchDidCommitLoadForFrame]):
+        (-[WebFrame _dispatchDidFailProvisionalLoadWithError:]):
+        (-[WebFrame _dispatchDidFailLoadWithError:]):
+        (-[WebFrame _dispatchDidFinishLoadForFrame]):
+
 2006-10-08  Darin Adler  <darin@apple.com>
 
         Reviewed by Maciej.
index 61d213dad17ce2f9694cd9b714cab5cd479a3b44..63eed23b1c3f6979f473aee25c75079785213aa5 100644 (file)
 #import <WebKitSystemInterface.h>
 
 #import "WebDataSourceInternal.h"
-#import "WebDefaultUIDelegate.h"
 #import "WebDocumentLoaderMac.h"
 #import "WebFrameInternal.h"
-#import "WebFrameLoadDelegate.h"
 #import "WebFrameViewInternal.h"
 #import "WebHTMLView.h"
 #import "WebIconDatabasePrivate.h"
@@ -52,7 +50,6 @@
 #import "WebNSURLRequestExtras.h"
 #import "WebResourcePrivate.h"
 #import "WebScriptDebugServerPrivate.h"
-#import "WebUIDelegate.h"
 #import "WebViewInternal.h"
 
 @implementation WebFrameLoader
@@ -552,8 +549,8 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
     // Note that -webView:didCancelClientRedirectForFrame: is called on the frame load delegate even if
     // the redirect succeeded.  We should either rename this API, or add a new method, like
     // -webView:didFinishClientRedirectForFrame:
-    [[[client webView] _frameLoadDelegateForwarder] webView:[client webView]
-                            didCancelClientRedirectForFrame:client];
+    [client _dispatchDidCancelClientRedirectForFrame];
+
     if (!cancelWithLoadInProgress)
         quickRedirectComing = NO;
     
@@ -566,11 +563,7 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
 {
     LOG(Redirect, "%@(%p) Client redirect to: %@, [self dataSource] = %p, lockHistory = %d, isJavaScriptFormAction = %d", [client name], self, URL, [self dataSource], (int)lockHistory, (int)isJavaScriptFormAction);
     
-    [[[client webView] _frameLoadDelegateForwarder] webView:[client webView]
-                             willPerformClientRedirectToURL:URL
-                                                      delay:seconds
-                                                   fireDate:date
-                                                   forFrame:client];
+    [client _dispatchWillPerformClientRedirectToURL:URL delay:seconds fireDate:date];
     
     // Remember that we sent a redirect notification to the frame load delegate so that when we commit
     // the next provisional load, we can send a corresponding -webView:didCancelClientRedirectForFrame:
@@ -718,10 +711,8 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
         // we'll not go through a real load and reach Completed state
         [self checkLoadComplete];
     }
-    
-    [[[client webView] _frameLoadDelegateForwarder] webView:[client webView]
-                        didChangeLocationWithinPageForFrame:client];
-
+    [client _dispatchDidChangeLocationWithinPageForFrame];
     [client _didFinishLoad];
 }
 
@@ -733,7 +724,8 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
         [[(WebFrameBridge *)child frameLoader] closeOldDataSources];
     
     if (documentLoader)
-        [[[client webView] _frameLoadDelegateForwarder] webView:[client webView] willCloseFrame:client];
+        [client _dispatchWillCloseFrame];
+
     [[client webView] setMainFrameDocumentReady:NO];  // stop giving out the actual DOMDocument to observers
 }
 
@@ -899,9 +891,7 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
     
     NSImage *icon = [[WebIconDatabase sharedIconDatabase] iconForURL:[[[self activeDataSource] _URL] _web_originalDataAsString] withSize:WebIconSmallSize];
     
-    [[[client webView] _frameLoadDelegateForwarder] webView:[client webView]
-                                               didReceiveIcon:icon
-                                                     forFrame:client];
+    [client _dispatchDidReceiveIcon:icon];
     
     [[client webView] _didChangeValueForKey:_WebMainFrameIconKey];
 }
@@ -1297,8 +1287,7 @@ BOOL isBackForwardLoadType(FrameLoadType type)
 {
     [[client webView] _progressStarted:client];
     [[client webView] _didStartProvisionalLoadForFrame:client];
-    [[[client webView] _frameLoadDelegateForwarder] webView:[client webView]
-                               didStartProvisionalLoadForFrame:client];    
+    [client _dispatchDidStartProvisionalLoadForFrame];
 }
 
 - (BOOL)subframeIsLoading
@@ -1329,8 +1318,8 @@ BOOL isBackForwardLoadType(FrameLoadType type)
             // This must go through the WebFrame because it has the right notion of the current b/f item.
             [client _setTitle:[loader title] forURL:URLForHistory];
             [[client webView] setMainFrameDocumentReady:YES]; // update observers with new DOMDocument
-            [[[client webView] _frameLoadDelegateForwarder] webView:[client webView]
-                didReceiveTitle:[loader title] forFrame:client];
+
+            [client _dispatchDidReceiveTitle:[loader title]];
         }
     }
 }
@@ -1746,13 +1735,11 @@ keepGoing:
     // Tell the client we've committed this URL.
     ASSERT([[client frameView] documentView] != nil);
     [[client webView] _didCommitLoadForFrame:client];
-    [[[client webView] _frameLoadDelegateForwarder] webView:[client webView] didCommitLoadForFrame:client];
+    [client _dispatchDidCommitLoadForFrame];
     
     // If we have a title let the WebView know about it.
     if (ptitle)
-        [[[client webView] _frameLoadDelegateForwarder] webView:[client webView]
-                                                didReceiveTitle:ptitle
-                                                       forFrame:client];
+        [client _dispatchDidReceiveTitle:ptitle];
 }
 
 - (void)checkLoadCompleteForThisFrame
@@ -1778,9 +1765,8 @@ keepGoing:
                     LOG(Loading, "%@:  checking complete in WebFrameStateProvisional, load done", [client name]);
                     [[client webView] _didFailProvisionalLoadWithError:error forFrame:client];
                     delegateIsHandlingProvisionalLoadError = YES;
-                    [[[client webView] _frameLoadDelegateForwarder] webView:[client webView]
-                                            didFailProvisionalLoadWithError:error
-                                                                   forFrame:client];
+                    [client _dispatchDidFailProvisionalLoadWithError:error];
+
                     delegateIsHandlingProvisionalLoadError = NO;
                     [[client _internalLoadDelegate] webFrame:client didFinishLoadWithError:error];
 
@@ -1861,14 +1847,11 @@ keepGoing:
                 NSError *error = [ds _mainDocumentError];
                 if (error != nil) {
                     [[client webView] _didFailLoadWithError:error forFrame:client];
-                    [[[client webView] _frameLoadDelegateForwarder] webView:[client webView]
-                                                     didFailLoadWithError:error
-                                                                 forFrame:client];
+                    [client _dispatchDidFailLoadWithError:error];
                     [[client _internalLoadDelegate] webFrame:client didFinishLoadWithError:error];
                 } else {
                     [[client webView] _didFinishLoadForFrame:client];
-                    [[[client webView] _frameLoadDelegateForwarder] webView:[client webView]
-                                                    didFinishLoadForFrame:client];
+                    [client _dispatchDidFinishLoadForFrame];
                     [[client _internalLoadDelegate] webFrame:client didFinishLoadWithError:nil];
                 }
                 
index c41f7cc4f1d06835ff1e6bae8b9ed566073a9d33..1c29badc226b260dc93bd7015176478db580186a 100644 (file)
@@ -65,8 +65,6 @@ typedef struct LoadErrorResetToken LoadErrorResetToken;
 
 - (void)_downloadWithLoadingConnection:(NSURLConnection *)connection request:(NSURLRequest *)request response:(NSURLResponse *)response proxy:(id)proxy;
 
-- (void)_dispatchDidHandleOnloadEventsForFrame;
-- (void)_dispatchDidReceiveServerRedirectForProvisionalLoadForFrame;
 - (id)_dispatchIdentifierForInitialRequest:(NSURLRequest *)request fromDocumentLoader:(WebDocumentLoader *)loader;
 - (NSURLRequest *)_dispatchResource:(id)identifier willSendRequest:(NSURLRequest *)clientRequest redirectResponse:(NSURLResponse *)redirectResponse fromDocumentLoader:(WebDocumentLoader *)loader;
 - (void)_dispatchDidReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)currentWebChallenge forResource:(id)identifier fromDocumentLoader:(WebDocumentLoader *)loader;
@@ -76,4 +74,19 @@ typedef struct LoadErrorResetToken LoadErrorResetToken;
 - (void)_dispatchResource:(id)identifier didFinishLoadingFromDocumentLoader:(WebDocumentLoader *)loader;
 - (void)_dispatchResource:(id)identifier didFailLoadingWithError:error fromDocumentLoader:(WebDocumentLoader *)loader;
 
+- (void)_dispatchDidHandleOnloadEventsForFrame;
+- (void)_dispatchDidReceiveServerRedirectForProvisionalLoadForFrame;
+- (void)_dispatchDidCancelClientRedirectForFrame;
+- (void)_dispatchWillPerformClientRedirectToURL:(NSURL *)URL delay:(NSTimeInterval)seconds fireDate:(NSDate *)date;
+- (void)_dispatchDidChangeLocationWithinPageForFrame;
+- (void)_dispatchWillCloseFrame;
+- (void)_dispatchDidReceiveIcon:(NSImage *)icon;
+- (void)_dispatchDidStartProvisionalLoadForFrame;
+- (void)_dispatchDidReceiveTitle:(NSString *)title;
+- (void)_dispatchDidCommitLoadForFrame;
+- (void)_dispatchDidFailProvisionalLoadWithError:(NSError *)error;
+- (void)_dispatchDidFailLoadWithError:(NSError *)error;
+- (void)_dispatchDidFinishLoadForFrame;
+
+
 @end
index 62afc83d868e772f66790a47a25c0d2c8287b775..e1dec1aa838cc93e234b28ed02b35cc85daa3e2a 100644 (file)
@@ -1687,7 +1687,77 @@ static inline WebDataSource *dataSource(WebDocumentLoader *loader)
     WebView *webView = [self webView];
     [[webView _resourceLoadDelegateForwarder] webView:webView resource:identifier didFailLoadingWithError:error fromDataSource:dataSource(loader)];
 }
-    
+
+- (void)_dispatchDidCancelClientRedirectForFrame
+{
+    WebView *webView = [self webView];
+    [[webView _frameLoadDelegateForwarder] webView:webView didCancelClientRedirectForFrame:self];
+}
+
+- (void)_dispatchWillPerformClientRedirectToURL:(NSURL *)URL delay:(NSTimeInterval)seconds fireDate:(NSDate *)date
+{
+    WebView *webView = [self webView];   
+    [[webView _frameLoadDelegateForwarder] webView:webView
+                         willPerformClientRedirectToURL:URL
+                                                  delay:seconds
+                                               fireDate:date
+                                               forFrame:self];
+}
+
+- (void)_dispatchDidChangeLocationWithinPageForFrame
+{
+    WebView *webView = [self webView];   
+    [[webView _frameLoadDelegateForwarder] webView:webView didChangeLocationWithinPageForFrame:self];
+}
+
+- (void)_dispatchWillCloseFrame
+{
+    WebView *webView = [self webView];   
+    [[webView _frameLoadDelegateForwarder] webView:webView willCloseFrame:self];
+}
+
+- (void)_dispatchDidReceiveIcon:(NSImage *)icon
+{
+    WebView *webView = [self webView];   
+    [[webView _frameLoadDelegateForwarder] webView:webView didReceiveIcon:icon forFrame:self];
+}
+
+- (void)_dispatchDidStartProvisionalLoadForFrame
+{
+    WebView *webView = [self webView];   
+    [[webView _frameLoadDelegateForwarder] webView:webView didStartProvisionalLoadForFrame:self];    
+}
+
+- (void)_dispatchDidReceiveTitle:(NSString *)title
+{
+    WebView *webView = [self webView];   
+    [[webView _frameLoadDelegateForwarder] webView:webView didReceiveTitle:title forFrame:self];
+}
+
+- (void)_dispatchDidCommitLoadForFrame
+{
+    WebView *webView = [self webView];   
+    [[webView _frameLoadDelegateForwarder] webView:webView didCommitLoadForFrame:self];
+}
+
+- (void)_dispatchDidFailProvisionalLoadWithError:(NSError *)error
+{
+    WebView *webView = [self webView];   
+    [[webView _frameLoadDelegateForwarder] webView:webView didFailProvisionalLoadWithError:error forFrame:self];
+}
+
+- (void)_dispatchDidFailLoadWithError:(NSError *)error
+{
+    WebView *webView = [self webView];   
+    [[webView _frameLoadDelegateForwarder] webView:webView didFailLoadWithError:error forFrame:self];
+}
+
+- (void)_dispatchDidFinishLoadForFrame
+{
+    WebView *webView = [self webView];   
+    [[webView _frameLoadDelegateForwarder] webView:webView didFinishLoadForFrame:self];
+}
+
 - (void)_detachedFromParent1
 {
     [self _saveScrollPositionAndViewStateToItem:_private->currentItem];