Reviewed by John.
authormjs <mjs@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 3 Aug 2006 22:33:56 +0000 (22:33 +0000)
committermjs <mjs@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 3 Aug 2006 22:33:56 +0000 (22:33 +0000)
        - remove use of WebDataSource from WebLoader and subclasses, just have them talk to the
        WebFrameLoader instead.

        For now this is done by forarding all the calls.

        * Misc/WebIconLoader.m:
        (-[WebIconLoader didFinishLoading]):
        * Plugins/WebNetscapePluginStream.m:
        (-[WebNetscapePluginStream initWithRequest:pluginPointer:notifyData:sendNotification:]):
        (-[WebNetscapePluginStream start]):
        (-[WebNetscapePlugInStreamLoader didFinishLoading]):
        (-[WebNetscapePlugInStreamLoader didFailWithError:]):
        (-[WebNetscapePlugInStreamLoader cancelWithError:]):
        * WebCoreSupport/WebFrameBridge.m:
        (-[WebFrameBridge startLoadingResource:withMethod:URL:customHeaders:]):
        (-[WebFrameBridge startLoadingResource:withMethod:URL:customHeaders:postData:]):
        * WebCoreSupport/WebSubresourceLoader.h:
        * WebCoreSupport/WebSubresourceLoader.m:
        (-[WebSubresourceLoader initWithLoader:frameLoader:]):
        (+[WebSubresourceLoader startLoadingResource:withRequest:customHeaders:referrer:forFrameLoader:]):
        (+[WebSubresourceLoader startLoadingResource:withMethod:URL:customHeaders:referrer:forFrameLoader:]):
        (+[WebSubresourceLoader startLoadingResource:withMethod:URL:customHeaders:postData:referrer:forFrameLoader:]):
        (-[WebSubresourceLoader receivedError:]):
        (-[WebSubresourceLoader signalFinish]):
        (-[WebSubresourceLoader didFailWithError:]):
        (-[WebSubresourceLoader cancel]):
        * WebKit.xcodeproj/project.pbxproj:
        * WebView/WebDataSource.m:
        (-[WebDataSource _updateLoading]):
        (-[WebDataSource textEncodingName]):
        (-[WebDataSource _mainReceivedBytesSoFar:complete:]):
        * WebView/WebFrameLoader.h:
        * WebView/WebFrameLoader.m:
        (-[WebFrameLoader loadIconWithRequest:]):
        (-[WebFrameLoader startLoadingMainResourceWithRequest:identifier:]):
        (-[WebFrameLoader clearIconLoader]):
        (-[WebFrameLoader commitProvisionalLoad]):
        (-[WebFrameLoader activeDataSource]):
        (-[WebFrameLoader _archivedSubresourceForURL:]):
        (-[WebFrameLoader _defersCallbacks]):
        (-[WebFrameLoader _identifierForInitialRequest:]):
        (-[WebFrameLoader _willSendRequest:forResource:redirectResponse:]):
        (-[WebFrameLoader _didReceiveAuthenticationChallenge:forResource:]):
        (-[WebFrameLoader _didCancelAuthenticationChallenge:forResource:]):
        (-[WebFrameLoader _didReceiveResponse:forResource:]):
        (-[WebFrameLoader _didReceiveData:contentLength:forResource:]):
        (-[WebFrameLoader _didFinishLoadingForResource:]):
        (-[WebFrameLoader _didFailLoadingWithError:forResource:]):
        (-[WebFrameLoader _privateBrowsingEnabled]):
        (-[WebFrameLoader _addPlugInStreamLoader:]):
        (-[WebFrameLoader _removePlugInStreamLoader:]):
        (-[WebFrameLoader _finishedLoadingResource]):
        (-[WebFrameLoader _receivedError:]):
        (-[WebFrameLoader _addSubresourceLoader:]):
        (-[WebFrameLoader _removeSubresourceLoader:]):
        (-[WebFrameLoader _originalRequest]):
        (-[WebFrameLoader webFrame]):
        (-[WebFrameLoader _receivedMainResourceError:complete:]):
        (-[WebFrameLoader initialRequest]):
        (-[WebFrameLoader _receivedData:]):
        (-[WebFrameLoader _setRequest:]):
        (-[WebFrameLoader _downloadWithLoadingConnection:request:response:proxy:]):
        (-[WebFrameLoader _handleFallbackContent]):
        (-[WebFrameLoader _isStopping]):
        (-[WebFrameLoader _decidePolicyForMIMEType:decisionListener:]):
        (-[WebFrameLoader _setupForReplaceByMIMEType:]):
        (-[WebFrameLoader _setResponse:]):
        (-[WebFrameLoader _mainReceivedError:complete:]):
        (-[WebFrameLoader _finishedLoading]):
        (-[WebFrameLoader _mainReceivedBytesSoFar:complete:]):
        (-[WebFrameLoader _iconLoaderReceivedPageIcon:]):
        (-[WebFrameLoader _URL]):
        * WebView/WebLoader.h:
        * WebView/WebLoader.m:
        (-[NSURLProtocol releaseResources]):
        (-[NSURLProtocol loadWithRequest:]):
        (-[NSURLProtocol setFrameLoader:]):
        (-[NSURLProtocol frameLoader]):
        (-[NSURLProtocol willSendRequest:redirectResponse:]):
        (-[NSURLProtocol didReceiveAuthenticationChallenge:]):
        (-[NSURLProtocol didCancelAuthenticationChallenge:]):
        (-[NSURLProtocol didReceiveResponse:]):
        (-[NSURLProtocol didReceiveData:lengthReceived:]):
        (-[NSURLProtocol signalFinish]):
        (-[NSURLProtocol didFailWithError:]):
        (-[NSURLProtocol willCacheResponse:]):
        (-[NSURLProtocol cancelWithError:]):
        * WebView/WebMainResourceLoader.h:
        * WebView/WebMainResourceLoader.m:
        (-[WebMainResourceLoader initWithFrameLoader:]):
        (-[WebMainResourceLoader receivedError:]):
        (-[WebMainResourceLoader cancelWithError:]):
        (-[WebMainResourceLoader _isPostOrRedirectAfterPost:redirectResponse:]):
        (-[WebMainResourceLoader addData:]):
        (-[WebMainResourceLoader willSendRequest:redirectResponse:]):
        (-[WebMainResourceLoader continueAfterContentPolicy:response:]):
        (-[WebMainResourceLoader continueAfterContentPolicy:]):
        (-[WebMainResourceLoader checkContentPolicyForResponse:]):
        (-[WebMainResourceLoader didReceiveResponse:]):
        (-[WebMainResourceLoader didReceiveData:lengthReceived:]):
        (-[WebMainResourceLoader didFinishLoading]):
        (-[WebMainResourceLoader didFailWithError:]):
        (-[WebMainResourceLoader loadWithRequestNow:]):

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

14 files changed:
WebKit/ChangeLog
WebKit/Misc/WebIconLoader.m
WebKit/Plugins/WebNetscapePluginStream.m
WebKit/WebCoreSupport/WebFrameBridge.m
WebKit/WebCoreSupport/WebSubresourceLoader.h
WebKit/WebCoreSupport/WebSubresourceLoader.m
WebKit/WebKit.xcodeproj/project.pbxproj
WebKit/WebView/WebDataSource.m
WebKit/WebView/WebFrameLoader.h
WebKit/WebView/WebFrameLoader.m
WebKit/WebView/WebLoader.h
WebKit/WebView/WebLoader.m
WebKit/WebView/WebMainResourceLoader.h
WebKit/WebView/WebMainResourceLoader.m

