Reviewed by Brady.
authormjs <mjs@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 12 May 2006 22:21:13 +0000 (22:21 +0000)
committermjs <mjs@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 12 May 2006 22:21:13 +0000 (22:21 +0000)
        http://bugzilla.opendarwin.org/show_bug.cgi?id=8876
        - move most private WebDataSource methods to uninstalled header

        I put the declarations for the ones only used in WebKit in WebDataSourceInternal.h
        and removed two entirey unused ones.

        * Plugins/WebNetscapePluginRepresentation.m:
        * Plugins/WebNetscapePluginStream.m:
        * Plugins/WebPluginController.m:
        * Plugins/WebPluginDocumentView.m:
        * WebCoreSupport/WebFrameBridge.m:
        (-[WebFrameBridge dataSource]):
        * WebCoreSupport/WebSubresourceLoader.m:
        * WebKit.xcodeproj/project.pbxproj:
        * WebView/WebDataSource.m:
        (-[WebDataSource _updateIconDatabaseWithURL:]):
        (-[WebDataSource _loadIcon]):
        (-[WebDataSource _clearErrors]):
        (-[WebDataSource _commitLoadWithData:]):
        (-[WebDataSource _doesProgressiveLoadWithMIMEType:]):
        (-[WebDataSource _addResponse:]):
        * WebView/WebDataSourceInternal.h: Added.
        * WebView/WebDataSourcePrivate.h:
        * WebView/WebFrame.m:
        * WebView/WebHTMLRepresentation.m:
        * WebView/WebHTMLView.m:
        * WebView/WebImageView.m:
        * WebView/WebLoader.m:
        * WebView/WebMainResourceLoader.m:
        * WebView/WebPDFView.m:
        * WebView/WebRenderNode.m:
        * WebView/WebView.m:

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

20 files changed:
WebKit/ChangeLog
WebKit/Plugins/WebNetscapePluginRepresentation.m
WebKit/Plugins/WebNetscapePluginStream.m
WebKit/Plugins/WebPluginController.m
WebKit/Plugins/WebPluginDocumentView.m
WebKit/WebCoreSupport/WebFrameBridge.m
WebKit/WebCoreSupport/WebSubresourceLoader.m
WebKit/WebKit.xcodeproj/project.pbxproj
WebKit/WebView/WebDataSource.m
WebKit/WebView/WebDataSourceInternal.h [new file with mode: 0644]
WebKit/WebView/WebDataSourcePrivate.h
WebKit/WebView/WebFrame.m
WebKit/WebView/WebHTMLRepresentation.m
WebKit/WebView/WebHTMLView.m
WebKit/WebView/WebImageView.m
WebKit/WebView/WebLoader.m
WebKit/WebView/WebMainResourceLoader.m
WebKit/WebView/WebPDFView.m
WebKit/WebView/WebRenderNode.m
WebKit/WebView/WebView.m

index 235535f6c73b451e0e91633936d53a0730623871..49bb774e8a88159aa6efba98968565dcbbf62ef9 100644 (file)
@@ -1,3 +1,40 @@
+2006-05-12  Maciej Stachowiak  <mjs@apple.com>
+
+        Reviewed by Brady.
+        
+        http://bugzilla.opendarwin.org/show_bug.cgi?id=8876
+        - move most private WebDataSource methods to uninstalled header
+        
+        I put the declarations for the ones only used in WebKit in WebDataSourceInternal.h
+        and removed two entirey unused ones.
+
+        * Plugins/WebNetscapePluginRepresentation.m:
+        * Plugins/WebNetscapePluginStream.m:
+        * Plugins/WebPluginController.m:
+        * Plugins/WebPluginDocumentView.m:
+        * WebCoreSupport/WebFrameBridge.m:
+        (-[WebFrameBridge dataSource]):
+        * WebCoreSupport/WebSubresourceLoader.m:
+        * WebKit.xcodeproj/project.pbxproj:
+        * WebView/WebDataSource.m:
+        (-[WebDataSource _updateIconDatabaseWithURL:]):
+        (-[WebDataSource _loadIcon]):
+        (-[WebDataSource _clearErrors]):
+        (-[WebDataSource _commitLoadWithData:]):
+        (-[WebDataSource _doesProgressiveLoadWithMIMEType:]):
+        (-[WebDataSource _addResponse:]):
+        * WebView/WebDataSourceInternal.h: Added.
+        * WebView/WebDataSourcePrivate.h:
+        * WebView/WebFrame.m:
+        * WebView/WebHTMLRepresentation.m:
+        * WebView/WebHTMLView.m:
+        * WebView/WebImageView.m:
+        * WebView/WebLoader.m:
+        * WebView/WebMainResourceLoader.m:
+        * WebView/WebPDFView.m:
+        * WebView/WebRenderNode.m:
+        * WebView/WebView.m:
+
 2006-05-12  Tim Omernick  <timo@apple.com>
 
         Reviewed by John Sullivan.
index 503e629c758e7e08d944b323fe7d5c81ec6a4d27..72fe30c407a9f45da806f7b11c80fd928fb6068e 100644 (file)
@@ -29,7 +29,7 @@
 #import <WebKit/WebNetscapePluginRepresentation.h>
 
 #import <JavaScriptCore/Assertions.h>
