From 15e5c9ab57280c393f8ff7e4eb05858dfbb782e0 Mon Sep 17 00:00:00 2001 From: darin Date: Fri, 6 Oct 2006 21:25:08 +0000 Subject: [PATCH] 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. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@16861 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- WebKit/ChangeLog | 16 +++ WebKit/Loader/WebDocumentLoadState.h | 1 + WebKit/Loader/WebFrameLoader.h | 10 +- WebKit/Loader/WebFrameLoader.m | 170 ++++++++++++------------ WebKit/Loader/WebFrameLoaderClient.h | 33 +++++ WebKit/WebKit.xcodeproj/project.pbxproj | 13 +- WebKit/WebView/WebFrame.m | 86 ++++++------ 7 files changed, 196 insertions(+), 133 deletions(-) create mode 100644 WebKit/Loader/WebFrameLoaderClient.h diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog index 0648f218c953..169f5dec70fb 100644 --- a/WebKit/ChangeLog +++ b/WebKit/ChangeLog @@ -1,3 +1,19 @@ +2006-10-06 Darin Adler + + 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 Reviewed by Darin. diff --git a/WebKit/Loader/WebDocumentLoadState.h b/WebKit/Loader/WebDocumentLoadState.h index bf333c141bf3..0ea775194945 100644 --- a/WebKit/Loader/WebDocumentLoadState.h +++ b/WebKit/Loader/WebDocumentLoadState.h @@ -30,6 +30,7 @@ @class WebFrameLoader; +// To be renamed to WebDocumentLoader @interface WebDocumentLoadState : NSObject { @public diff --git a/WebKit/Loader/WebFrameLoader.h b/WebKit/Loader/WebFrameLoader.h index 01eace46ca79..cfc68ddcd1cc 100644 --- a/WebKit/Loader/WebFrameLoader.h +++ b/WebKit/Loader/WebFrameLoader.h @@ -28,9 +28,9 @@ #import -#import - -#import +#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 *client; WebDocumentLoadState *documentLoadState; WebDocumentLoadState *provisionalDocumentLoadState; WebDocumentLoadState *policyDocumentLoadState; @@ -76,7 +76,7 @@ typedef enum { NSMutableDictionary *pendingArchivedResources; } -- (id)initWithWebFrame:(WebFrame *)wf; +- (id)initWithClient:(WebFrame *)wf; - (void)addPlugInStreamLoader:(WebLoader *)loader; - (void)removePlugInStreamLoader:(WebLoader *)loader; - (void)setDefersCallbacks:(BOOL)defers; diff --git a/WebKit/Loader/WebFrameLoader.m b/WebKit/Loader/WebFrameLoader.m index 5ae4b83d8f56..946ed46e7093 100644 --- a/WebKit/Loader/WebFrameLoader.m +++ b/WebKit/Loader/WebFrameLoader.m @@ -26,34 +26,34 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#import - +#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 -#import -#import -#import -#import -#import -#import -#import #import -#import -#import -#import -#import -#import -#import -#import -#import -#import "WebNSDictionaryExtras.h" @implementation WebFrameLoader -- (id)initWithWebFrame:(WebFrame *)wf +- (id)initWithClient:(WebFrame *)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 @@ -107,12 +107,12 @@ - (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 @@ -201,7 +201,7 @@ 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? @@ -221,7 +221,7 @@ - (WebDataSource *)dataSource { - return [webFrame _dataSourceForDocumentLoadState:documentLoadState]; + return [client _dataSourceForDocumentLoadState:documentLoadState]; } - (void)_setDocumentLoadState:(WebDocumentLoadState *)loadState @@ -231,7 +231,7 @@ ASSERT(loadState != documentLoadState); - [webFrame _prepareForDataSourceReplacement]; + [client _prepareForDataSourceReplacement]; [documentLoadState detachFromFrameLoader]; [loadState retain]; @@ -246,7 +246,7 @@ - (WebDataSource *)policyDataSource { - return [webFrame _dataSourceForDocumentLoadState:policyDocumentLoadState]; + return [client _dataSourceForDocumentLoadState:policyDocumentLoadState]; } - (void)_setPolicyDocumentLoadState:(WebDocumentLoadState *)loadState @@ -263,7 +263,7 @@ - (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 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 index 000000000000..9d57c8a2c9dd --- /dev/null +++ b/WebKit/Loader/WebFrameLoaderClient.h @@ -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 + +@protocol WebFrameLoaderClient + +@end diff --git a/WebKit/WebKit.xcodeproj/project.pbxproj b/WebKit/WebKit.xcodeproj/project.pbxproj index 413077d98f2c..6a2ab7242a1f 100644 --- a/WebKit/WebKit.xcodeproj/project.pbxproj +++ b/WebKit/WebKit.xcodeproj/project.pbxproj @@ -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, ); }; }; @@ -451,6 +452,7 @@ 84D4BFF70348EF7600CA2ACA /* WebNetscapePluginEmbeddedView.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebNetscapePluginEmbeddedView.h; sourceTree = ""; tabWidth = 8; usesTabs = 0; }; 84D4BFF80348EF7600CA2ACA /* WebNetscapePluginEmbeddedView.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebNetscapePluginEmbeddedView.m; sourceTree = ""; tabWidth = 8; usesTabs = 0; }; 9305892A070868B300E79D96 /* WebDashboardRegion.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebDashboardRegion.h; sourceTree = ""; tabWidth = 8; usesTabs = 0; }; + 930653930AD6FEF6008E969A /* WebFrameLoaderClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebFrameLoaderClient.h; sourceTree = ""; }; 930D02BB06275F640076701E /* WebViewInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebViewInternal.h; sourceTree = ""; tabWidth = 8; usesTabs = 0; }; 930D02BD06275F710076701E /* WebFrameInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebFrameInternal.h; sourceTree = ""; tabWidth = 8; usesTabs = 0; }; 93154EF103A41270008635CE /* WebPanelAuthenticationHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebPanelAuthenticationHandler.h; sourceTree = ""; tabWidth = 8; usesTabs = 0; }; @@ -799,21 +801,22 @@ 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 */, ); @@ -1221,6 +1224,7 @@ 659044280A9D3B4200E89459 /* WebDocumentLoadState.h in Headers */, 1C0D40870AC1C8F40009C113 /* WebKitVersionChecks.h in Headers */, 65FFB7FC0AD0B7D30048CD05 /* WebDocumentLoadStateMac.h in Headers */, + 930653940AD6FEF6008E969A /* WebFrameLoaderClient.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1255,6 +1259,7 @@ 0867D690FE84028FC02AAC07 /* Project object */ = { isa = PBXProject; buildConfigurationList = 149C283208902B0F008A9EFC /* Build configuration list for PBXProject "WebKit" */; + compatibilityVersion = "Xcode 2.4"; hasScannedForEncodings = 1; knownRegions = ( English, @@ -1268,6 +1273,8 @@ mainGroup = 0867D691FE84028FC02AAC07 /* WebKit */; productRefGroup = 034768DFFF38A50411DB9C8B /* Products */; projectDirPath = ""; + projectRoot = ""; + shouldCheckCompatibility = 1; targets = ( 9398100A0824BF01008DF038 /* WebKit */, ); diff --git a/WebKit/WebView/WebFrame.m b/WebKit/WebView/WebFrame.m index 25760462c9e0..93c5288bee82 100644 --- a/WebKit/WebView/WebFrame.m +++ b/WebKit/WebView/WebFrame.m @@ -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 @@ -26,46 +26,46 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#import - +#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 -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import #import - #import /* @@ -158,6 +158,9 @@ NSString *WebPageCacheDocumentViewKey = @"WebPageCacheDocumentViewKey"; - (WebFrame *)_traverseNextFrameStayWithin:(WebFrame *)stayWithin; @end +@interface WebFrame (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 -- 2.36.0