index 8594b8af3723ec0d590e1d834bc344500f03525f..c995baaca92ea72e318131ab45ed741fdaa4013b 100644 (file)
@@ -1,3 +1,111 @@
+2006-08-03  Maciej Stachowiak  <mjs@apple.com>
+
+        Reviewed by John.
+        
+        - remove use of WebDataSource from WebLoader and subclasses, just have them talk to the
+        WebFrameLoader instead. 
+        
+        For now this is done by forarding all the calls.
+
+        * Misc/WebIconLoader.m:
+        (-[WebIconLoader didFinishLoading]):
+        * Plugins/WebNetscapePluginStream.m:
+        (-[WebNetscapePluginStream initWithRequest:pluginPointer:notifyData:sendNotification:]):
+        (-[WebNetscapePluginStream start]):
+        (-[WebNetscapePlugInStreamLoader didFinishLoading]):
+        (-[WebNetscapePlugInStreamLoader didFailWithError:]):
+        (-[WebNetscapePlugInStreamLoader cancelWithError:]):
+        * WebCoreSupport/WebFrameBridge.m:
+        (-[WebFrameBridge startLoadingResource:withMethod:URL:customHeaders:]):
+        (-[WebFrameBridge startLoadingResource:withMethod:URL:customHeaders:postData:]):
+        * WebCoreSupport/WebSubresourceLoader.h:
+        * WebCoreSupport/WebSubresourceLoader.m:
+        (-[WebSubresourceLoader initWithLoader:frameLoader:]):
+        (+[WebSubresourceLoader startLoadingResource:withRequest:customHeaders:referrer:forFrameLoader:]):
+        (+[WebSubresourceLoader startLoadingResource:withMethod:URL:customHeaders:referrer:forFrameLoader:]):
+        (+[WebSubresourceLoader startLoadingResource:withMethod:URL:customHeaders:postData:referrer:forFrameLoader:]):
+        (-[WebSubresourceLoader receivedError:]):
+        (-[WebSubresourceLoader signalFinish]):
+        (-[WebSubresourceLoader didFailWithError:]):
+        (-[WebSubresourceLoader cancel]):
+        * WebKit.xcodeproj/project.pbxproj:
+        * WebView/WebDataSource.m:
+        (-[WebDataSource _updateLoading]):
+        (-[WebDataSource textEncodingName]):
+        (-[WebDataSource _mainReceivedBytesSoFar:complete:]):
+        * WebView/WebFrameLoader.h:
+        * WebView/WebFrameLoader.m:
+        (-[WebFrameLoader loadIconWithRequest:]):
+        (-[WebFrameLoader startLoadingMainResourceWithRequest:identifier:]):
+        (-[WebFrameLoader clearIconLoader]):
+        (-[WebFrameLoader commitProvisionalLoad]):
+        (-[WebFrameLoader activeDataSource]):
+        (-[WebFrameLoader _archivedSubresourceForURL:]):
+        (-[WebFrameLoader _defersCallbacks]):
+        (-[WebFrameLoader _identifierForInitialRequest:]):
+        (-[WebFrameLoader _willSendRequest:forResource:redirectResponse:]):
+        (-[WebFrameLoader _didReceiveAuthenticationChallenge:forResource:]):
+        (-[WebFrameLoader _didCancelAuthenticationChallenge:forResource:]):
+        (-[WebFrameLoader _didReceiveResponse:forResource:]):
+        (-[WebFrameLoader _didReceiveData:contentLength:forResource:]):
+        (-[WebFrameLoader _didFinishLoadingForResource:]):
+        (-[WebFrameLoader _didFailLoadingWithError:forResource:]):
+        (-[WebFrameLoader _privateBrowsingEnabled]):
+        (-[WebFrameLoader _addPlugInStreamLoader:]):
+        (-[WebFrameLoader _removePlugInStreamLoader:]):
+        (-[WebFrameLoader _finishedLoadingResource]):
+        (-[WebFrameLoader _receivedError:]):
+        (-[WebFrameLoader _addSubresourceLoader:]):
+        (-[WebFrameLoader _removeSubresourceLoader:]):
+        (-[WebFrameLoader _originalRequest]):
+        (-[WebFrameLoader webFrame]):
+        (-[WebFrameLoader _receivedMainResourceError:complete:]):
+        (-[WebFrameLoader initialRequest]):
+        (-[WebFrameLoader _receivedData:]):
+        (-[WebFrameLoader _setRequest:]):
+        (-[WebFrameLoader _downloadWithLoadingConnection:request:response:proxy:]):
+        (-[WebFrameLoader _handleFallbackContent]):
+        (-[WebFrameLoader _isStopping]):
+        (-[WebFrameLoader _decidePolicyForMIMEType:decisionListener:]):
+        (-[WebFrameLoader _setupForReplaceByMIMEType:]):
+        (-[WebFrameLoader _setResponse:]):
+        (-[WebFrameLoader _mainReceivedError:complete:]):
+        (-[WebFrameLoader _finishedLoading]):
+        (-[WebFrameLoader _mainReceivedBytesSoFar:complete:]):
+        (-[WebFrameLoader _iconLoaderReceivedPageIcon:]):
+        (-[WebFrameLoader _URL]):
+        * WebView/WebLoader.h:
+        * WebView/WebLoader.m:
+        (-[NSURLProtocol releaseResources]):
+        (-[NSURLProtocol loadWithRequest:]):
+        (-[NSURLProtocol setFrameLoader:]):
+        (-[NSURLProtocol frameLoader]):
+        (-[NSURLProtocol willSendRequest:redirectResponse:]):
+        (-[NSURLProtocol didReceiveAuthenticationChallenge:]):
+        (-[NSURLProtocol didCancelAuthenticationChallenge:]):
+        (-[NSURLProtocol didReceiveResponse:]):
+        (-[NSURLProtocol didReceiveData:lengthReceived:]):
+        (-[NSURLProtocol signalFinish]):
+        (-[NSURLProtocol didFailWithError:]):
+        (-[NSURLProtocol willCacheResponse:]):
+        (-[NSURLProtocol cancelWithError:]):
+        * WebView/WebMainResourceLoader.h:
+        * WebView/WebMainResourceLoader.m:
+        (-[WebMainResourceLoader initWithFrameLoader:]):
+        (-[WebMainResourceLoader receivedError:]):
+        (-[WebMainResourceLoader cancelWithError:]):
+        (-[WebMainResourceLoader _isPostOrRedirectAfterPost:redirectResponse:]):
+        (-[WebMainResourceLoader addData:]):
+        (-[WebMainResourceLoader willSendRequest:redirectResponse:]):
+        (-[WebMainResourceLoader continueAfterContentPolicy:response:]):
+        (-[WebMainResourceLoader continueAfterContentPolicy:]):
+        (-[WebMainResourceLoader checkContentPolicyForResponse:]):
+        (-[WebMainResourceLoader didReceiveResponse:]):
+        (-[WebMainResourceLoader didReceiveData:lengthReceived:]):
+        (-[WebMainResourceLoader didFinishLoading]):
+        (-[WebMainResourceLoader didFailWithError:]):
+        (-[WebMainResourceLoader loadWithRequestNow:]):
+
 2006-08-03  Sam Weinig  <sam.weinig@gmail.com>
 
         Reviewed by Darin.