-#import <WebKit/WebDataSourcePrivate.h>
+#import <WebKit/WebDataSourceInternal.h>
 #import <WebKit/WebFrame.h>
 #import <WebKit/WebFrameView.h>
 #import <WebKit/WebNetscapePluginDocumentView.h>
index 7432c3f9df1e12dbefc5b4527b6ff2f88a3e01e0..ef34c36492f5e7f72051803f51740b4814626ae2 100644 (file)
@@ -30,7 +30,7 @@
 
 #import <WebKit/WebLoader.h>
 #import <WebKit/WebFrameBridge.h>
-#import <WebKit/WebDataSourcePrivate.h>
+#import <WebKit/WebDataSourceInternal.h>
 #import <WebKit/WebKitErrorsPrivate.h>
 #import <WebKit/WebKitLogging.h>
 #import <WebKit/WebNetscapePluginEmbeddedView.h>
index 75ad9280c77b821dd021a0cacf635c0ad1fa68bc..f750c29ee67973aaf67426efbc59b79bebe5d118 100644 (file)
@@ -43,7 +43,7 @@
 #import <WebKit/WebPluginViewFactory.h>
 #import <WebKit/WebViewInternal.h>
 #import <WebKit/WebUIDelegate.h>
-#import <WebKit/WebDataSourcePrivate.h>
+#import <WebKit/WebDataSourceInternal.h>
 
 #import <WebCore/WebCoreFrameBridge.h>
 
index 1ccacefe29d5fcaf7bc8b114e3cb6d3d191a5e13..3f7c541967cad5299e28f323f9d080870a1f2569 100644 (file)
@@ -29,7 +29,7 @@
 #import <WebKit/WebPluginDocumentView.h>
 
 #import <JavaScriptCore/Assertions.h>
-#import <WebKit/WebDataSourcePrivate.h>
+#import <WebKit/WebDataSourceInternal.h>
 #import <WebKit/WebFrame.h>
 #import <WebKit/WebFrameView.h>
 #import <WebKit/WebKitErrorsPrivate.h>
index bfb9f04059d70c7e99325bfe8ee7e1fef1cc4ccb..d39d4219c9e873e435ab08b0cbb5007f51347fc2 100644 (file)
@@ -32,7 +32,7 @@
 #import "WebBackForwardList.h"
 #import "WebBaseNetscapePluginView.h"
 #import "WebBasePluginPackage.h"
-#import "WebDataSourcePrivate.h"
+#import "WebDataSourceInternal.h"
 #import "WebDefaultUIDelegate.h"
 #import "WebEditingDelegate.h"
 #import "WebFormDataStream.h"
@@ -461,7 +461,6 @@ NSString *WebPluginContainerKey =   @"WebPluginContainer";
     WebDataSource *dataSource = [_frame dataSource];
 
     ASSERT(dataSource != nil);
-    ASSERT([dataSource _isCommitted]);
 
     return dataSource;
 }
index 1cd7bf51f435dbb21ed270ca017f9f8ff5053773..989c3725a190cdf5b9b6e66a3b3010c98bc24eec 100644 (file)
@@ -30,7 +30,7 @@
 
 #import <JavaScriptCore/Assertions.h>
 #import <WebKit/WebFrameBridge.h>
-#import <WebKit/WebDataSourcePrivate.h>
+#import <WebKit/WebDataSourceInternal.h>
 #import <WebKit/WebFormDataStream.h>
 #import <WebKit/WebFrame.h>
 #import <WebKit/WebKitErrorsPrivate.h>
index 67f32821d909de832d93cfd30dde5191c018fa11..63c1adcf62b98df58d533d5c479dca5d64558773 100644 (file)
@@ -33,6 +33,7 @@
                65488DA2084FBCCB00831AD0 /* WebNSDictionaryExtras.m in Sources */ = {isa = PBXBuildFile; fileRef = 65488DA0084FBCCB00831AD0 /* WebNSDictionaryExtras.m */; };
                6550B7C7099EFAE90090D781 /* WebArchiver.h in Headers */ = {isa = PBXBuildFile; fileRef = 6550B7C5099EFAE90090D781 /* WebArchiver.h */; };
                6550B7C8099EFAE90090D781 /* WebArchiver.m in Sources */ = {isa = PBXBuildFile; fileRef = 6550B7C6099EFAE90090D781 /* WebArchiver.m */; };
