Reviewed by Maciej.
authordarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 6 Oct 2006 21:25:08 +0000 (21:25 +0000)
committerdarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 6 Oct 2006 21:25:08 +0000 (21:25 +0000)
        - added WebFrameLoaderClient protocol -- to be used to make WebFrameLoader forget all about WebFrame

        * Loader/WebDocumentLoadState.h: Added comment about Maciej's planned renaming here.
        * Loader/WebFrameLoader.h:
        * Loader/WebFrameLoader.m: Renamed webFrame to client and added the new protocol.
        Eventually we'll be removing the dependency on WebFrame entirely.
        * WebView/WebFrame.m: (-[WebFrame _initWithWebFrameView:webView:bridge:]): Update to call the method
        by its new name.

        * Loader/WebFrameLoaderClient.h: Added.
        * WebKit.xcodeproj/project.pbxproj: Updated for new file, sorted things.

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

WebKit/ChangeLog
WebKit/Loader/WebDocumentLoadState.h
WebKit/Loader/WebFrameLoader.h
WebKit/Loader/WebFrameLoader.m
WebKit/Loader/WebFrameLoaderClient.h [new file with mode: 0644]
WebKit/WebKit.xcodeproj/project.pbxproj
WebKit/WebView/WebFrame.m

index 0648f218c9531215dc38d9a0203752c5782c3912..169f5dec70fbeedceadc506da31293fbe1614f11 100644 (file)
@@ -1,3 +1,19 @@
+2006-10-06  Darin Adler  <darin@apple.com>
+
+        Reviewed by Maciej.
+
+        - added WebFrameLoaderClient protocol -- to be used to make WebFrameLoader forget all about WebFrame
+
+        * Loader/WebDocumentLoadState.h: Added comment about Maciej's planned renaming here.
+        * Loader/WebFrameLoader.h:
+        * Loader/WebFrameLoader.m: Renamed webFrame to client and added the new protocol.
+        Eventually we'll be removing the dependency on WebFrame entirely.
+        * WebView/WebFrame.m: (-[WebFrame _initWithWebFrameView:webView:bridge:]): Update to call the method
+        by its new name.
+
+        * Loader/WebFrameLoaderClient.h: Added.
+        * WebKit.xcodeproj/project.pbxproj: Updated for new file, sorted things.
+
 2006-10-06  Maciej Stachowiak  <mjs@apple.com>
 
         Reviewed by Darin.
index bf333c141bf38b23f91fd8319dd242d0161e783d..0ea7751949453742448a98bd48d79d4bada6e167 100644 (file)
@@ -30,6 +30,7 @@
 
 @class WebFrameLoader;
 