index d2e348e6249fd6ea60e0890bf3687d6209b3f091..9d4c2bb6fa27b1c77e75190929bd3d522fcf8476 100644 (file)
@@ -29,6 +29,7 @@
 
 #import <JavaScriptCore/Assertions.h>
 #import <WebCore/WebCoreIconDatabaseBridge.h>
+#import <WebKit/WebFrameLoader.h>
 #import <WebKit/WebIconDatabase.h>
 #import <WebKit/WebIconDatabasePrivate.h>
 #import <WebKit/WebKitLogging.h>
     } else {
         [[WebIconDatabase sharedIconDatabase] _setHaveNoIconForIconURL:[[self URL] _web_originalDataAsString]];
     }
-    [dataSource _iconLoaderReceivedPageIcon:self];    
+    [frameLoader _iconLoaderReceivedPageIcon:self];    
     [icon release];
     
     [super didFinishLoading];
index 7d9efc9505a93cafab311d05127ac3a44e9fb58a..c5c8efff29036f53357c3b5bef6973055a883eba 100644 (file)
 #import <WebKit/WebLoader.h>
 #import <WebKit/WebFrameBridge.h>
 #import <WebKit/WebDataSourceInternal.h>
+#import <WebKit/WebFrameInternal.h>
 #import <WebKit/WebKitErrorsPrivate.h>
 #import <WebKit/WebKitLogging.h>
 #import <WebKit/WebNetscapePluginEmbeddedView.h>
 #import <WebKit/WebNetscapePluginPackage.h>
 #import <WebKit/WebNSURLRequestExtras.h>
 #import <WebKit/WebViewInternal.h>
+#import <WebKit/WebFrameLoader.h>
 
 #import <Foundation/NSURLConnection.h>
 
@@ -79,7 +81,7 @@
     }
 
     _loader = [[WebNetscapePlugInStreamLoader alloc] initWithStream:self view:view]; 
-    [_loader setDataSource:[view dataSource]];
+    [_loader setFrameLoader:[[view webFrame] _frameLoader]];
     
     isTerminated = NO;
 
 {
     ASSERT(request);
 
-    [[_loader dataSource] _addPlugInStreamLoader:_loader];
+    [[_loader frameLoader] _addPlugInStreamLoader:_loader];
 
     BOOL succeeded = [_loader loadWithRequest:request];
     if (!succeeded) {
-        [[_loader dataSource] _removePlugInStreamLoader:_loader];
+        [[_loader frameLoader] _removePlugInStreamLoader:_loader];
     }
 }
 
     // Calling _removePlugInStreamLoader will likely result in a call to release, so we must retain.
     [self retain];
 
-    [[self dataSource] _removePlugInStreamLoader:self];
-    [[self dataSource] _finishedLoadingResource];
+    [frameLoader _removePlugInStreamLoader:self];
+    [frameLoader _finishedLoadingResource];
     [stream finishedLoadingWithData:[self resourceData]];
     [super didFinishLoading];
 
     // one example of this is 3266216
     [self retain];
 
-    [[self dataSource] _removePlugInStreamLoader:self];
-    [[self dataSource] _receivedError:error];
+    [[self frameLoader] _removePlugInStreamLoader:self];
+    [[self frameLoader] _receivedError:error];
     [stream destroyStreamWithError:error];
     [super didFailWithError:error];
 
     // Calling _removePlugInStreamLoader will likely result in a call to release, so we must retain.
     [self retain];
 
-    [[self dataSource] _removePlugInStreamLoader:self];
+    [[self frameLoader] _removePlugInStreamLoader:self];
     [super cancelWithError:error];
 
     [self release];
index 96510683a71241245dded9eceef8cbf18eb73358..773387e5ff3c01239b2d2c8e55babd030ac2b5e4 100644 (file)
@@ -515,7 +515,7 @@ NSString *WebPluginContainerKey =   @"WebPluginContainer";
                                                   URL:URL
                                         customHeaders:customHeaders
                                              referrer:(hideReferrer ? nil : [self referrer])
-                                        forDataSource:[self dataSource]];
+                                       forFrameLoader:[[self webFrame] _frameLoader]];
 }
 
 - (id <WebCoreResourceHandle>)startLoadingResource:(id <WebCoreResourceLoader>)resourceLoader withMethod:(NSString *)method URL:(NSURL *)URL customHeaders:(NSDictionary *)customHeaders postData:(NSArray *)postData
@@ -536,7 +536,7 @@ NSString *WebPluginContainerKey =   @"WebPluginContainer";
                                         customHeaders:customHeaders
                                              postData:postData
                                              referrer:(hideReferrer ? nil : [self referrer])
-                                        forDataSource:[self dataSource]];
+                                       forFrameLoader:[[self webFrame] _frameLoader]];
 }
 
 - (void)objectLoadedFromCacheWithURL:(NSURL *)URL response:(NSURLResponse *)response data:(NSData *)data
index b9f94d15c1df59a51b8e526087df05babd143fd0..53c65155a272aedd7c6f962e19c5bc7b14daa9ad 100644 (file)
@@ -29,7 +29,7 @@
 #import <WebKit/WebLoader.h>
 #import <WebCore/WebCoreResourceLoader.h>
 
-@class WebDataSource;
+@class WebFrameLoader;
 
 @protocol WebCoreResourceHandle;
 @protocol WebCoreResourceLoader;
@@ -46,7 +46,7 @@
                                            URL:(NSURL *)URL 
                                  customHeaders:(NSDictionary *)customHeaders
                                       referrer:(NSString *)referrer 
-                                 forDataSource:(WebDataSource *)source;
+                                forFrameLoader:(WebFrameLoader *)loader;
 
 + (WebSubresourceLoader *)startLoadingResource:(id <WebCoreResourceLoader>)rLoader
                                     withMethod:(NSString *)method
@@ -54,6 +54,6 @@
                                  customHeaders:(NSDictionary *)customHeaders
                                       postData:(NSArray *)postData 
                                       referrer:(NSString *)referrer 
-                                 forDataSource:(WebDataSource *)source;
+                                forFrameLoader:(WebFrameLoader *)loader;
 
 @end
index 855fff819d1faaf40e51da4e3858ec920f110158..59541e57d890dc0624fd8dde1364c3c2f8141988 100644 (file)
@@ -32,6 +32,7 @@
 #import <WebKit/WebDataSourceInternal.h>
 #import <WebKit/WebFormDataStream.h>
 #import <WebKit/WebFrameInternal.h>
+#import <WebKit/WebFrameLoader.h>
 #import <WebKit/WebKitErrorsPrivate.h>
 #import <WebKit/WebNSURLRequestExtras.h>
 
 
 @implementation WebSubresourceLoader
 