+               658A40960A14853B005E6987 /* WebDataSourceInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 658A40950A14853B005E6987 /* WebDataSourceInternal.h */; };
                65A0006908527D1A005620FA /* libWebKitSystemInterface.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 65A0006808527D1A005620FA /* libWebKitSystemInterface.a */; };
                65C7F42C0979DE640022E453 /* WebPageBridge.h in Headers */ = {isa = PBXBuildFile; fileRef = 65C7F42A0979DE640022E453 /* WebPageBridge.h */; };
                65C7F42D0979DE640022E453 /* WebPageBridge.m in Sources */ = {isa = PBXBuildFile; fileRef = 65C7F42B0979DE640022E453 /* WebPageBridge.m */; };
                6578F5DE045F817400000128 /* WebDownload.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebDownload.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                6578F5DF045F817400000128 /* WebDownload.m */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebDownload.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                65836F5E07EE425900682F95 /* WebPluginContainerPrivate.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebPluginContainerPrivate.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
+               658A40950A14853B005E6987 /* WebDataSourceInternal.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = WebDataSourceInternal.h; sourceTree = "<group>"; };
                65A0006808527D1A005620FA /* libWebKitSystemInterface.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libWebKitSystemInterface.a; sourceTree = BUILT_PRODUCTS_DIR; };
                65A7D44A0568AB2600E70EF6 /* WebUIDelegatePrivate.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebUIDelegatePrivate.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                65C7F42A0979DE640022E453 /* WebPageBridge.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = WebPageBridge.h; sourceTree = "<group>"; };
                9C7CABBB0190A37C0ECA16EA /* WebView */ = {
                        isa = PBXGroup;
                        children = (
+                               658A40950A14853B005E6987 /* WebDataSourceInternal.h */,
                                650F74E209E488F70020118A /* WebUnarchivingState.h */,
                                650F74E309E488F70020118A /* WebUnarchivingState.m */,
                                6550B7C5099EFAE90090D781 /* WebArchiver.h */,
                                650F74E409E488F70020118A /* WebUnarchivingState.h in Headers */,
                                93EB178F09F88D510091F8FF /* WebSystemInterface.h in Headers */,
                                225F881509F97E8A00423A40 /* WebPluginPrivate.h in Headers */,
+                               658A40960A14853B005E6987 /* WebDataSourceInternal.h in Headers */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
index 7b84820da366063b8d7d40bbc1191a7e16e4c1c0..0bcacdfd8533ebc0702ae9861ee574ca70deeda0 100644 (file)
@@ -26,8 +26,9 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#import <WebKit/WebDataSourcePrivate.h>
+#import <WebKit/WebDataSource.h>
 
+#import <WebKit/WebDataSourceInternal.h>
 #import <WebKit/DOMHTML.h>
 #import <JavaScriptCore/Assertions.h>
 #import <WebKit/WebArchive.h>
 #import <Foundation/NSURLConnection.h>
 #import <Foundation/NSURLRequest.h>
 
+@interface WebDataSourcePrivate : NSObject
+{
+    @public
+    NSData *resourceData;
+    
+    id <WebDocumentRepresentation> representation;
+    
+    // A reference to actual request used to create the data source.
+    // This should only be used by the resourceLoadDelegate's
+    // identifierForInitialRequest:fromDatasource: method.  It is
+    // not guaranteed to remain unchanged, as requests are mutable.
+    NSURLRequest *originalRequest;
+    
+    // A copy of the original request used to create the data source.
+    // We have to copy the request because requests are mutable.
+    NSURLRequest *originalRequestCopy;
+    
+    // The 'working' request for this datasource.  It may be mutated
+    // several times from the original request to include additional
+    // headers, cookie information, canonicalization and redirects.
+    NSMutableURLRequest *request;
+    
+    NSURLResponse *response;
+    
+    // Client for main resource.
+    WebMainResourceLoader *mainResourceLoader;
+    
+    // Clients for other resources.
+    NSMutableArray *subresourceLoaders;
+    NSMutableArray *plugInStreamLoaders;
+    
+    // The time when the data source was told to start loading.
+    double loadingStartedTime;
+    
+    BOOL primaryLoadComplete;
+    
+    BOOL stopping;
+    
+    BOOL isClientRedirect;
+    
+    NSString *pageTitle;
+    
+    NSString *encoding;
+    NSString *overrideEncoding;
+    
+    // Error associated with main document.
+    NSError *mainDocumentError;
+    
+    BOOL loading; // self and webView are retained while loading
+    
+    BOOL gotFirstByte; // got first byte
+    BOOL committed; // This data source has been committed
+    BOOL representationFinishedLoading;
+    
+    BOOL defersCallbacks;
+    
+    NSURL *iconURL;
+    WebIconLoader *iconLoader;
+    
+    // The action that triggered loading of this data source -
+    // we keep this around for the benefit of the various policy
+    // handlers.
+    NSDictionary *triggeringAction;
+    
+    // The last request that we checked click policy for - kept around
+    // so we can avoid asking again needlessly.
+    NSURLRequest *lastCheckedRequest;
+    
+    // We retain all the received responses so we can play back the
+    // WebResourceLoadDelegate messages if the item is loaded from the
+    // page cache.
+    NSMutableArray *responses;
+    BOOL stopRecordingResponses;
+    
+    BOOL loadingFromPageCache;
+    
+    WebFrame *webFrame;
+    
+    NSMutableDictionary *subresources;
+    
+    WebUnarchivingState *unarchivingState;
+    
+    BOOL supportsMultipartContent;
+}
+
+@end
+
 @implementation WebDataSourcePrivate 
 
 - (void)dealloc
     _private->resourceData = data;
 }
 
+- (void)_updateIconDatabaseWithURL:(NSURL *)iconURL
+{
+    ASSERT([[WebIconDatabase sharedIconDatabase] _isEnabled]);
+    
+    WebIconDatabase *iconDB = [WebIconDatabase sharedIconDatabase];
+    
+    // Bind the URL of the original request and the final URL to the icon URL.
+    [iconDB _setIconURL:[iconURL _web_originalDataAsString] forURL:[[self _URL] _web_originalDataAsString]];
+    [iconDB _setIconURL:[iconURL _web_originalDataAsString] forURL:[[[self _originalRequest] URL] _web_originalDataAsString]];
+    
+    
+    if ([self webFrame] == [[self _webView] mainFrame])
+        [[self _webView] _willChangeValueForKey:_WebMainFrameIconKey];
+    
+    NSImage *icon = [iconDB iconForURL:[[self _URL] _web_originalDataAsString] withSize:WebIconSmallSize];
+    [[[self _webView] _frameLoadDelegateForwarder] webView:[self _webView]
+                                            didReceiveIcon:icon
+                                                  forFrame:[self webFrame]];
+    
+    if ([self webFrame] == [[self _webView] mainFrame])
+        [[self _webView] _didChangeValueForKey:_WebMainFrameIconKey];
+}
+
+- (void)_loadIcon
+{
+    // Don't load an icon if 1) this is not the main frame 2) we ended in error 3) we already did 4) they aren't save by the DB.
+    if ([self webFrame] != [[self _webView] mainFrame] || _private->mainDocumentError || _private->iconLoader ||
+        ![[WebIconDatabase sharedIconDatabase] _isEnabled]) {
+        return;
+    }
+    
+    if(!_private->iconURL){
+        // No icon URL from the LINK tag so try the server's root.
+        // This is only really a feature of http or https, so don't try this with other protocols.
+        NSString *scheme = [[self _URL] scheme];
+        if([scheme isEqualToString:@"http"] || [scheme isEqualToString:@"https"]){
+            _private->iconURL = [[[NSURL _web_URLWithDataAsString:@"/favicon.ico"
+                                                    relativeToURL:[self _URL]] absoluteURL] retain];
+        }
+    }
+    
+    if(_private->iconURL != nil){
+        if([[WebIconDatabase sharedIconDatabase] _hasIconForIconURL:[_private->iconURL _web_originalDataAsString]]){
+            [self _updateIconDatabaseWithURL:_private->iconURL];
+        }else{
+            ASSERT(!_private->iconLoader);
+            NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:_private->iconURL];
+            [[self webFrame] _addExtraFieldsToRequest:request alwaysFromRequest:NO];
+            _private->iconLoader = [[WebIconLoader alloc] initWithRequest:request];
+            [request release];
+            [_private->iconLoader setDelegate:self];
+            [_private->iconLoader setDataSource:self];
+            [_private->iconLoader startLoading];
+        }
+    }
+}
+
 - (void)_setPrimaryLoadComplete: (BOOL)flag
 {
     _private->primaryLoadComplete = flag;
     [self release];
 }
 