+// To be renamed to WebDocumentLoader
 @interface WebDocumentLoadState : NSObject
 {
 @public
index 01eace46ca793ea90345454b81d136aedf531cf5..cfc68ddcd1cc31b19adbc6cdde371491a6bf9a07 100644 (file)
@@ -28,9 +28,9 @@
 
 #import <Cocoa/Cocoa.h>
 
-#import <WebKit/WebFramePrivate.h>
-
-#import <WebKit/WebDocumentLoadState.h>
+#import "WebDocumentLoadState.h"
+#import "WebFrameLoaderClient.h"
+#import "WebFramePrivate.h"
 
 @class WebArchive;
 @class WebDataSource;
@@ -64,7 +64,7 @@ typedef enum {
     NSMutableArray *subresourceLoaders;
     NSMutableArray *plugInStreamLoaders;
     
-    WebFrame *webFrame;
+    WebFrame <WebFrameLoaderClient> *client;
     WebDocumentLoadState *documentLoadState;
     WebDocumentLoadState *provisionalDocumentLoadState;
     WebDocumentLoadState *policyDocumentLoadState;
@@ -76,7 +76,7 @@ typedef enum {
     NSMutableDictionary *pendingArchivedResources;
 }
 
-- (id)initWithWebFrame:(WebFrame *)wf;
+- (id)initWithClient:(WebFrame <WebFrameLoaderClient> *)wf;
 - (void)addPlugInStreamLoader:(WebLoader *)loader;
 - (void)removePlugInStreamLoader:(WebLoader *)loader;
 - (void)setDefersCallbacks:(BOOL)defers;
index 5ae4b83d8f56ceb278536d7bb0680c2d3f9c3987..946ed46e7093d0efc8ad86556a670f953dfa014e 100644 (file)
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#import <WebKit/WebFrameLoader.h>
-
+#import "WebFrameLoader.h"
+
+#import "WebDataProtocol.h"
+#import "WebDataSourceInternal.h"
+#import "WebFrameBridge.h"
+#import "WebFrameInternal.h"
+#import "WebFrameLoadDelegate.h"
+#import "WebIconDatabasePrivate.h"
+#import "WebKitErrorsPrivate.h"
+#import "WebKitLogging.h"
+#import "WebKitNSStringExtras.h"
+#import "WebMainResourceLoader.h"
+#import "WebNSDictionaryExtras.h"
+#import "WebNSURLExtras.h"
+#import "WebPreferences.h"
+#import "WebResourcePrivate.h"
+#import "WebScriptDebugServerPrivate.h"
+#import "WebViewInternal.h"
 #import <JavaScriptCore/Assertions.h>
-#import <WebKit/WebDataSourceInternal.h>
-#import <WebKit/WebFrameInternal.h>
-#import <WebKit/WebMainResourceLoader.h>
-#import <WebKit/WebKitLogging.h>
-#import <WebKit/WebViewInternal.h>
-#import <WebKit/WebKitErrorsPrivate.h>
-#import <WebKit/WebResourcePrivate.h>
 #import <WebKit/DOMHTML.h>
-#import <WebKit/WebFrameBridge.h>
-#import <WebKit/WebPreferences.h>
-#import <WebKit/WebIconDatabasePrivate.h>
-#import <WebKit/WebNSURLExtras.h>
-#import <WebKit/WebFrameLoadDelegate.h>
-#import <WebKit/WebDataProtocol.h>
-#import <WebKit/WebKitNSStringExtras.h>
-#import <WebKit/WebScriptDebugServerPrivate.h>
-#import "WebNSDictionaryExtras.h"
 
 @implementation WebFrameLoader
 
-- (id)initWithWebFrame:(WebFrame *)wf
+- (id)initWithClient:(WebFrame <WebFrameLoaderClient> *)c
 {
     self = [super init];
     if (self) {
-        webFrame = wf;
+        client = c;
         state = WebFrameStateCommittedPage;
     }
     return self;    
@@ -83,7 +83,7 @@
 
 - (WebDataSource *)activeDataSource
 {
-    return [webFrame _dataSourceForDocumentLoadState:[self activeDocumentLoadState]];
+    return [client _dataSourceForDocumentLoadState:[self activeDocumentLoadState]];
 }
 
 - (WebResource *)_archivedSubresourceForURL:(NSURL *)URL
 
 - (void)defersCallbacksChanged
 {
-    [self setDefersCallbacks:[[webFrame webView] defersCallbacks]];
+    [self setDefersCallbacks:[[client webView] defersCallbacks]];
 }
 
 - (BOOL)defersCallbacks
 {
-    return [[webFrame webView] defersCallbacks];
+    return [[client webView] defersCallbacks];
 }
 
 - (void)setDefersCallbacks:(BOOL)defers
     mainResourceLoader = [[WebMainResourceLoader alloc] initWithFrameLoader:self];
     
     [mainResourceLoader setIdentifier:identifier];
-    [webFrame _addExtraFieldsToRequest:request mainResource:YES alwaysFromRequest:NO];
+    [client _addExtraFieldsToRequest:request mainResource:YES alwaysFromRequest:NO];
     if (![mainResourceLoader loadWithRequest:request]) {
         // FIXME: if this should really be caught, we should just ASSERT this doesn't happen;
         // should it be caught by other parts of WebKit or other parts of the app?
 
 - (WebDataSource *)dataSource
 {
-    return [webFrame _dataSourceForDocumentLoadState:documentLoadState]; 
+    return [client _dataSourceForDocumentLoadState:documentLoadState]; 
 }
 
 - (void)_setDocumentLoadState:(WebDocumentLoadState *)loadState
     
     ASSERT(loadState != documentLoadState);
     
-    [webFrame _prepareForDataSourceReplacement];
+    [client _prepareForDataSourceReplacement];
     [documentLoadState detachFromFrameLoader];
     
     [loadState retain];
 
 - (WebDataSource *)policyDataSource
 {
-    return [webFrame _dataSourceForDocumentLoadState:policyDocumentLoadState];     
+    return [client _dataSourceForDocumentLoadState:policyDocumentLoadState];     
 }
 
 - (void)_setPolicyDocumentLoadState:(WebDocumentLoadState *)loadState
 
 - (WebDataSource *)provisionalDataSource 
 {
-    return [webFrame _dataSourceForDocumentLoadState:provisionalDocumentLoadState]; 
+    return [client _dataSourceForDocumentLoadState:provisionalDocumentLoadState]; 
 }
 
 - (WebDocumentLoadState *)provisionalDocumentLoadState
@@ -310,19 +310,19 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
 
 - (void)_setState:(WebFrameState)newState
 {
-    LOG(Loading, "%@:  transition from %s to %s", [webFrame name], stateNames[state], stateNames[newState]);
-    if ([webFrame webView])
-        LOG(Timing, "%@:  transition from %s to %s, %f seconds since start of document load", [webFrame name], stateNames[state], stateNames[newState], CFAbsoluteTimeGetCurrent() - [[[[[webFrame webView] mainFrame] dataSource] _documentLoadState] loadingStartedTime]);
+    LOG(Loading, "%@:  transition from %s to %s", [client name], stateNames[state], stateNames[newState]);
+    if ([client webView])
+        LOG(Timing, "%@:  transition from %s to %s, %f seconds since start of document load", [client name], stateNames[state], stateNames[newState], CFAbsoluteTimeGetCurrent() - [[[[[client webView] mainFrame] dataSource] _documentLoadState] loadingStartedTime]);
     
-    if (newState == WebFrameStateComplete && webFrame == [[webFrame webView] mainFrame])
+    if (newState == WebFrameStateComplete && client == [[client webView] mainFrame])
         LOG(DocumentLoad, "completed %@ (%f seconds)", [[[self dataSource] request] URL], CFAbsoluteTimeGetCurrent() - [[[self dataSource] _documentLoadState] loadingStartedTime]);
     
     state = newState;
     
     if (state == WebFrameStateProvisional)
-        [webFrame _provisionalLoadStarted];
+        [client _provisionalLoadStarted];
     else if (state == WebFrameStateComplete) {
-        [webFrame _frameLoadCompleted];
+        [client _frameLoadCompleted];
         _timeOfLastCompletedLoad = CFAbsoluteTimeGetCurrent();
         [[self dataSource] _stopRecordingResponses];
     }
@@ -331,7 +331,7 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
 - (void)clearProvisionalLoad
 {
     [self _setProvisionalDocumentLoadState:nil];
-    [[webFrame webView] _progressCompleted:webFrame];
+    [[client webView] _progressCompleted:client];
     [self _setState:WebFrameStateComplete];
 }
 
@@ -378,7 +378,7 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
     documentLoadState = nil;
     [old release];
     
-    [webFrame _detachChildren];
+    [client _detachChildren];
 }
 
 - (id)_identifierForInitialRequest:(NSURLRequest *)clientRequest
@@ -423,17 +423,17 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
 
 - (BOOL)_privateBrowsingEnabled
 {
-    return [[[webFrame webView] preferences] privateBrowsingEnabled];
+    return [[[client webView] preferences] privateBrowsingEnabled];
 }
 
 - (void)_finishedLoadingResource
 {
-    [webFrame _checkLoadComplete];
+    [client _checkLoadComplete];
 }
 
 - (void)_receivedError:(NSError *)error
 {
-    [webFrame _checkLoadComplete];
+    [client _checkLoadComplete];
 }
 
 - (NSURLRequest *)_originalRequest
@@ -443,7 +443,7 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
 
 - (WebFrame *)webFrame
 {
-    return webFrame;
+    return client;
 }
 
 - (void)_receivedMainResourceError:(NSError *)error complete:(BOOL)isComplete
@@ -476,7 +476,7 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
 
 - (WebFrameBridge *)bridge
 {
-    return [webFrame _bridge];
+    return [client _bridge];
 }
 
 - (void)_handleFallbackContent
@@ -518,8 +518,8 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
 
     [[self activeDocumentLoadState] setPrimaryLoadComplete:YES];
     if ([WebScriptDebugServer listenerCount])
-        [[WebScriptDebugServer sharedScriptDebugServer] webView:[webFrame webView] didLoadMainResourceForDataSource:[self activeDataSource]];
-    [webFrame _checkLoadComplete];
+        [[WebScriptDebugServer sharedScriptDebugServer] webView:[client webView] didLoadMainResourceForDataSource:[self activeDataSource]];
+    [client _checkLoadComplete];
 
     [self release];
 }
@@ -527,17 +527,17 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
 - (void)_notifyIconChanged:(NSURL *)iconURL
 {
     ASSERT([[WebIconDatabase sharedIconDatabase] _isEnabled]);
-    ASSERT(webFrame == [[webFrame webView] mainFrame]);
+    ASSERT(client == [[client webView] mainFrame]);
 
-    [[webFrame webView] _willChangeValueForKey:_WebMainFrameIconKey];
+    [[client webView] _willChangeValueForKey:_WebMainFrameIconKey];
     
     NSImage *icon = [[WebIconDatabase sharedIconDatabase] iconForURL:[[[self activeDataSource] _URL] _web_originalDataAsString] withSize:WebIconSmallSize];
     
-    [[[webFrame webView] _frameLoadDelegateForwarder] webView:[webFrame webView]
+    [[[client webView] _frameLoadDelegateForwarder] webView:[client webView]
                                                didReceiveIcon:icon
-                                                     forFrame:webFrame];
+                                                     forFrame:client];
     
-    [[webFrame webView] _didChangeValueForKey:_WebMainFrameIconKey];
+    [[client webView] _didChangeValueForKey:_WebMainFrameIconKey];
 }
 
 - (NSURL *)_URL
@@ -671,12 +671,12 @@ static BOOL isCaseInsensitiveEqual(NSString *a, NSString *b)
 
 - (void)_addExtraFieldsToRequest:(NSMutableURLRequest *)request mainResource:(BOOL)mainResource alwaysFromRequest:(BOOL)f
 {
-    [webFrame _addExtraFieldsToRequest:request mainResource:mainResource alwaysFromRequest:f];
+    [client _addExtraFieldsToRequest:request mainResource:mainResource alwaysFromRequest:f];
 }
 
 - (void)cannotShowMIMETypeForURL:(NSURL *)URL
 {
-    [webFrame _handleUnimplementablePolicyWithErrorCode:WebKitErrorCannotShowMIMEType forURL:URL];    
+    [client _handleUnimplementablePolicyWithErrorCode:WebKitErrorCannotShowMIMEType forURL:URL];    
 }
 
 - (NSError *)interruptForPolicyChangeErrorWithRequest:(NSURLRequest *)request
@@ -687,13 +687,13 @@ static BOOL isCaseInsensitiveEqual(NSString *a, NSString *b)
 - (BOOL)isHostedByObjectElement
 {
     // Handle <object> fallback for error cases.            
-    DOMHTMLElement *hostElement = [webFrame frameElement];
+    DOMHTMLElement *hostElement = [client frameElement];
     return hostElement && [hostElement isKindOfClass:[DOMHTMLObjectElement class]];
 }
 
 - (BOOL)isLoadingMainFrame
 {
-    return [webFrame _isMainFrame];
+    return [client _isMainFrame];
 }
 
 + (BOOL)_canShowMIMEType:(NSString *)MIMEType
@@ -713,7 +713,7 @@ static BOOL isCaseInsensitiveEqual(NSString *a, NSString *b)
 
 - (void)_checkNavigationPolicyForRequest:(NSURLRequest *)newRequest andCall:(id)obj withSelector:(SEL)sel
 {
-    [webFrame _checkNavigationPolicyForRequest:newRequest
+    [client _checkNavigationPolicyForRequest:newRequest
                                     dataSource:[self activeDataSource]
                                      formState:nil
                                        andCall:obj
@@ -741,12 +741,12 @@ static BOOL isCaseInsensitiveEqual(NSString *a, NSString *b)
 {
     WebFrameLoadType loadType;
     
-    policyDocumentLoadState = [webFrame _createDocumentLoadStateWithRequest:request];
-    WebDataSource *newDataSource = [webFrame _dataSourceForDocumentLoadState:policyDocumentLoadState];
+    policyDocumentLoadState = [client _createDocumentLoadStateWithRequest:request];
+    WebDataSource *newDataSource = [client _dataSourceForDocumentLoadState:policyDocumentLoadState];
 
     NSMutableURLRequest *r = [newDataSource request];
-    [webFrame _addExtraFieldsToRequest:r mainResource:YES alwaysFromRequest:NO];
-    if ([webFrame _shouldTreatURLAsSameAsCurrent:[request URL]]) {
+    [client _addExtraFieldsToRequest:r mainResource:YES alwaysFromRequest:NO];
+    if ([client _shouldTreatURLAsSameAsCurrent:[request URL]]) {
         [r setCachePolicy:NSURLRequestReloadIgnoringCacheData];
         loadType = WebFrameLoadTypeSame;
     } else
@@ -758,24 +758,24 @@ static BOOL isCaseInsensitiveEqual(NSString *a, NSString *b)
     // When we loading alternate content for an unreachable URL that we're
     // visiting in the b/f list, we treat it as a reload so the b/f list 
     // is appropriately maintained.
-    if ([webFrame _shouldReloadToHandleUnreachableURLFromRequest:request]) {
+    if ([client _shouldReloadToHandleUnreachableURLFromRequest:request]) {
         ASSERT(loadType == WebFrameLoadTypeStandard);
         loadType = WebFrameLoadTypeReload;
     }
     
-    [webFrame _loadDataSource:newDataSource withLoadType:loadType formState:nil];
+    [client _loadDataSource:newDataSource withLoadType:loadType formState:nil];
 }
 
 - (void)_loadRequest:(NSURLRequest *)request triggeringAction:(NSDictionary *)action loadType:(WebFrameLoadType)loadType formState:(WebFormState *)formState
 {
-    policyDocumentLoadState = [webFrame _createDocumentLoadStateWithRequest:request];
-    WebDataSource *newDataSource = [webFrame _dataSourceForDocumentLoadState:policyDocumentLoadState];
+    policyDocumentLoadState = [client _createDocumentLoadStateWithRequest:request];
+    WebDataSource *newDataSource = [client _dataSourceForDocumentLoadState:policyDocumentLoadState];
 
     [newDataSource _setTriggeringAction:action];
 
     [newDataSource _setOverrideEncoding:[[self dataSource] _overrideEncoding]];
 
-    [webFrame _loadDataSource:newDataSource withLoadType:loadType formState:formState];
+    [client _loadDataSource:newDataSource withLoadType:loadType formState:formState];
 }
 
 - (void)_reloadAllowingStaleDataWithOverrideEncoding:(NSString *)encoding
@@ -790,13 +790,13 @@ static BOOL isCaseInsensitiveEqual(NSString *a, NSString *b)
         [request setURL:unreachableURL];
 
     [request setCachePolicy:NSURLRequestReturnCacheDataElseLoad];
-    policyDocumentLoadState = [webFrame _createDocumentLoadStateWithRequest:request];
-    WebDataSource *newDataSource = [webFrame _dataSourceForDocumentLoadState:policyDocumentLoadState];
+    policyDocumentLoadState = [client _createDocumentLoadStateWithRequest:request];
+    WebDataSource *newDataSource = [client _dataSourceForDocumentLoadState:policyDocumentLoadState];
     [request release];
     
     [newDataSource _setOverrideEncoding:encoding];
 
-    [webFrame _loadDataSource:newDataSource withLoadType:WebFrameLoadTypeReloadAllowingStaleData formState:nil];
+    [client _loadDataSource:newDataSource withLoadType:WebFrameLoadTypeReloadAllowingStaleData formState:nil];
 }
 
 - (void)reload
@@ -817,87 +817,87 @@ static BOOL isCaseInsensitiveEqual(NSString *a, NSString *b)
     if (unreachableURL != nil)
         initialRequest = [NSURLRequest requestWithURL:unreachableURL];
     
-    policyDocumentLoadState = [webFrame _createDocumentLoadStateWithRequest:initialRequest];
-    WebDataSource *newDataSource = [webFrame _dataSourceForDocumentLoadState:policyDocumentLoadState];
+    policyDocumentLoadState = [client _createDocumentLoadStateWithRequest:initialRequest];
+    WebDataSource *newDataSource = [client _dataSourceForDocumentLoadState:policyDocumentLoadState];
     NSMutableURLRequest *request = [newDataSource request];
 
     [request setCachePolicy:NSURLRequestReloadIgnoringCacheData];
 
     // If we're about to rePOST, set up action so the app can warn the user
     if ([[request HTTPMethod] _webkit_isCaseInsensitiveEqualToString:@"POST"]) {
-        NSDictionary *action = [webFrame _actionInformationForNavigationType:WebNavigationTypeFormResubmitted event:nil originalURL:[request URL]];
+        NSDictionary *action = [client _actionInformationForNavigationType:WebNavigationTypeFormResubmitted event:nil originalURL:[request URL]];
         [newDataSource _setTriggeringAction:action];
     }
 
     [newDataSource _setOverrideEncoding:[ds _overrideEncoding]];
     
-    [webFrame _loadDataSource:newDataSource withLoadType:WebFrameLoadTypeReload formState:nil];
+    [client _loadDataSource:newDataSource withLoadType:WebFrameLoadTypeReload formState:nil];
 }
 
 - (void)didReceiveServerRedirectForProvisionalLoadForFrame
 {
-    [webFrame _didReceiveServerRedirectForProvisionalLoadForFrame];
+    [client _didReceiveServerRedirectForProvisionalLoadForFrame];
 }
 
 - (void)finishedLoadingDocumentLoadState:(WebDocumentLoadState *)loadState
 {
-    [[webFrame _dataSourceForDocumentLoadState:loadState] _finishedLoading];
+    [[client _dataSourceForDocumentLoadState:loadState] _finishedLoading];
 }
 
 - (void)commitProvisitionalLoad
 {
-    [webFrame _commitProvisionalLoad:nil];
+    [client _commitProvisionalLoad:nil];
 }
 
 - (void)committedLoadWithDocumentLoadState:(WebDocumentLoadState *)loadState data:(NSData *)data
 {
-    [[webFrame _dataSourceForDocumentLoadState:loadState] _receivedData:data];
+    [[client _dataSourceForDocumentLoadState:loadState] _receivedData:data];
 }
 
 - (BOOL)isReplacing
 {
-    return [webFrame _loadType] == WebFrameLoadTypeReplace;
+    return [client _loadType] == WebFrameLoadTypeReplace;
 }
 
 - (void)setReplacing
 {
-    [webFrame _setLoadType:WebFrameLoadTypeReplace];
+    [client _setLoadType:WebFrameLoadTypeReplace];
 }
 
 - (void)revertToProvisionalWithDocumentLoadState:(WebDocumentLoadState *)loadState
 {
-    [[webFrame _dataSourceForDocumentLoadState:loadState] _revertToProvisionalState];
+    [[client _dataSourceForDocumentLoadState:loadState] _revertToProvisionalState];
 }
 
 - (void)documentLoadState:(WebDocumentLoadState *)loadState setMainDocumentError:(NSError *)error
 {
-    [[webFrame _dataSourceForDocumentLoadState:loadState] _setMainDocumentError:error];
+    [[client _dataSourceForDocumentLoadState:loadState] _setMainDocumentError:error];
 }
 
 - (void)documentLoadState:(WebDocumentLoadState *)loadState mainReceivedCompleteError:(NSError *)error
 {
     [loadState setPrimaryLoadComplete:YES];
     if ([WebScriptDebugServer listenerCount])
-        [[WebScriptDebugServer sharedScriptDebugServer] webView:[webFrame webView] didLoadMainResourceForDataSource:[self activeDataSource]];
-    [webFrame _checkLoadComplete];
+        [[WebScriptDebugServer sharedScriptDebugServer] webView:[client webView] didLoadMainResourceForDataSource:[self activeDataSource]];
+    [client _checkLoadComplete];
 }
 
 - (void)finalSetupForReplaceWithDocumentLoadState:(WebDocumentLoadState *)loadState
 {
-    [[webFrame _dataSourceForDocumentLoadState:loadState] _clearUnarchivingState];
+    [[client _dataSourceForDocumentLoadState:loadState] _clearUnarchivingState];
 }
 
 - (void)prepareForLoadStart
 {
-    [[webFrame webView] _progressStarted:webFrame];
-    [[webFrame webView] _didStartProvisionalLoadForFrame:webFrame];
-    [[[webFrame webView] _frameLoadDelegateForwarder] webView:[webFrame webView]
-                               didStartProvisionalLoadForFrame:webFrame];    
+    [[client webView] _progressStarted:client];
+    [[client webView] _didStartProvisionalLoadForFrame:client];
+    [[[client webView] _frameLoadDelegateForwarder] webView:[client webView]
+                               didStartProvisionalLoadForFrame:client];    
 }
 
 - (BOOL)subframeIsLoading
 {
-    return [webFrame _subframeIsLoading];
+    return [client _subframeIsLoading];
 }
 
 @end
diff --git a/WebKit/Loader/WebFrameLoaderClient.h b/WebKit/Loader/WebFrameLoaderClient.h
new file mode 100644 (file)
index 0000000..9d57c8a
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 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 <Cocoa/Cocoa.h>
+
+@protocol WebFrameLoaderClient
+
+@end
index 413077d98f2cf8152923fa4ca533148c2828b3dd..6a2ab7242a1f039d2f9e602b38b33d5c4af65bf3 100644 (file)
@@ -78,6 +78,7 @@
                7E6FEF0808985A7200C44C3F /* WebScriptDebugDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E6FEF0508985A7200C44C3F /* WebScriptDebugDelegate.h */; settings = {ATTRIBUTES = (Private, ); }; };
                7E6FEF0908985A7200C44C3F /* WebScriptDebugDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7E6FEF0608985A7200C44C3F /* WebScriptDebugDelegate.m */; };
                7E6FEF0A08985A7200C44C3F /* WebScriptDebugDelegatePrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E6FEF0708985A7200C44C3F /* WebScriptDebugDelegatePrivate.h */; };
+               930653940AD6FEF6008E969A /* WebFrameLoaderClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 930653930AD6FEF6008E969A /* WebFrameLoaderClient.h */; };
                939810110824BF01008DF038 /* WebBackForwardList.h in Headers */ = {isa = PBXBuildFile; fileRef = 3944607D020F50ED0ECA1767 /* WebBackForwardList.h */; settings = {ATTRIBUTES = (Public, ); }; };
                939810120824BF01008DF038 /* WebHistory.h in Headers */ = {isa = PBXBuildFile; fileRef = F520FB190221DEFD01C1A525 /* WebHistory.h */; settings = {ATTRIBUTES = (Public, ); }; };
                939810130824BF01008DF038 /* WebHistoryItem.h in Headers */ = {isa = PBXBuildFile; fileRef = 3944607F020F50ED0ECA1767 /* WebHistoryItem.h */; settings = {ATTRIBUTES = (Public, ); }; };
                84D4BFF70348EF7600CA2ACA /* WebNetscapePluginEmbeddedView.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebNetscapePluginEmbeddedView.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                84D4BFF80348EF7600CA2ACA /* WebNetscapePluginEmbeddedView.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebNetscapePluginEmbeddedView.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                9305892A070868B300E79D96 /* WebDashboardRegion.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebDashboardRegion.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
+               930653930AD6FEF6008E969A /* WebFrameLoaderClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebFrameLoaderClient.h; sourceTree = "<group>"; };
                930D02BB06275F640076701E /* WebViewInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebViewInternal.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                930D02BD06275F710076701E /* WebFrameInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebFrameInternal.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                93154EF103A41270008635CE /* WebPanelAuthenticationHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebPanelAuthenticationHandler.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                654B3C280A82C47200E1AE3D /* Loader */ = {
                        isa = PBXGroup;
                        children = (
-                               65A734600A923948001B57E8 /* WebPlugInStreamLoaderDelegate.h */,
+                               651A93850A83F883007FEDF0 /* WebDataProtocol.h */,
+                               651A93860A83F883007FEDF0 /* WebDataProtocol.m */,
                                659044260A9D3B4200E89459 /* WebDocumentLoadState.h */,
                                659044270A9D3B4200E89459 /* WebDocumentLoadState.m */,
                                6538B1C60A90596D00A07522 /* WebFormDataStream.h */,
                                6538B1C70A90596D00A07522 /* WebFormDataStream.m */,
-                               651A93850A83F883007FEDF0 /* WebDataProtocol.h */,
-                               651A93860A83F883007FEDF0 /* WebDataProtocol.m */,
                                654B3C290A82C47200E1AE3D /* WebFrameLoader.h */,
                                654B3C2A0A82C47200E1AE3D /* WebFrameLoader.m */,
+                               930653930AD6FEF6008E969A /* WebFrameLoaderClient.h */,
                                654B3C2B0A82C47200E1AE3D /* WebLoader.h */,
                                654B3C2C0A82C47200E1AE3D /* WebLoader.m */,
                                654B3C2D0A82C47200E1AE3D /* WebMainResourceLoader.h */,
                                654B3C2E0A82C47200E1AE3D /* WebMainResourceLoader.m */,
                                654B3C2F0A82C47200E1AE3D /* WebNetscapePlugInStreamLoader.h */,
                                654B3C300A82C47200E1AE3D /* WebNetscapePlugInStreamLoader.m */,
+                               65A734600A923948001B57E8 /* WebPlugInStreamLoaderDelegate.h */,
                                654B3C310A82C47200E1AE3D /* WebSubresourceLoader.h */,
                                654B3C320A82C47200E1AE3D /* WebSubresourceLoader.m */,
                        );
                                659044280A9D3B4200E89459 /* WebDocumentLoadState.h in Headers */,
                                1C0D40870AC1C8F40009C113 /* WebKitVersionChecks.h in Headers */,
                                65FFB7FC0AD0B7D30048CD05 /* WebDocumentLoadStateMac.h in Headers */,
+                               930653940AD6FEF6008E969A /* WebFrameLoaderClient.h in Headers */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
                0867D690FE84028FC02AAC07 /* Project object */ = {
                        isa = PBXProject;
                        buildConfigurationList = 149C283208902B0F008A9EFC /* Build configuration list for PBXProject "WebKit" */;
+                       compatibilityVersion = "Xcode 2.4";
                        hasScannedForEncodings = 1;
                        knownRegions = (
                                English,
                        mainGroup = 0867D691FE84028FC02AAC07 /* WebKit */;
                        productRefGroup = 034768DFFF38A50411DB9C8B /* Products */;
                        projectDirPath = "";
+                       projectRoot = "";
+                       shouldCheckCompatibility = 1;
                        targets = (
                                9398100A0824BF01008DF038 /* WebKit */,
                        );
index 25760462c9e0d5d1543bd803a10b65b31c7e6486..93c5288bee821bf850b0be8f1e4660b8801b480d 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
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#import <WebKit/WebFrameInternal.h>
-
+#import "WebFrameInternal.h"
+
+#import "WebArchive.h"
+#import "WebBackForwardList.h"
+#import "WebDataProtocol.h"
+#import "WebDataSourceInternal.h"
+#import "WebDefaultResourceLoadDelegate.h"
+#import "WebDefaultUIDelegate.h"
+#import "WebDocumentInternal.h"
+#import "WebDocumentLoadStateMac.h"
+#import "WebFormDataStream.h"
+#import "WebFrameBridge.h"
+#import "WebFrameLoadDelegate.h"
+#import "WebFrameLoader.h"
+#import "WebFrameLoaderClient.h"
+#import "WebFrameViewInternal.h"
+#import "WebHTMLRepresentationPrivate.h"
+#import "WebHTMLViewInternal.h"
+#import "WebHTMLViewPrivate.h"
+#import "WebHistoryItemPrivate.h"
+#import "WebHistoryPrivate.h"
+#import "WebKitErrorsPrivate.h"
+#import "WebKitLogging.h"
+#import "WebKitNSStringExtras.h"
+#import "WebKitStatisticsPrivate.h"
+#import "WebNSObjectExtras.h"
+#import "WebNSURLExtras.h"
+#import "WebNSURLRequestExtras.h"
+#import "WebNetscapePluginEmbeddedView.h"
+#import "WebNullPluginView.h"
+#import "WebPlugin.h"
+#import "WebPluginController.h"
+#import "WebPreferencesPrivate.h"
+#import "WebResourceLoadDelegate.h"
+#import "WebResourcePrivate.h"
+#import "WebScriptDebugDelegatePrivate.h"
+#import "WebUIDelegate.h"
+#import "WebViewInternal.h"
 #import <WebKit/DOM.h>
-#import <WebKit/WebArchive.h>
-#import <WebKit/WebBackForwardList.h>
-#import <WebKit/WebFrameBridge.h>
-#import <WebKit/WebDataProtocol.h>
-#import <WebKit/WebDataSourceInternal.h>
-#import <WebKit/WebDefaultResourceLoadDelegate.h>
-#import <WebKit/WebDefaultUIDelegate.h>
-#import <WebKit/WebDocumentInternal.h>
-#import <WebKit/WebDocumentLoadStateMac.h>
-#import <WebKit/WebFormDataStream.h>
-#import <WebKit/WebFrameLoadDelegate.h>
-#import <WebKit/WebFrameLoader.h>
-#import <WebKit/WebFrameViewInternal.h>
-#import <WebKit/WebHistoryPrivate.h>
-#import <WebKit/WebHistoryItemPrivate.h>
-#import <WebKit/WebHTMLRepresentationPrivate.h>
-#import <WebKit/WebHTMLViewInternal.h>
-#import <WebKit/WebHTMLViewPrivate.h>
-#import <WebKit/WebKitErrorsPrivate.h>
-#import <WebKit/WebKitLogging.h>
-#import <WebKit/WebKitNSStringExtras.h>
-#import <WebKit/WebKitStatisticsPrivate.h>
-#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>
-#import <WebKit/WebPluginController.h>
-#import <WebKit/WebResourceLoadDelegate.h>
-#import <WebKit/WebResourcePrivate.h>
-#import <WebKit/WebViewInternal.h>
-#import <WebKit/WebUIDelegate.h>
-#import <WebKit/WebScriptDebugDelegatePrivate.h>
 #import <WebKitSystemInterface.h>
-
 #import <objc/objc-runtime.h>
 
 /*
@@ -158,6 +158,9 @@ NSString *WebPageCacheDocumentViewKey = @"WebPageCacheDocumentViewKey";
 - (WebFrame *)_traverseNextFrameStayWithin:(WebFrame *)stayWithin;
 @end
 
+@interface WebFrame (WebFrameLoaderClient) <WebFrameLoaderClient>
+@end
+
 @interface NSView (WebFramePluginHosting)
 - (void)setWebFrame:(WebFrame *)webFrame;
 @end
@@ -2236,7 +2239,7 @@ exit:
         [fv _setWebFrame:self];
     }
     
-    _private->frameLoader = [[WebFrameLoader alloc] initWithWebFrame:self];
+    _private->frameLoader = [[WebFrameLoader alloc] initWithClient:self];
     
     ++WebFrameCount;
     
@@ -2874,3 +2877,6 @@ exit:
 }
 
 @end
+
+@implementation WebFrame (WebFrameLoaderClient)
+@end