-- initWithLoader:(id <WebCoreResourceLoader>)l dataSource:(WebDataSource *)s
+- initWithLoader:(id <WebCoreResourceLoader>)l frameLoader:(WebFrameLoader *)fl
 {
     [super init];
     
     coreLoader = [l retain];
 
-    [self setDataSource: s];
+    [self setFrameLoader:fl];
     
     return self;
 }
                                    withRequest:(NSMutableURLRequest *)newRequest
                                  customHeaders:(NSDictionary *)customHeaders
                                       referrer:(NSString *)referrer 
-                                 forDataSource:(WebDataSource *)source
+                                forFrameLoader:(WebFrameLoader *)fl
 {
-    WebSubresourceLoader *loader = [[[self alloc] initWithLoader:rLoader dataSource:source] autorelease];
+    WebSubresourceLoader *loader = [[[self alloc] initWithLoader:rLoader frameLoader:fl] autorelease];
     
-    [source _addSubresourceLoader:loader];
+    [fl _addSubresourceLoader:loader];
 
     NSEnumerator *e = [customHeaders keyEnumerator];
     NSString *key;
-    while ((key = [e nextObject])) {
+    while ((key = [e nextObject]))
         [newRequest addValue:[customHeaders objectForKey:key] forHTTPHeaderField:key];
-    }
 
     // Use the original request's cache policy for two reasons:
     // 1. For POST requests, we mutate the cache policy for the main resource,
     if ([newRequest _web_isConditionalRequest])
         [newRequest setCachePolicy:NSURLRequestReloadIgnoringCacheData];
     else
-        [newRequest setCachePolicy:[[source _originalRequest] cachePolicy]];
+        [newRequest setCachePolicy:[[fl _originalRequest] cachePolicy]];
     [newRequest _web_setHTTPReferrer:referrer];
     
-    [[source webFrame] _addExtraFieldsToRequest:newRequest mainResource:NO alwaysFromRequest:NO];
+    [[fl webFrame] _addExtraFieldsToRequest:newRequest mainResource:NO alwaysFromRequest:NO];
             
     if (![loader loadWithRequest:newRequest])
         loader = nil;
                                            URL:(NSURL *)URL
                                  customHeaders:(NSDictionary *)customHeaders
                                       referrer:(NSString *)referrer
-                                 forDataSource:(WebDataSource *)source
+                                 forFrameLoader:(WebFrameLoader *)fl
 {
     NSMutableURLRequest *newRequest = [[NSMutableURLRequest alloc] initWithURL:URL];
 
     if (![method isEqualToString:@"GET"])
         [newRequest setHTTPMethod:method];
 
-    WebSubresourceLoader *loader = [self startLoadingResource:rLoader withRequest:newRequest customHeaders:customHeaders referrer:referrer forDataSource:source];
+    WebSubresourceLoader *loader = [self startLoadingResource:rLoader withRequest:newRequest customHeaders:customHeaders referrer:referrer forFrameLoader:fl];
     [newRequest release];
 
     return loader;
                                  customHeaders:(NSDictionary *)customHeaders
                                       postData:(NSArray *)postData
                                       referrer:(NSString *)referrer
-                                 forDataSource:(WebDataSource *)source
+                                forFrameLoader:(WebFrameLoader *)fl
 {
     NSMutableURLRequest *newRequest = [[NSMutableURLRequest alloc] initWithURL:URL];
 
 
     webSetHTTPBody(newRequest, postData);
 
-    WebSubresourceLoader *loader = [self startLoadingResource:rLoader withRequest:newRequest customHeaders:customHeaders referrer:referrer forDataSource:source];
+    WebSubresourceLoader *loader = [self startLoadingResource:rLoader withRequest:newRequest customHeaders:customHeaders referrer:referrer forFrameLoader:fl];
     [newRequest release];
 
     return loader;
 
 - (void)receivedError:(NSError *)error
 {
-    [dataSource _receivedError:error];
+    [frameLoader _receivedError:error];
 }
 
 - (NSURLRequest *)willSendRequest:(NSURLRequest *)newRequest redirectResponse:(NSURLResponse *)redirectResponse;
 
 - (void)signalFinish
 {
-    [dataSource _removeSubresourceLoader:self];
-    [dataSource _finishedLoadingResource];
+    [frameLoader _removeSubresourceLoader:self];
+    [frameLoader _finishedLoadingResource];
     [super signalFinish];
 }
 
     [self retain];
     
     [coreLoader reportError];
-    [dataSource _removeSubresourceLoader:self];
+    [frameLoader _removeSubresourceLoader:self];
     [self receivedError:error];
     [super didFailWithError:error];
 
     [self retain];
         
     [coreLoader cancel];
-    [dataSource _removeSubresourceLoader:self];
+    [frameLoader _removeSubresourceLoader:self];
     [self receivedError:[self cancelledError]];
     [super cancel];
 
index de0c7b0ee868b27856f97c55021265903f02fe96..6da044ab6ad69f53957fbd4c307355b0172e35b8 100644 (file)
                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 5dd70d9eb2b97f5b3b911faa33d7e934fbe23f56..18664734d6a3b353a3628d798bdd11301613227b 100644 (file)
 - (void)_updateLoading
 {
     WebFrameLoader *frameLoader = [_private->webFrame _frameLoader];
-    ASSERT((self == [frameLoader dataSource] && [frameLoader state] != WebFrameStateProvisional) ||
-           (self == [frameLoader provisionalDataSource] && [frameLoader state] == WebFrameStateProvisional));
+    ASSERT(self == [frameLoader activeDataSource]);
 
     [self _setLoading:[frameLoader isLoading]];
 }
@@ -1148,9 +1147,9 @@ static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class class,
 {
     NSString *textEncodingName = [self _overrideEncoding];
 
-    if (!textEncodingName) {
+    if (!textEncodingName)
         textEncodingName = [[self response] textEncodingName];
-    }
+
     return textEncodingName;
 }
 
@@ -1250,7 +1249,7 @@ static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class class,
         return;
         
     // This resource has completed, so check if the load is complete for this frame and its ancestors
-    if (isComplete){
+    if (isComplete) {
         // If the load is complete, mark the primary load as done.  The primary load is the load
         // of the main document.  Other resources may still be arriving.
         [self _setPrimaryLoadComplete:YES];
index 3ad725067aa725071bca0a1ab03ea6d46f38edec..8ed40a13480fcc5e4e058f2379651e4da0f5d3ae 100644 (file)
 
 #import <Cocoa/Cocoa.h>
 #import <WebKit/WebFramePrivate.h>
+#import <WebKitSystemInterface.h>
 
 @class WebDataSource;
 @class WebMainResourceLoader;
 @class WebIconLoader;
 @class WebLoader;
+@class WebResource;
 
 @interface WebFrameLoader : NSObject
 {
 - (void)startProvisionalLoad:(WebDataSource *)dataSource;
 - (WebDataSource *)dataSource;
 - (WebDataSource *)provisionalDataSource;
+- (WebDataSource *)activeDataSource;
 - (WebFrameState)state;
 - (void)clearDataSource;
 - (void)setupForReplace;
 + (CFAbsoluteTime)timeOfLastCompletedLoad;
 
+- (WebResource *)_archivedSubresourceForURL:(NSURL *)URL;
+- (BOOL)_defersCallbacks;
+- (id)_identifierForInitialRequest:(NSURLRequest *)clientRequest;
+- (NSURLRequest *)_willSendRequest:(NSMutableURLRequest *)clientRequest forResource:(id)identifier redirectResponse:(NSURLResponse *)redirectResponse;
+- (void)_didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)currentWebChallenge forResource:(id)identifier;
+- (void)_didCancelAuthenticationChallenge:(NSURLAuthenticationChallenge *)currentWebChallenge forResource:(id)identifier;
+- (void)_didReceiveResponse:(NSURLResponse *)r forResource:(id)identifier;
+- (void)_didReceiveData:(NSData *)data contentLength:(int)lengthReceived forResource:(id)identifier;
+- (void)_didFinishLoadingForResource:(id)identifier;
+- (void)_didFailLoadingWithError:(NSError *)error forResource:(id)identifier;
+- (BOOL)_privateBrowsingEnabled;
+- (void)_didFailLoadingWithError:(NSError *)error forResource:(id)identifier;
+- (void)_addPlugInStreamLoader:(WebLoader *)loader;
+- (void)_removePlugInStreamLoader:(WebLoader *)loader;
+- (void)_finishedLoadingResource;
+- (void)_receivedError:(NSError *)error;
+- (void)_addSubresourceLoader:(WebLoader *)loader;
+- (void)_removeSubresourceLoader:(WebLoader *)loader;
+- (NSURLRequest *)_originalRequest;
+- (WebFrame *)webFrame;
+- (void)_receivedMainResourceError:(NSError *)error complete:(BOOL)isComplete;
+- (NSURLRequest *)initialRequest;
+- (void)_receivedData:(NSData *)data;
+- (void)_setRequest:(NSURLRequest *)request;
+- (void)_downloadWithLoadingConnection:(NSURLConnection *)connection request:(NSURLRequest *)request response:(NSURLResponse *)r proxy:(WKNSURLConnectionDelegateProxyPtr)proxy;
+- (void)_handleFallbackContent;
+- (BOOL)_isStopping;
+- (void)_decidePolicyForMIMEType:(NSString *)MIMEType decisionListener:(WebPolicyDecisionListener *)listener;
+- (void)_setupForReplaceByMIMEType:(NSString *)newMIMEType;
+- (void)_setResponse:(NSURLResponse *)response;
+- (void)_mainReceivedError:(NSError *)error complete:(BOOL)isComplete;
+- (void)_finishedLoading;
+- (void)_mainReceivedBytesSoFar:(unsigned)bytesSoFar complete:(BOOL)isComplete;
+- (void)_iconLoaderReceivedPageIcon:(WebIconLoader *)iconLoader;
+- (NSURL *)_URL;
+
 @end
index 379347865af76d203a31efca1db0eadb0d55a6f7..66ac749d5ce7db17a424e90c844a3c2f45dcb07a 100644 (file)
@@ -70,7 +70,7 @@
 {
     ASSERT(!iconLoader);
     iconLoader = [[WebIconLoader alloc] initWithRequest:request];
-    [iconLoader setDataSource:dataSource];
+    [iconLoader setFrameLoader:self];
     [iconLoader loadWithRequest:request];
 }
 
 
 - (BOOL)startLoadingMainResourceWithRequest:(NSMutableURLRequest *)request identifier:(id)identifier
 {
-    mainResourceLoader = [[WebMainResourceLoader alloc] initWithDataSource:provisionalDataSource];
+    mainResourceLoader = [[WebMainResourceLoader alloc] initWithFrameLoader:self];
     
     [mainResourceLoader setIdentifier:identifier];
     [[provisionalDataSource webFrame] _addExtraFieldsToRequest:request mainResource:YES alwaysFromRequest:NO];
@@ -293,10 +293,17 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
     [self _setState:WebFrameStateComplete];
 }
 
+- (void)clearIconLoader
+{
+    [iconLoader release];
+    iconLoader = nil;
+}
+
 - (void)commitProvisionalLoad
 {
     [self stopLoadingSubresources];
     [self stopLoadingPlugIns];
+    [self clearIconLoader];
 
     [self _setDataSource:provisionalDataSource];
     [self _setProvisionalDataSource:nil];
@@ -333,4 +340,186 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
     [webFrame _detachChildren];
 }
 
+- (WebDataSource *)activeDataSource
+{
+    if (state == WebFrameStateProvisional)
+        return provisionalDataSource;
+
+    return dataSource;
+}
+
+- (WebResource *)_archivedSubresourceForURL:(NSURL *)URL
+{
+    return [[self activeDataSource] _archivedSubresourceForURL:URL];
+}
+
+- (BOOL)_defersCallbacks
+{
+    return [[self activeDataSource] _defersCallbacks];
+}
+
+- (id)_identifierForInitialRequest:(NSURLRequest *)clientRequest
+{
+    return [[self activeDataSource] _identifierForInitialRequest:clientRequest];
+}
+
+- (NSURLRequest *)_willSendRequest:(NSMutableURLRequest *)clientRequest forResource:(id)identifier redirectResponse:(NSURLResponse *)redirectResponse
+{
+    return [[self activeDataSource] _willSendRequest:clientRequest forResource:identifier redirectResponse:redirectResponse];
+}
+
+- (void)_didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)currentWebChallenge forResource:(id)identifier
+{
+    return [[self activeDataSource] _didReceiveAuthenticationChallenge:currentWebChallenge forResource:identifier];
+}
+
+- (void)_didCancelAuthenticationChallenge:(NSURLAuthenticationChallenge *)currentWebChallenge forResource:(id)identifier
+{
+    return [[self activeDataSource] _didCancelAuthenticationChallenge:currentWebChallenge forResource:identifier];
+}
+
+- (void)_didReceiveResponse:(NSURLResponse *)r forResource:(id)identifier
+{
+    return [[self activeDataSource] _didReceiveResponse:r forResource:identifier];
+}
+
+- (void)_didReceiveData:(NSData *)data contentLength:(int)lengthReceived forResource:(id)identifier
+{
+    return [[self activeDataSource] _didReceiveData:data contentLength:lengthReceived forResource:identifier];
+}
+
+- (void)_didFinishLoadingForResource:(id)identifier
+{
+    return [[self activeDataSource] _didFinishLoadingForResource:identifier];
+}
+
+- (void)_didFailLoadingWithError:(NSError *)error forResource:(id)identifier
+{
+    return [[self activeDataSource] _didFailLoadingWithError:error forResource:identifier];
+}
+
+- (BOOL)_privateBrowsingEnabled
+{
+    return [[self activeDataSource] _privateBrowsingEnabled];
+}
+
+- (void)_addPlugInStreamLoader:(WebLoader *)loader
+{
+    return [[self activeDataSource] _addPlugInStreamLoader:loader];
+}
+
+- (void)_removePlugInStreamLoader:(WebLoader *)loader
+{
+    return [[self activeDataSource] _removePlugInStreamLoader:loader];
+}
+
+- (void)_finishedLoadingResource
+{
+    return [[self activeDataSource] _finishedLoadingResource];
+}
+
+- (void)_receivedError:(NSError *)error
+{
+    return [[self activeDataSource] _receivedError:error];
+}
+
+- (void)_addSubresourceLoader:(WebLoader *)loader
+{
+    return [[self activeDataSource] _addSubresourceLoader:loader];
+}
+
+- (void)_removeSubresourceLoader:(WebLoader *)loader
+{
+    return [[self activeDataSource] _removeSubresourceLoader:loader];
+}
+
+- (NSURLRequest *)_originalRequest
+{
+    return [[self activeDataSource] _originalRequest];
+}
+
+- (WebFrame *)webFrame
+{
+    return [[self activeDataSource] webFrame];
+}
+
+- (void)_receivedMainResourceError:(NSError *)error complete:(BOOL)isComplete
+{
+    WebDataSource *ds = [self activeDataSource];
+    [ds retain];
+    [ds _receivedMainResourceError:error complete:isComplete];
+    [ds release];
+}
+
+- (NSURLRequest *)initialRequest
+{
+    return [[self activeDataSource] initialRequest];
+}
+
+- (void)_receivedData:(NSData *)data
+{
+    [[self activeDataSource] _receivedData:data];
+}
+
+- (void)_setRequest:(NSURLRequest *)request
+{
+    [[self activeDataSource] _setRequest:request];
+}
+
+- (void)_downloadWithLoadingConnection:(NSURLConnection *)connection request:(NSURLRequest *)request response:(NSURLResponse *)r proxy:(WKNSURLConnectionDelegateProxyPtr)proxy
+{
+    [[self activeDataSource] _downloadWithLoadingConnection:connection request:request response:r proxy:proxy];
+}
+
+- (void)_handleFallbackContent
+{
+    [[self activeDataSource] _handleFallbackContent];
+}
+
+- (BOOL)_isStopping
+{
+    return [[self activeDataSource] _isStopping];
+}
+
+- (void)_decidePolicyForMIMEType:(NSString *)MIMEType decisionListener:(WebPolicyDecisionListener *)listener
+{
+    [[self activeDataSource] _decidePolicyForMIMEType:MIMEType decisionListener:listener];
+}
+
+- (void)_setupForReplaceByMIMEType:(NSString *)newMIMEType
+{
+    [[self activeDataSource] _setupForReplaceByMIMEType:newMIMEType];
+}
+
+- (void)_setResponse:(NSURLResponse *)response
+{
+    [[self activeDataSource] _setResponse:response];
+}
+
+- (void)_mainReceivedError:(NSError *)error complete:(BOOL)isComplete
+{
+    [[self activeDataSource] _mainReceivedError:error complete:isComplete];
+}
+
+- (void)_finishedLoading
+{
+    [[self activeDataSource] _finishedLoading];
+}
+
+- (void)_mainReceivedBytesSoFar:(unsigned)bytesSoFar complete:(BOOL)isComplete
+{
+    [[self activeDataSource] _mainReceivedBytesSoFar:bytesSoFar complete:isComplete];
+}
+
+- (void)_iconLoaderReceivedPageIcon:(WebIconLoader *)iLoader
+{
+    ASSERT(iLoader == iconLoader);
+    [[self activeDataSource] _iconLoaderReceivedPageIcon:iLoader];
+}
+
+- (NSURL *)_URL
+{
+    return [[self activeDataSource] _URL];
+}
+
 @end
index 029dadabd57ffea787d11f764dfe5a0b223ec8bb..af8d1b56a4fa0b5e2587a32a284f39c328f1448a 100644 (file)
 @class NSURLResponse;
 @class WebDataSource;
 @class WebResource;
+@class WebFrameLoader;
 
 @interface WebLoader : NSObject
 {
 @protected
-    WebDataSource *dataSource;
+    WebFrameLoader *frameLoader;
     NSURLConnection *connection;
     NSURLRequest *request;
     BOOL reachedTerminalState;
@@ -67,8 +68,8 @@
 
 - (BOOL)loadWithRequest:(NSURLRequest *)request;
 
-- (void)setDataSource:(WebDataSource *)d;
-- (WebDataSource *)dataSource;
+- (void)setFrameLoader:(WebFrameLoader *)fl;
+- (WebFrameLoader *)frameLoader;
 
 - (void)cancel;
 - (void)cancelWithError:(NSError *)error;
index 0c3611db37477874c4a85d74bfdbca7de4c2960a..a10544d5265186d4d6fcc255cb862c7c9991782c 100644 (file)
 
 #import <JavaScriptCore/Assertions.h>
 #import <WebKit/WebDataProtocol.h>
-#import <WebKit/WebDataSourceInternal.h>
 #import <WebKit/WebKitErrors.h>
 #import <WebKit/WebKitErrorsPrivate.h>
+#import <WebKit/WebFrameLoader.h>
+
 #import <WebKit/WebNSURLRequestExtras.h>
 #import <WebKit/WebKitNSStringExtras.h>
 #import <WebKit/WebResourcePrivate.h>
@@ -131,8 +132,8 @@ static BOOL NSURLConnectionSupportsBufferedData;
     [connection release];
     connection = nil;
 
-    [dataSource release];
-    dataSource = nil;
+    [frameLoader release];
+    frameLoader = nil;
     
     [resource release];
     resource = nil;
@@ -236,7 +237,7 @@ static BOOL NSURLConnectionSupportsBufferedData;
     r = clientRequest;
     
     if ([[r URL] isEqual:originalURL] && [self _canUseResourceForRequest:r]) {
-        resource = [dataSource _archivedSubresourceForURL:originalURL];
+        resource = [frameLoader _archivedSubresourceForURL:originalURL];
         if (resource != nil) {
             if ([self _canUseResourceWithResponse:[resource _response]]) {
                 [resource retain];
@@ -276,21 +277,20 @@ static BOOL NSURLConnectionSupportsBufferedData;
     return defersCallbacks;
 }
 
-- (void)setDataSource:(WebDataSource *)d
+- (void)setFrameLoader:(WebFrameLoader *)fl
 {
-    ASSERT(d);
-    ASSERT([d _webView]);
+    ASSERT(fl);
     
-    [d retain];
-    [dataSource release];
-    dataSource = d;
+    [fl retain];
+    [frameLoader release];
+    frameLoader = fl;
 
-    [self setDefersCallbacks:[dataSource _defersCallbacks]];
+    [self setDefersCallbacks:[frameLoader _defersCallbacks]];
 }
 
-- (WebDataSource *)dataSource
+- (WebFrameLoader *)frameLoader
 {
-    return dataSource;
+    return frameLoader;
 }
 
 - (void)addData:(NSData *)data
@@ -354,9 +354,9 @@ static BOOL NSURLConnectionSupportsBufferedData;
         haveDataSchemeRequest = YES;
     
     if (identifier == nil)
-        identifier = [dataSource _identifierForInitialRequest:clientRequest];
+        identifier = [frameLoader _identifierForInitialRequest:clientRequest];
 
-    updatedRequest = [dataSource _willSendRequest:clientRequest forResource:identifier redirectResponse:redirectResponse];
+    updatedRequest = [frameLoader _willSendRequest:clientRequest forResource:identifier redirectResponse:redirectResponse];
 
     if (!haveDataSchemeRequest)
         newRequest = updatedRequest;
@@ -398,7 +398,7 @@ static BOOL NSURLConnectionSupportsBufferedData;
     currentConnectionChallenge = [challenge retain];;
     currentWebChallenge = [[NSURLAuthenticationChallenge alloc] initWithAuthenticationChallenge:challenge sender:self];
 
-    [dataSource _didReceiveAuthenticationChallenge:currentWebChallenge forResource:identifier];
+    [frameLoader _didReceiveAuthenticationChallenge:currentWebChallenge forResource:identifier];
 
     [self release];
 }
@@ -413,7 +413,7 @@ static BOOL NSURLConnectionSupportsBufferedData;
     // retain/release self in this delegate method since the additional processing can do
     // anything including possibly releasing self; one example of this is 3266216
     [self retain];
-    [dataSource _didCancelAuthenticationChallenge:currentWebChallenge forResource:identifier];
+    [frameLoader _didCancelAuthenticationChallenge:currentWebChallenge forResource:identifier];
     [self release];
 }
 
@@ -435,7 +435,7 @@ static BOOL NSURLConnectionSupportsBufferedData;
     [response release];
     response = r;
 
-    [dataSource _didReceiveResponse:r forResource:identifier];
+    [frameLoader _didReceiveResponse:r forResource:identifier];
 
     [self release];
 }
@@ -454,7 +454,7 @@ static BOOL NSURLConnectionSupportsBufferedData;
     
     [self addData:data];
     
-    [dataSource _didReceiveData:data contentLength:lengthReceived forResource:identifier];
+    [frameLoader _didReceiveData:data contentLength:lengthReceived forResource:identifier];
 
     [self release];
 }
@@ -468,7 +468,7 @@ static BOOL NSURLConnectionSupportsBufferedData;
 - (void)signalFinish
 {
     signalledFinish = YES;
-    [dataSource _didFinishLoadingForResource:identifier];
+    [frameLoader _didFinishLoadingForResource:identifier];
 }
 
 - (void)didFinishLoading
@@ -498,7 +498,7 @@ static BOOL NSURLConnectionSupportsBufferedData;
     // anything including possibly releasing self; one example of this is 3266216
     [self retain];
 
-    [dataSource _didFailLoadingWithError:error forResource:identifier];
+    [frameLoader _didFailLoadingWithError:error forResource:identifier];
 
     [self releaseResources];
     [self release];
@@ -507,7 +507,7 @@ static BOOL NSURLConnectionSupportsBufferedData;
 - (NSCachedURLResponse *)willCacheResponse:(NSCachedURLResponse *)cachedResponse
 {
     // When in private browsing mode, prevent caching to disk
-    if ([cachedResponse storagePolicy] == NSURLCacheStorageAllowed && [dataSource _privateBrowsingEnabled]) {
+    if ([cachedResponse storagePolicy] == NSURLCacheStorageAllowed && [frameLoader _privateBrowsingEnabled]) {
         cachedResponse = [[[NSCachedURLResponse alloc] initWithResponse:[cachedResponse response]
                                                                    data:[cachedResponse data]
                                                                userInfo:[cachedResponse userInfo]
@@ -616,7 +616,7 @@ static BOOL NSURLConnectionSupportsBufferedData;
     [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(deliverResource) object:nil];
     [connection cancel];
 
-    [dataSource _didFailLoadingWithError:error forResource:identifier];
+    [frameLoader _didFailLoadingWithError:error forResource:identifier];
 
     [self releaseResources];
 }
index f058bbb60b88d2ec02d8528bf9650d7bb366c774..794c3162bcccb09af9dde247d27d2d26e63fa353 100644 (file)
@@ -44,6 +44,6 @@
     NSURLRequest *_initialRequest;
 }
 
-- (id)initWithDataSource:(WebDataSource *)dataSource;
+- (id)initWithFrameLoader:(WebFrameLoader *)frameLoader;
 
 @end
index 30e3b9d18097819649b2d2232dbedd086e9113b0..03653781d615b3914c88fe811e474d161b9c9b86 100644 (file)
@@ -38,6 +38,7 @@
 #import <WebKit/WebDataSourceInternal.h>
 #import <WebKit/WebDocument.h>
 #import <WebKit/WebFrameView.h>
+#import <WebKit/WebFrameLoader.h>
 #import <WebKit/WebFrameInternal.h>
 #import <WebKit/WebKitErrors.h>
 #import <WebKit/WebKitErrorsPrivate.h>
 
 @implementation WebMainResourceLoader
 
-- (id)initWithDataSource:(WebDataSource *)ds
+- (id)initWithFrameLoader:(WebFrameLoader *)fl
 {
     self = [super init];
     
     if (self) {
-        [self setDataSource:ds];
+        [self setFrameLoader:fl];
         proxy = WKCreateNSURLConnectionDelegateProxy();
         [proxy setDelegate:self];
     }
 {
     // Calling _receivedMainResourceError will likely result in a call to release, so we must retain.
     [self retain];
-    WebDataSource *ds = [dataSource retain]; // super's didFailWithError will release the datasource
+    WebFrameLoader *fl = [frameLoader retain]; // super's didFailWithError will release the frameLoader
 
     if (!cancelledFlag) {
         ASSERT(!reachedTerminalState);
-        [dataSource _didFailLoadingWithError:error forResource:identifier];
+        [frameLoader _didFailLoadingWithError:error forResource:identifier];
     }
 
-    [ds _receivedMainResourceError:error complete:YES];
+    [fl _receivedMainResourceError:error complete:YES];
 
     if (!cancelledFlag)
         [self releaseResources];
 
     ASSERT(reachedTerminalState);
 
-    [ds release];
+    [fl release];
     [self release];
 }
 
     [self retain];
 
     [self cancelContentPolicy];
-    [dataSource retain];
-    [dataSource _receivedMainResourceError:error complete:YES];
-    [dataSource release];
+    [frameLoader retain];
+    [frameLoader _receivedMainResourceError:error complete:YES];
+    [frameLoader release];
     [super cancelWithError:error];
 
     [self release];
     else if (redirectResponse && [redirectResponse isKindOfClass:[NSHTTPURLResponse class]]) {
         int status = [(NSHTTPURLResponse *)redirectResponse statusCode];
         if (((status >= 301 && status <= 303) || status == 307)
-            && [[[dataSource initialRequest] HTTPMethod] isEqualToString:@"POST"]) {
+            && [[[frameLoader initialRequest] HTTPMethod] isEqualToString:@"POST"]) {
             result = YES;
         }
     }
 - (void)addData:(NSData *)data
 {
     [super addData:data];
-    [dataSource _receivedData:data];
+    [frameLoader _receivedData:data];
 }
 
 - (void)saveResource
     NSMutableURLRequest *mutableRequest = nil;
     // Update cookie policy base URL as URL changes, except for subframes, which use the
     // URL of the main frame which doesn't change when we redirect.
-    if ([[dataSource webFrame] _isMainFrame]) {
+    if ([[frameLoader webFrame] _isMainFrame]) {
         mutableRequest = [newRequest mutableCopy];
         [mutableRequest setMainDocumentURL:URL];
     }
 
     // Don't set this on the first request.  It is set
     // when the main load was started.
-    [dataSource _setRequest:newRequest];
+    [frameLoader _setRequest:newRequest];
     
-    [[dataSource webFrame] _checkNavigationPolicyForRequest:newRequest
-                                                 dataSource:dataSource
-                                                  formState:nil
-                                                    andCall:self
-                                               withSelector:@selector(continueAfterNavigationPolicy:formState:)];
+    [[frameLoader webFrame] _checkNavigationPolicyForRequest:newRequest
+                                                  dataSource:[frameLoader activeDataSource]
+                                                   formState:nil
+                                                     andCall:self
+                                                withSelector:@selector(continueAfterNavigationPolicy:formState:)];
 
     [self release];
     return newRequest;
         BOOL isRemote = ![URL isFileURL] && ![WebDataProtocol _webIsDataProtocolURL:URL];
         BOOL isRemoteWebArchive = isRemote && [MIMEType _webkit_isCaseInsensitiveEqualToString:@"application/x-webarchive"];
         if (![WebDataSource _canShowMIMEType:MIMEType] || isRemoteWebArchive) {
-            [[dataSource webFrame] _handleUnimplementablePolicyWithErrorCode:WebKitErrorCannotShowMIMEType forURL:URL];
+            [[frameLoader webFrame] _handleUnimplementablePolicyWithErrorCode:WebKitErrorCannotShowMIMEType forURL:URL];
             // Check reachedTerminalState since the load may have already been cancelled inside of _handleUnimplementablePolicyWithErrorCode::.
             if (!reachedTerminalState) {
                 [self stopLoadingForPolicyChange];
     }
     case WebPolicyDownload:
         [proxy setDelegate:nil];
-        [dataSource _downloadWithLoadingConnection:connection request:request response:r proxy:proxy];
+        [frameLoader _downloadWithLoadingConnection:connection request:request response:r proxy:proxy];
         [proxy release];
         proxy = nil;
 
         int status = [(NSHTTPURLResponse *)r statusCode];
         if (status < 200 || status >= 300) {
             // Handle <object> fallback for error cases.
-            DOMHTMLElement *hostElement = [[[self dataSource] webFrame] frameElement];
-            [dataSource _handleFallbackContent];
+            DOMHTMLElement *hostElement = [[frameLoader webFrame] frameElement];
+            [frameLoader _handleFallbackContent];
             if (hostElement && [hostElement isKindOfClass:[DOMHTMLObjectElement class]])
                 // object elements are no longer rendered after we fallback, so don't
                 // keep trying to process data from their load
         [super didReceiveResponse:r];
     }
 
-    if (![dataSource _isStopping] && ([URL _webkit_shouldLoadAsEmptyDocument] || [WebView _representationExistsForURLScheme:[URL scheme]])) {
+    if (![frameLoader _isStopping] && ([URL _webkit_shouldLoadAsEmptyDocument] || [WebView _representationExistsForURLScheme:[URL scheme]])) {
         [self didFinishLoading];
     }
     
 -(void)continueAfterContentPolicy:(WebPolicyAction)policy
 {
     NSURLResponse *r = [policyResponse retain];
-    BOOL isStopping = [dataSource _isStopping];
+    BOOL isStopping = [frameLoader _isStopping];
 
     [self cancelContentPolicy];
-    if (!isStopping){
+    if (!isStopping)
         [self continueAfterContentPolicy:policy response:r];
-    }
+
     [r release];
 }
 
     policyResponse = [r retain];
 
     [l retain];
-    [dataSource _decidePolicyForMIMEType:[r MIMEType] decisionListener:listener];
+    [frameLoader _decidePolicyForMIMEType:[r MIMEType] decisionListener:listener];
     [l release];
 }
 
 - (void)didReceiveResponse:(NSURLResponse *)r
 {
     ASSERT([[r URL] _webkit_shouldLoadAsEmptyDocument] || ![self defersCallbacks]);
-    ASSERT([[r URL] _webkit_shouldLoadAsEmptyDocument] || ![[dataSource _webView] defersCallbacks]);
+    ASSERT([[r URL] _webkit_shouldLoadAsEmptyDocument] || ![frameLoader _defersCallbacks]);
 
     LOG(Loading, "main content type: %@", [r MIMEType]);
     
     if (loadingMultipartContent) {
-        [[self dataSource] _setupForReplaceByMIMEType:[r MIMEType]];
+        [frameLoader _setupForReplaceByMIMEType:[r MIMEType]];
         [self clearResourceData];
     }
     
     // retain/release self in this delegate method since the additional processing can do
     // anything including possibly releasing self; one example of this is 3266216
     [self retain];
-    [dataSource _setResponse:r];
+    [frameLoader _setResponse:r];
     _contentLength = [r expectedContentLength];
 
     [self checkContentPolicyForResponse:r];
     ASSERT(data);
     ASSERT([data length] != 0);
     ASSERT(![self defersCallbacks]);
-    ASSERT(![[dataSource _webView] defersCallbacks]);
+    ASSERT(![frameLoader _defersCallbacks]);
  
-    LOG(Loading, "URL = %@, data = %p, length %d", [dataSource _URL], data, [data length]);
+    LOG(Loading, "URL = %@, data = %p, length %d", [frameLoader _URL], data, [data length]);
 
     // retain/release self in this delegate method since the additional processing can do
     // anything including possibly releasing self; one example of this is 3266216
     [self retain];
-    [dataSource _mainReceivedBytesSoFar:_bytesReceived complete:NO];
+    [frameLoader _mainReceivedBytesSoFar:_bytesReceived complete:NO];
     
     [super didReceiveData:data lengthReceived:lengthReceived];
     _bytesReceived += [data length];
 
 - (void)didFinishLoading
 {
-    ASSERT([[dataSource _URL] _webkit_shouldLoadAsEmptyDocument] || ![self defersCallbacks]);
-    ASSERT([[dataSource _URL] _webkit_shouldLoadAsEmptyDocument] || ![[dataSource _webView] defersCallbacks]);
+    ASSERT([[frameLoader _URL] _webkit_shouldLoadAsEmptyDocument] || ![self defersCallbacks]);
+    ASSERT([[frameLoader _URL] _webkit_shouldLoadAsEmptyDocument] || ![frameLoader _defersCallbacks]);
 
-    LOG(Loading, "URL = %@", [dataSource _URL]);
+    LOG(Loading, "URL = %@", [frameLoader _URL]);
         
     // Calls in this method will most likely result in a call to release, so we must retain.
     [self retain];
 
-    [dataSource _finishedLoading];
-    [dataSource _mainReceivedBytesSoFar:_bytesReceived complete:YES];
+    [frameLoader _finishedLoading];
+    [frameLoader _mainReceivedBytesSoFar:_bytesReceived complete:YES];
     [super didFinishLoading];
 
     [self release];
 - (void)didFailWithError:(NSError *)error
 {
     ASSERT(![self defersCallbacks]);
-    ASSERT(![[dataSource _webView] defersCallbacks]);
+    ASSERT(![frameLoader _defersCallbacks]);
 
     [self receivedError:error];
 }
 
     ASSERT(connection == nil);
     ASSERT(shouldLoadEmptyBeforeRedirect || ![self defersCallbacks]);
-    ASSERT(shouldLoadEmptyBeforeRedirect || ![[dataSource _webView] defersCallbacks]);
+    ASSERT(shouldLoadEmptyBeforeRedirect || ![frameLoader _defersCallbacks]);
 
     // Send this synthetic delegate callback since clients expect it, and
     // we no longer send the callback from within NSURLConnection for