+- (void)_clearErrors
+{
+    [_private->mainDocumentError release];
+    _private->mainDocumentError = nil;
+}
+
 - (void)_prepareForLoadStart
 {
     ASSERT(![self _isStopping]);
     }
 }
 
-- (void)_clearErrors
-{
-    [_private->mainDocumentError release];
-    _private->mainDocumentError = nil;
-}
-
 static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class class, NSArray *supportTypes)
 {
     NSEnumerator *enumerator = [supportTypes objectEnumerator];
@@ -594,11 +739,6 @@ static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class class,
     return [[self webFrame] _bridge];
 }
 
-- (BOOL)_isCommitted
-{
-    return _private->committed;
-}
-
 - (void)_commitIfReady
 {
     if (_private->gotFirstByte && !_private->committed) {
@@ -621,6 +761,22 @@ static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class class,
     [_private->representation setDataSource:self];
 }
 
+- (void)_commitLoadWithData:(NSData *)data
+{
+    // Both unloading the old page and parsing the new page may execute JavaScript which destroys the datasource
+    // by starting a new load, so retain temporarily.
+    [self retain];
+    [self _commitIfReady];
+    [[self representation] receivedData:data withDataSource:self];
+    [[[[self webFrame] frameView] documentView] dataSourceUpdated:self];
+    [self release];
+}
+
+- (BOOL)_doesProgressiveLoadWithMIMEType:(NSString *)MIMEType
+{
+    return [[self webFrame] _loadType] != WebFrameLoadTypeReplace || [MIMEType isEqualToString:@"text/html"];
+}
+
 -(void)_receivedData:(NSData *)data
 {    
     _private->gotFirstByte = YES;
@@ -664,68 +820,11 @@ static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class class,
                                complete:isComplete];
 }
 
-- (void)_updateIconDatabaseWithURL:(NSURL *)iconURL
-{
-    ASSERT([[WebIconDatabase sharedIconDatabase] _isEnabled]);
-    
-    WebIconDatabase *iconDB = [WebIconDatabase sharedIconDatabase];
-
-    // Bind the URL of the original request and the final URL to the icon URL.
-    [iconDB _setIconURL:[iconURL _web_originalDataAsString] forURL:[[self _URL] _web_originalDataAsString]];
-    [iconDB _setIconURL:[iconURL _web_originalDataAsString] forURL:[[[self _originalRequest] URL] _web_originalDataAsString]];
-
-    
-    if ([self webFrame] == [[self _webView] mainFrame])
-        [[self _webView] _willChangeValueForKey:_WebMainFrameIconKey];
-    
-    NSImage *icon = [iconDB iconForURL:[[self _URL] _web_originalDataAsString] withSize:WebIconSmallSize];
-    [[[self _webView] _frameLoadDelegateForwarder] webView:[self _webView]
-                                                      didReceiveIcon:icon
-                                                            forFrame:[self webFrame]];
-    
-    if ([self webFrame] == [[self _webView] mainFrame])
-        [[self _webView] _didChangeValueForKey:_WebMainFrameIconKey];
-}
-
 - (void)_iconLoaderReceivedPageIcon:(WebIconLoader *)iconLoader
 {
     [self _updateIconDatabaseWithURL:[iconLoader URL]];
 }
 
-- (void)_loadIcon
-{
-    // Don't load an icon if 1) this is not the main frame 2) we ended in error 3) we already did 4) they aren't save by the DB.
-    if ([self webFrame] != [[self _webView] mainFrame] || _private->mainDocumentError || _private->iconLoader ||
-       ![[WebIconDatabase sharedIconDatabase] _isEnabled]) {
-        return;
-    }
-                
-    if(!_private->iconURL){
-        // No icon URL from the LINK tag so try the server's root.
-        // This is only really a feature of http or https, so don't try this with other protocols.
-        NSString *scheme = [[self _URL] scheme];
-        if([scheme isEqualToString:@"http"] || [scheme isEqualToString:@"https"]){
-            _private->iconURL = [[[NSURL _web_URLWithDataAsString:@"/favicon.ico"
-                                              relativeToURL:[self _URL]] absoluteURL] retain];
-        }
-    }
-
-    if(_private->iconURL != nil){
-        if([[WebIconDatabase sharedIconDatabase] _hasIconForIconURL:[_private->iconURL _web_originalDataAsString]]){
-            [self _updateIconDatabaseWithURL:_private->iconURL];
-        }else{
-            ASSERT(!_private->iconLoader);
-            NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:_private->iconURL];
-            [[self webFrame] _addExtraFieldsToRequest:request alwaysFromRequest:NO];
-            _private->iconLoader = [[WebIconLoader alloc] initWithRequest:request];
-            [request release];
-            [_private->iconLoader setDelegate:self];
-            [_private->iconLoader setDataSource:self];
-            [_private->iconLoader startLoading];
-        }
-    }
-}
-
 - (void)_setIconURL:(NSURL *)URL
 {
     // Lower priority than typed icon, so ignore this if we already have an iconURL.
@@ -800,7 +899,7 @@ static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class class,
     return _private->loadingFromPageCache;
 }
 
-- (void)_addResponse: (NSURLResponse *)r
+- (void)_addResponse:(NSURLResponse *)r
 {
     if (!_private->stopRecordingResponses) {
         if (!_private->responses)
@@ -841,17 +940,6 @@ static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class class,
     return [[self request] URL];
 }
 
-- (NSString *)_stringWithData:(NSData *)data
-{
-    NSString *textEncodingName = [self textEncodingName];
-
-    if (textEncodingName) {
-        return [WebFrameBridge stringWithData:data textEncodingName:textEncodingName];
-    } else {
-        return [WebFrameBridge stringWithData:data textEncoding:kCFStringEncodingISOLatin1];
-    }
-}
-
 - (NSError *)_mainDocumentError
 {
     return _private->mainDocumentError;
@@ -863,22 +951,6 @@ static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class class,
     return [WebView canShowMIMETypeAsHTML:MIMEType];
 }
 
-- (BOOL)_doesProgressiveLoadWithMIMEType:(NSString *)MIMEType
-{
-    return [[self webFrame] _loadType] != WebFrameLoadTypeReplace || [MIMEType isEqualToString:@"text/html"];
-}
-
-- (void)_commitLoadWithData:(NSData *)data
-{
-    // Both unloading the old page and parsing the new page may execute JavaScript which destroys the datasource
-    // by starting a new load, so retain temporarily.
-    [self retain];
-    [self _commitIfReady];
-    [[self representation] receivedData:data withDataSource:self];
-    [[[[self webFrame] frameView] documentView] dataSourceUpdated:self];
-    [self release];
-}
-
 - (void)_revertToProvisionalState
 {
     [self _setRepresentation:nil];
diff --git a/WebKit/WebView/WebDataSourceInternal.h b/WebKit/WebView/WebDataSourceInternal.h
new file mode 100644 (file)
index 0000000..19aea71
--- /dev/null
@@ -0,0 +1,108 @@
+/*
+ * Copyright (C) 2005, 2006 Apple Computer, Inc.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer. 
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution. 
+ * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ *     its contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission. 
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import <WebKit/WebDataSourcePrivate.h>
+
+@class NSURL;
+
+@class DOMDocumentFragment;
+@class DOMElement;
+@class DOMRange;
+@class NSError;
+@class NSURLRequest;
+@class NSURLResponse;
+@class WebArchive;
+@class WebLoader;
+@class WebFrameBridge;
+@class WebHistoryItem;
+@class WebIconLoader;
+@class WebMainResourceLoader;
+@class WebResource;
+@class WebUnarchivingState;
+@class WebView;
+@protocol WebDocumentRepresentation;
+
+@interface WebDataSource (WebInternal)
+- (void)_addPlugInStreamLoader:(WebLoader *)loader;
+- (void)_removePlugInStreamLoader:(WebLoader *)loader;
+- (void)_stopLoadingWithError:(NSError *)error;
+- (void)_setTitle:(NSString *)title;
+- (NSString *)_overrideEncoding;
+- (void)_setIconURL:(NSURL *)URL;
+- (void)_setTitle:(NSString *)title;
+- (NSString *)_overrideEncoding;
+- (void)_setIconURL:(NSURL *)URL;
+- (void)_setIconURL:(NSURL *)URL withType:(NSString *)iconType;
+- (void)_addSubresourceLoader:(WebLoader *)loader;
+- (void)_removeSubresourceLoader:(WebLoader *)loader;
+- (NSURLRequest *)_originalRequest;
+- (WebView *)_webView;
+- (WebResource *)_archivedSubresourceForURL:(NSURL *)URL;
+- (void)_addResponse:(NSURLResponse *)r;
+- (WebFrameBridge *)_bridge;
+- (void)_setOverrideEncoding:(NSString *)overrideEncoding;
+- (void)_replaceSelectionWithArchive:(WebArchive *)archive selectReplacement:(BOOL)selectReplacement;
+- (NSURL *)_URL;
++ (NSMutableDictionary *)_repTypesAllowImageTypeOmission:(BOOL)allowImageTypeOmission;
+- (void)_setPrimaryLoadComplete:(BOOL)flag;
+- (void)_setMainDocumentError:(NSError *)error;
+- (void)_addToUnarchiveState:(WebArchive *)archive;
+- (NSURL *)_URLForHistory;
+- (void)_setWebFrame:(WebFrame *)frame;
+- (BOOL)_isClientRedirect;
+- (void)_makeRepresentation;
+- (double)_loadingStartedTime;
+- (BOOL)_isStopping;
+- (void)_finishedLoading;
+- (void)_setResponse:(NSURLResponse *)response;
+- (void)_setupForReplaceByMIMEType:(NSString *)mimeType;
+- (void)_setRequest:(NSURLRequest *)request;
+- (void)_receivedData:(NSData *)data;
+- (void)_receivedMainResourceError:(NSError *)error complete:(BOOL)isComplete;
+- (BOOL)_isDocumentHTML;
+- (DOMDocumentFragment *)_documentFragmentWithImageResource:(WebResource *)resource;
+- (DOMDocumentFragment *)_documentFragmentWithArchive:(WebArchive *)archive;
+- (NSString *)_title;
+- (void)_stopRecordingResponses;
+- (BOOL)_loadingFromPageCache;
+- (NSArray *)_responses;
+- (void)_stopLoading;
+- (void)__adoptRequest:(NSMutableURLRequest *)request;
+- (void)_setTriggeringAction:(NSDictionary *)action;
+- (NSDictionary *)_triggeringAction;
+- (NSURLRequest *)_lastCheckedRequest;
+- (void)_setLastCheckedRequest:(NSURLRequest *)request;
+- (void)_setURL:(NSURL *)URL;
+- (void)_setIsClientRedirect:(BOOL)flag;
+- (WebArchive *)_popSubframeArchiveWithName:(NSString *)frameName;
+- (void)_defersCallbacksChanged;
+- (void)_startLoading;
+- (void)_loadFromPageCache:(NSDictionary *)pageCache;
+- (DOMElement *)_imageElementWithImageResource:(WebResource *)resource;
+
+@end
index 4ff36aa969af7fe428657b0d70173a32a19992dc..0e41b4fc323ebd35d72cc059c55ca248cc2f791f 100644 (file)
 
 #import <WebKit/WebDataSource.h>
 
-@class DOMDocumentFragment;
-@class DOMElement;
-@class DOMRange;
-@class NSError;
-@class NSURLRequest;
-@class NSURLResponse;
-@class WebArchive;
-@class WebLoader;
-@class WebFrameBridge;
-@class WebHistoryItem;
-@class WebIconLoader;
-@class WebMainResourceLoader;
-@class WebResource;
-@class WebUnarchivingState;
-@class WebView;
-
-@protocol WebDocumentRepresentation;
-
-@interface WebDataSourcePrivate : NSObject
-{
-@public
-    NSData *resourceData;
-
-    id <WebDocumentRepresentation> representation;
-    
-    // A reference to actual request used to create the data source.
-    // This should only be used by the resourceLoadDelegate's
-    // identifierForInitialRequest:fromDatasource: method.  It is
-    // not guaranteed to remain unchanged, as requests are mutable.
-    NSURLRequest *originalRequest;
-    
-    // A copy of the original request used to create the data source.
-    // We have to copy the request because requests are mutable.
-    NSURLRequest *originalRequestCopy;
-    
-    // The 'working' request for this datasource.  It may be mutated
-    // several times from the original request to include additional
-    // headers, cookie information, canonicalization and redirects.
-    NSMutableURLRequest *request;
-    
-    NSURLResponse *response;
-
-    // Client for main resource.
-    WebMainResourceLoader *mainResourceLoader;
-    
-    // Clients for other resources.
-    NSMutableArray *subresourceLoaders;
-    NSMutableArray *plugInStreamLoaders;
-
-    // The time when the data source was told to start loading.
-    double loadingStartedTime;
-    
-    BOOL primaryLoadComplete;
-
-    BOOL stopping;
-
-    BOOL isClientRedirect;
-
-    NSString *pageTitle;
-    
-    NSString *encoding;
-    NSString *overrideEncoding;
-
-    // Error associated with main document.
-    NSError *mainDocumentError;
-
-    BOOL loading; // self and webView are retained while loading
-
-    BOOL gotFirstByte; // got first byte
-    BOOL committed; // This data source has been committed
-    BOOL representationFinishedLoading;
-
-    BOOL defersCallbacks;
-
-    NSURL *iconURL;
-    WebIconLoader *iconLoader;
-
-    // The action that triggered loading of this data source -
-    // we keep this around for the benefit of the various policy
-    // handlers.
-    NSDictionary *triggeringAction;
-
-    // The last request that we checked click policy for - kept around
-    // so we can avoid asking again needlessly.
-    NSURLRequest *lastCheckedRequest;
-
-    // We retain all the received responses so we can play back the
-    // WebResourceLoadDelegate messages if the item is loaded from the
-    // page cache.
-    NSMutableArray *responses;
-    BOOL stopRecordingResponses;
-
-    BOOL loadingFromPageCache;
-
-    WebFrame *webFrame;
-    
-    NSMutableDictionary *subresources;
-
-    WebUnarchivingState *unarchivingState;
-    
-    BOOL supportsMultipartContent;
-}
-
-@end
-
 @interface WebDataSource (WebPrivate)
 
-// Other private methods
 - (NSFileWrapper *)_fileWrapperForURL:(NSURL *)URL;
-- (void)_addToUnarchiveState:(WebArchive *)archive;
 
-- (WebArchive *)_popSubframeArchiveWithName:(NSString *)frameName;
-
-- (DOMElement *)_imageElementWithImageResource:(WebResource *)resource;
-- (DOMDocumentFragment *)_documentFragmentWithImageResource:(WebResource *)resource;
-- (DOMDocumentFragment *)_documentFragmentWithArchive:(WebArchive *)archive;
-- (void)_replaceSelectionWithArchive:(WebArchive *)archive selectReplacement:(BOOL)selectReplacement;
+// Need to add this back, Mail uses it
+// - (void)_addSubframeArchives:(NSArray *) archives;
 
 - (NSError *)_mainDocumentError;
-- (NSString *)_stringWithData:(NSData *)data;
-- (void)_startLoading;
-- (void)_stopLoading;
-- (NSURL *)_URL;
-- (NSURL *)_URLForHistory;
-- (WebView *)_webView;
-- (void)_setRepresentation:(id<WebDocumentRepresentation>)representation;
-- (void)_loadFromPageCache:(NSDictionary *)pageCache;
-- (BOOL)_isStopping;
-- (void)_addSubresourceLoader:(WebLoader *)loader;
-- (void)_removeSubresourceLoader:(WebLoader *)loader;
-- (void)_addPlugInStreamLoader:(WebLoader *)loader;
-- (void)_removePlugInStreamLoader:(WebLoader *)loader;
-- (void)_setPrimaryLoadComplete:(BOOL)flag;
-- (double)_loadingStartedTime;
-- (void)_setTitle:(NSString *)title;
-- (void)_setURL:(NSURL *)URL;
-- (void)__adoptRequest:(NSMutableURLRequest *)request;
-- (void)_setRequest:(NSURLRequest *)request;
-- (void)_setResponse:(NSURLResponse *)response;
-- (void)_clearErrors;
-- (void)_setMainDocumentError:(NSError *)error;
-+ (NSMutableDictionary *)_repTypesAllowImageTypeOmission:(BOOL)allowImageTypeOmission;
-+ (Class)_representationClassForMIMEType:(NSString *)MIMEType;
-- (void)_loadIcon;
-- (void)_setIconURL:(NSURL *)URL;
-- (void)_setIconURL:(NSURL *)URL withType:(NSString *)iconType;
-- (void)_setOverrideEncoding:(NSString *)overrideEncoding;
-- (NSString *)_overrideEncoding;
-- (void)_setIsClientRedirect:(BOOL)flag;
-- (BOOL)_isClientRedirect;
-
-// Convenience interface for getting here from an WebDataSource.
-// This returns nil if the representation is not an WebHTMLRepresentation.
-- (WebFrameBridge *)_bridge;
-
-- (BOOL)_isCommitted;
-- (void)_commitIfReady;
-- (void)_makeRepresentation;
-- (void)_receivedData:(NSData *)data;
-- (void)_finishedLoading;
-- (void)_receivedMainResourceError:(NSError *)error complete:(BOOL)isComplete;
-- (void)_defersCallbacksChanged;
-- (NSURLRequest *)_originalRequest;
-- (NSDictionary *)_triggeringAction;
-- (void)_setTriggeringAction:(NSDictionary *)action;
-- (NSURLRequest *)_lastCheckedRequest;
-- (void)_setLastCheckedRequest:(NSURLRequest *)request;
-- (BOOL)_loadingFromPageCache;
-
-- (void)_addResponse:(NSURLResponse *)r;
-- (NSArray *)_responses;
-- (void)_stopRecordingResponses;
-
-- (void)_stopLoadingWithError:(NSError *)error;
-
-- (void)_setWebFrame:(WebFrame *)frame;
-
-- (BOOL)_isDocumentHTML;
-- (NSString *)_title;
-
-- (void)_setupForReplaceByMIMEType:(NSString *)mimeType;
-- (BOOL)_doesProgressiveLoadWithMIMEType:(NSString *)MIMEType;
-- (void)_commitLoadWithData:(NSData *)data;
-
-- (WebResource *)_archivedSubresourceForURL:(NSURL *)URL;
-
 @end
index 3374f9541b43ba3e76f45cb022bb34b5444a09b9..8a41eab4c12458ce14916f3e912e82b44e1a2f30 100644 (file)
@@ -33,7 +33,7 @@
 #import <WebKit/WebBackForwardList.h>
 #import <WebKit/WebFrameBridge.h>
 #import <WebKit/WebDataProtocol.h>
-#import <WebKit/WebDataSourcePrivate.h>
+#import <WebKit/WebDataSourceInternal.h>
 #import <WebKit/WebDefaultResourceLoadDelegate.h>
 #import <WebKit/WebDefaultUIDelegate.h>
 #import <WebKit/WebDocumentInternal.h>
index 2a8465360202a43c0fb90980753337e02852a414..eb17b55733e6150a330714d622078874e6863dbc 100644 (file)
@@ -32,7 +32,7 @@
 #import <WebKit/WebArchive.h>
 #import <JavaScriptCore/Assertions.h>
 #import <WebKit/WebFrameBridge.h>
-#import <WebKit/WebDataSourcePrivate.h>
+#import <WebKit/WebDataSourceInternal.h>
 #import <WebKit/WebDocumentPrivate.h>
 #import <WebKit/WebFramePrivate.h>
 #import <WebKit/WebKitNSStringExtras.h>
index 4bd0d5232c978f073b880fdfe0fb0666f62a04dc..08f6ade761cb3aab8f6b566ec85b7d49c068d3a3 100644 (file)
@@ -38,7 +38,7 @@
 #import <WebKit/WebFrameBridge.h>
 #import <WebKit/WebClipView.h>
 #import <WebKit/WebDataProtocol.h>
-#import <WebKit/WebDataSourcePrivate.h>
+#import <WebKit/WebDataSourceInternal.h>
 #import <WebKit/WebDefaultUIDelegate.h>
 #import <WebKit/WebDocumentInternal.h>
 #import <WebKit/WebDOMOperationsPrivate.h>
index e580e3d77c2c5659a7ad03bb158b4d0a961e45c7..c561cc978dcf84b87b69410817f90128ec8a5a3f 100644 (file)
@@ -30,7 +30,7 @@
 
 #import <WebKit/WebArchiver.h>
 #import <JavaScriptCore/Assertions.h>
-#import <WebKit/WebDataSourcePrivate.h>
+#import <WebKit/WebDataSourceInternal.h>
 #import <WebKit/WebDocument.h>
 #import <WebKit/WebFrameView.h>
 #import <WebKit/WebImageRenderer.h>
index 9830760470873171d79a4c307da2a62035078da1..09414f4f561dc7aa5e897bdbad8cf5bad35d1939 100644 (file)
@@ -35,7 +35,7 @@
 
 #import <JavaScriptCore/Assertions.h>
 #import <WebKit/WebDataProtocol.h>
-#import <WebKit/WebDataSourcePrivate.h>
+#import <WebKit/WebDataSourceInternal.h>
 #import <WebKit/WebDefaultResourceLoadDelegate.h>
 #import <WebKit/WebKitErrors.h>
 #import <WebKit/WebKitErrorsPrivate.h>
index a0650bce23583856c20014c5f23f5e832b961602..26ff9e95ce20d95217d5502a1a5d1a48e9dcb8e2 100644 (file)
@@ -35,7 +35,7 @@
 
 #import <WebKit/DOMHTML.h>
 #import <WebKit/WebDataProtocol.h>
-#import <WebKit/WebDataSourcePrivate.h>
+#import <WebKit/WebDataSourceInternal.h>
 #import <WebKit/WebDefaultPolicyDelegate.h>
 #import <WebKit/WebDocument.h>
 #import <WebKit/WebDownload.h>
index c37384547131505536f7c5a7c59c7c4a696906fc..6f0abcda9c00e5499c1d796d7efa203022510b7d 100644 (file)
@@ -27,7 +27,7 @@
  */
 
 #import <JavaScriptCore/Assertions.h>
-#import <WebKit/WebDataSourcePrivate.h>
+#import <WebKit/WebDataSourceInternal.h>
 #import <WebKit/WebDocumentInternal.h>
 #import <WebKit/WebDocumentPrivate.h>
 #import <WebKit/WebFrame.h>
index c848a1bd8f822fcbc6a3911f48ba06565e70d76c..799b8bd3697b2669821dcf4250c651a54fb02c70 100644 (file)
@@ -31,7 +31,7 @@
 #import <WebKit/WebFrameBridge.h>
 #import <WebKit/WebFrameView.h>
 #import <WebKit/WebHTMLView.h>
-#import <WebKit/WebDataSourcePrivate.h>
+#import <WebKit/WebDataSourceInternal.h>
 #import <WebKit/WebNSViewExtras.h>
 
 @interface WebKitRenderTreeCopier : NSObject <WebCoreRenderTreeCopier>
index bb5b02dba130e0d8ee536b86770027e97587ac3e..05dbeec89e8231d24a8d54bb8a76503d78fa8af1 100644 (file)
@@ -34,7 +34,7 @@
 #import "WebDOMOperationsPrivate.h"
 #import "WebDashboardRegion.h"
 #import "WebDataProtocol.h"
-#import "WebDataSourcePrivate.h"
+#import "WebDataSourceInternal.h"
 #import "WebDefaultEditingDelegate.h"
 #import "WebDefaultFrameLoadDelegate.h"
 #import "WebDefaultPolicyDelegate.h"