Fixed: <rdar://problem/3907381> NSURLConnection and WebKit buffer 2 copies of incomi...
authorcblu <cblu@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 6 Dec 2004 22:20:29 +0000 (22:20 +0000)
committercblu <cblu@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 6 Dec 2004 22:20:29 +0000 (22:20 +0000)
        Reviewed by darin.

        * WebView.subproj/WebBaseResourceHandleDelegate.h:
        * WebView.subproj/WebBaseResourceHandleDelegate.m:
        (+[WebBaseResourceHandleDelegate initialize]): cache check to see if Foundation supports access to its buffered data
        (-[WebBaseResourceHandleDelegate addData:]): don't buffer data if Foundation is buffering it for us
        (-[WebBaseResourceHandleDelegate saveResource]): when creating a WebResource, pass NO for copyData since we know it won't be mutated
        (-[WebBaseResourceHandleDelegate resourceData]): return the buffered data from the connection if it supports it
        (-[WebBaseResourceHandleDelegate willStopBufferingData:]): make a mutable copy of the data from NSURLConnection so we can continue buffering
        (-[WebBaseResourceHandleDelegate willCacheResponse:]): removed optimization that used the cached response data to save the resource since that is obsolete by this change
        (-[WebBaseResourceHandleDelegate connection:willStopBufferingData:]): new callback from NSURLConnection, informs us that NSURLConnection has given up buffering
        * WebView.subproj/WebDataSource.m:
        (-[WebDataSource _receivedData:]): removed buffering code since that's done by NSURLConnection and the main client
        (-[WebDataSource _setData:]): removed unnecessary cast since the resourceData ivar is now an NSData instead of NSMutableData
        (-[WebDataSource data]): return resourceData ivar, else return the resourceData from the main client
        * WebView.subproj/WebDataSourcePrivate.h:
        * WebView.subproj/WebMainResourceClient.m:
        (-[WebMainResourceClient releaseResources]): store resourceData on the data source so it can continue to have data after the main client has gone away
        (-[WebMainResourceClient connection:didReceiveData:lengthReceived:]):don't call [dataSource data] just to get the length of data received since [dataSource data] can now cause data to be copied
        (-[WebMainResourceClient connectionDidFinishLoading:]): ditto
        * WebView.subproj/WebResource.m:
        (-[WebResource initWithData:URL:MIMEType:textEncodingName:frameName:]): call following method with YES for copyData
        (-[WebResource _initWithData:URL:MIMEType:textEncodingName:frameName:copyData:]): new initializer, allows caller to choose whether or not the data is copied
        * WebView.subproj/WebResourcePrivate.h:

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

WebKit/ChangeLog
WebKit/WebView.subproj/WebBaseResourceHandleDelegate.h
WebKit/WebView.subproj/WebBaseResourceHandleDelegate.m
WebKit/WebView.subproj/WebDataSource.m
WebKit/WebView.subproj/WebDataSourcePrivate.h
WebKit/WebView.subproj/WebLoader.h
WebKit/WebView.subproj/WebLoader.m
WebKit/WebView.subproj/WebMainResourceClient.m
WebKit/WebView.subproj/WebMainResourceLoader.m
WebKit/WebView.subproj/WebResource.m
WebKit/WebView.subproj/WebResourcePrivate.h

index 088f05894b0d9727c4c2e76f820864b63efdbec9..246d4b68e71d6338cdd9fc3ab4860dfd0934506b 100644 (file)
@@ -1,3 +1,32 @@
+2004-12-06  Chris Blumenberg  <cblu@apple.com>
+
+       Fixed: <rdar://problem/3907381> NSURLConnection and WebKit buffer 2 copies of incoming data
+
+        Reviewed by darin.
+
+        * WebView.subproj/WebBaseResourceHandleDelegate.h:
+        * WebView.subproj/WebBaseResourceHandleDelegate.m:
+        (+[WebBaseResourceHandleDelegate initialize]): cache check to see if Foundation supports access to its buffered data
+        (-[WebBaseResourceHandleDelegate addData:]): don't buffer data if Foundation is buffering it for us
+        (-[WebBaseResourceHandleDelegate saveResource]): when creating a WebResource, pass NO for copyData since we know it won't be mutated
+        (-[WebBaseResourceHandleDelegate resourceData]): return the buffered data from the connection if it supports it
+        (-[WebBaseResourceHandleDelegate willStopBufferingData:]): make a mutable copy of the data from NSURLConnection so we can continue buffering 
+        (-[WebBaseResourceHandleDelegate willCacheResponse:]): removed optimization that used the cached response data to save the resource since that is obsolete by this change
+        (-[WebBaseResourceHandleDelegate connection:willStopBufferingData:]): new callback from NSURLConnection, informs us that NSURLConnection has given up buffering
+        * WebView.subproj/WebDataSource.m:
+        (-[WebDataSource _receivedData:]): removed buffering code since that's done by NSURLConnection and the main client
+        (-[WebDataSource _setData:]): removed unnecessary cast since the resourceData ivar is now an NSData instead of NSMutableData
+        (-[WebDataSource data]): return resourceData ivar, else return the resourceData from the main client
+        * WebView.subproj/WebDataSourcePrivate.h:
+        * WebView.subproj/WebMainResourceClient.m:
+        (-[WebMainResourceClient releaseResources]): store resourceData on the data source so it can continue to have data after the main client has gone away 
+        (-[WebMainResourceClient connection:didReceiveData:lengthReceived:]):don't call [dataSource data] just to get the length of data received since [dataSource data] can now cause data to be copied
+        (-[WebMainResourceClient connectionDidFinishLoading:]): ditto
+        * WebView.subproj/WebResource.m:
+        (-[WebResource initWithData:URL:MIMEType:textEncodingName:frameName:]): call following method with YES for copyData
+        (-[WebResource _initWithData:URL:MIMEType:textEncodingName:frameName:copyData:]): new initializer, allows caller to choose whether or not the data is copied
+        * WebView.subproj/WebResourcePrivate.h:
+
 2004-12-06  Richard Williamson   <rjw@apple.com>
 
        Fixed <rdar://problem/3903749> REGRESSION (8A321): WebKit gets incorrect glyph metrics due to change in how AppKit uses CGFont
index 5e8277f62ee2902f8fc31143ac1547b6d87bb97b..4a588bf39cbd72c53f46bd651e1bdfd51a65c5dc 100644 (file)
 - (void)didCancelAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge;
 - (void)didReceiveResponse:(NSURLResponse *)r;
 - (void)didReceiveData:(NSData *)data lengthReceived:(long long)lengthReceived;
+- (void)willStopBufferingData:(NSData *)data;
 - (void)didFinishLoading;
 - (void)didFailWithError:(NSError *)error;
+- (NSCachedURLResponse *)willCacheResponse:(NSCachedURLResponse *)cachedResponse;
 
 @end
 
index 4b9c9045470642fafa39636b9946abada5db99b4..223e00f66a9101d50a30277577cd961a0d66fada 100644 (file)
 #import <WebKit/WebResourcePrivate.h>
 #import <WebKit/WebViewPrivate.h>
 
+static BOOL NSURLConnectionSupportsBufferedData;
+
+@interface NSURLConnection (NSURLConnectionTigerPrivate)
+- (NSData *)_bufferedData;
+@end
+
 @interface WebBaseResourceHandleDelegate (WebNSURLAuthenticationChallengeSender) <NSURLAuthenticationChallengeSender>
 @end
 
 
 @implementation WebBaseResourceHandleDelegate
 
++ (void)initialize
+{
+    NSURLConnectionSupportsBufferedData = [NSURLConnection instancesRespondToSelector:@selector(_bufferedData)];
+}
+
 - (void)releaseResources
 {
     ASSERT(!reachedTerminalState);
 
 - (void)addData:(NSData *)data
 {
-    if (!resource) {
-        if (!resourceData) {
-            resourceData = [[NSMutableData alloc] init];
+    // Don't buffer data if we're loading it from a WebResource.
+    if (resource == nil) {
+        if (NSURLConnectionSupportsBufferedData) {
+            // Buffer data only if the connection has handed us the data because is has stopped buffering it.
+            if (resourceData != nil) {
+                [resourceData appendData:data];
+            }
+        } else {
+            if (resourceData == nil) {
+                resourceData = [[NSMutableData alloc] init];
+            }
+            [resourceData appendData:data];
         }
-        [resourceData appendData:data];
     }
 }
 
 - (void)saveResource
 {
-    if (!resource && [resourceData length] > 0) {
-        WebResource *newResource = [[WebResource alloc] initWithData:resourceData
-                                                                 URL:originalURL
-                                                            MIMEType:[response MIMEType]
-                                                    textEncodingName:[response textEncodingName]
-                                                           frameName:nil];
-        [dataSource addSubresource:newResource];
-        [newResource release];
-    }
-}
-
-- (void)saveResourceWithCachedResponse:(NSCachedURLResponse *)cachedResponse
-{
-    if (!resource) {
-        // Overwrite the resource saved with saveResource with the cache version to save memory.
-        WebResource *newResource = [[WebResource alloc] _initWithCachedResponse:cachedResponse originalURL:originalURL];
-        [dataSource addSubresource:newResource];
-        [newResource release];
+    // Don't save data as a WebResource if it was loaded from a WebResource.
+    if (resource == nil) {
+        NSData *data = [self resourceData];
+        if ([data length] > 0) {
+            // Don't have WebResource copy the data since the data is a NSMutableData that we know won't get modified. 
+            WebResource *newResource = [[WebResource alloc] _initWithData:data
+                                                                      URL:originalURL
+                                                                 MIMEType:[response MIMEType]
+                                                         textEncodingName:[response textEncodingName]
+                                                                frameName:nil
+                                                                 copyData:NO];
+            [dataSource addSubresource:newResource];
+            [newResource release];
+        }
     }
 }
 
 - (NSData *)resourceData
 {
-    return resource ? [resource data] : resourceData;
+    if (resource != nil) {
+        return [resource data];
+    }
+    if (resourceData != nil) {
+        return resourceData;
+    }
+    if (NSURLConnectionSupportsBufferedData) {
+        return [connection _bufferedData];
+    }
+    return nil;
 }
 
 - (NSURLRequest *)willSendRequest:(NSURLRequest *)newRequest redirectResponse:(NSURLResponse *)redirectResponse
     [self release];
 }
 
+- (void)willStopBufferingData:(NSData *)data
+{
+    ASSERT(resourceData == nil);
+    resourceData = [data mutableCopy];
+}
+
 - (void)didFinishLoading
 {
     // If load has been cancelled after finishing (which could happen with a 
                                                                userInfo:[cachedResponse userInfo]
                                                           storagePolicy:NSURLCacheStorageAllowedInMemoryOnly] autorelease];
     }
-    [self saveResourceWithCachedResponse:cachedResponse];
     return cachedResponse;
 }
 
     [self didReceiveData:data lengthReceived:lengthReceived];
 }
 
+- (void)connection:(NSURLConnection *)con willStopBufferingData:(NSData *)data
+{
+    ASSERT(con == connection);
+    [self willStopBufferingData:data];
+}
+
 - (void)connectionDidFinishLoading:(NSURLConnection *)con
 {
     // don't worry about checking connection consistency if this load
index 40f2402de9705a8831dd62fc7f383e13d378426a..452adb868ac9d82f37455a195d305367abb3d4ec 100644 (file)
 }
 
 -(void)_receivedData:(NSData *)data
-{
-    if (!_private->resourceData) {
-        _private->resourceData = [[NSMutableData alloc] init];
-    }
-    ASSERT([_private->resourceData isKindOfClass:[NSMutableData class]]);
-    [_private->resourceData appendData:data];
-    
+{    
     _private->gotFirstByte = YES;
     [self _commitIfReady];
 
 
 - (void)_setData:(NSData *)data
 {
+    ASSERT(_private->resourceData == nil);
     [data retain];
     [_private->resourceData release];
-    _private->resourceData = (NSMutableData *)data;
+    _private->resourceData = data;
 }
 
 - (void)_finishedLoading
 
 - (NSData *)data
 {
-    return _private->resourceData;
+    return _private->resourceData != nil ? _private->resourceData : [_private->mainClient resourceData];
 }
 
 - (id <WebDocumentRepresentation>) representation
index 4588b8c408bd9667c564e2e8d8916b5593aa2bb2..a0ccb6f2b410d47779b0851f5a71265f03cd92f7 100644 (file)
@@ -28,7 +28,7 @@
 @interface WebDataSourcePrivate : NSObject
 {
 @public
-    NSMutableData *resourceData;
+    NSData *resourceData;
 
     id <WebDocumentRepresentation> representation;
     
index 5e8277f62ee2902f8fc31143ac1547b6d87bb97b..4a588bf39cbd72c53f46bd651e1bdfd51a65c5dc 100644 (file)
 - (void)didCancelAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge;
 - (void)didReceiveResponse:(NSURLResponse *)r;
 - (void)didReceiveData:(NSData *)data lengthReceived:(long long)lengthReceived;
+- (void)willStopBufferingData:(NSData *)data;
 - (void)didFinishLoading;
 - (void)didFailWithError:(NSError *)error;
+- (NSCachedURLResponse *)willCacheResponse:(NSCachedURLResponse *)cachedResponse;
 
 @end
 
index 4b9c9045470642fafa39636b9946abada5db99b4..223e00f66a9101d50a30277577cd961a0d66fada 100644 (file)
 #import <WebKit/WebResourcePrivate.h>
 #import <WebKit/WebViewPrivate.h>
 
+static BOOL NSURLConnectionSupportsBufferedData;
+
+@interface NSURLConnection (NSURLConnectionTigerPrivate)
+- (NSData *)_bufferedData;
+@end
+
 @interface WebBaseResourceHandleDelegate (WebNSURLAuthenticationChallengeSender) <NSURLAuthenticationChallengeSender>
 @end
 
 
 @implementation WebBaseResourceHandleDelegate
 
++ (void)initialize
+{
+    NSURLConnectionSupportsBufferedData = [NSURLConnection instancesRespondToSelector:@selector(_bufferedData)];
+}
+
 - (void)releaseResources
 {
     ASSERT(!reachedTerminalState);
 
 - (void)addData:(NSData *)data
 {
-    if (!resource) {
-        if (!resourceData) {
-            resourceData = [[NSMutableData alloc] init];
+    // Don't buffer data if we're loading it from a WebResource.
+    if (resource == nil) {
+        if (NSURLConnectionSupportsBufferedData) {
+            // Buffer data only if the connection has handed us the data because is has stopped buffering it.
+            if (resourceData != nil) {
+                [resourceData appendData:data];
+            }
+        } else {
+            if (resourceData == nil) {
+                resourceData = [[NSMutableData alloc] init];
+            }
+            [resourceData appendData:data];
         }
-        [resourceData appendData:data];
     }
 }
 
 - (void)saveResource
 {
-    if (!resource && [resourceData length] > 0) {
-        WebResource *newResource = [[WebResource alloc] initWithData:resourceData
-                                                                 URL:originalURL
-                                                            MIMEType:[response MIMEType]
-                                                    textEncodingName:[response textEncodingName]
-                                                           frameName:nil];
-        [dataSource addSubresource:newResource];
-        [newResource release];
-    }
-}
-
-- (void)saveResourceWithCachedResponse:(NSCachedURLResponse *)cachedResponse
-{
-    if (!resource) {
-        // Overwrite the resource saved with saveResource with the cache version to save memory.
-        WebResource *newResource = [[WebResource alloc] _initWithCachedResponse:cachedResponse originalURL:originalURL];
-        [dataSource addSubresource:newResource];
-        [newResource release];
+    // Don't save data as a WebResource if it was loaded from a WebResource.
+    if (resource == nil) {
+        NSData *data = [self resourceData];
+        if ([data length] > 0) {
+            // Don't have WebResource copy the data since the data is a NSMutableData that we know won't get modified. 
+            WebResource *newResource = [[WebResource alloc] _initWithData:data
+                                                                      URL:originalURL
+                                                                 MIMEType:[response MIMEType]
+                                                         textEncodingName:[response textEncodingName]
+                                                                frameName:nil
+                                                                 copyData:NO];
+            [dataSource addSubresource:newResource];
+            [newResource release];
+        }
     }
 }
 
 - (NSData *)resourceData
 {
-    return resource ? [resource data] : resourceData;
+    if (resource != nil) {
+        return [resource data];
+    }
+    if (resourceData != nil) {
+        return resourceData;
+    }
+    if (NSURLConnectionSupportsBufferedData) {
+        return [connection _bufferedData];
+    }
+    return nil;
 }
 
 - (NSURLRequest *)willSendRequest:(NSURLRequest *)newRequest redirectResponse:(NSURLResponse *)redirectResponse
     [self release];
 }
 
+- (void)willStopBufferingData:(NSData *)data
+{
+    ASSERT(resourceData == nil);
+    resourceData = [data mutableCopy];
+}
+
 - (void)didFinishLoading
 {
     // If load has been cancelled after finishing (which could happen with a 
                                                                userInfo:[cachedResponse userInfo]
                                                           storagePolicy:NSURLCacheStorageAllowedInMemoryOnly] autorelease];
     }
-    [self saveResourceWithCachedResponse:cachedResponse];
     return cachedResponse;
 }
 
     [self didReceiveData:data lengthReceived:lengthReceived];
 }
 
+- (void)connection:(NSURLConnection *)con willStopBufferingData:(NSData *)data
+{
+    ASSERT(con == connection);
+    [self willStopBufferingData:data];
+}
+
 - (void)connectionDidFinishLoading:(NSURLConnection *)con
 {
     // don't worry about checking connection consistency if this load
index cc70966880e39727e8e8bafefdfbd9cb5fd94a41..91a469c3cba2eebce3aebaf008aa24cf26ed82c7 100644 (file)
     [super finalize];
 }
 
+- (void)releaseResources
+{
+    [dataSource _setData:[self resourceData]];
+    [super releaseResources];
+}
+
 - (void)receivedError:(NSError *)error
 {
     // Calling _receivedMainResourceError will likely result in a call to release, so we must retain.
     // Override. We don't want to save the main resource as a subresource of the data source.
 }
 
-- (void)saveResourceWithCachedResponse:(NSCachedURLResponse *)cachedResponse
-{
-    // Override. We don't want to save the main resource as a subresource of the data source.
-    // Replace the data on the data source with the cache copy to save memory.
-    [dataSource _setData:[cachedResponse data]];
-}
-
 - (NSURLRequest *)connection:(NSURLConnection *)con willSendRequest:(NSURLRequest *)newRequest redirectResponse:(NSURLResponse *)redirectResponse
 {
     // Note that there are no asserts here as there are for the other callbacks. This is due to the
     // 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 _webView] _mainReceivedBytesSoFar:[[dataSource data] length]
+    [[dataSource _webView] _mainReceivedBytesSoFar:_bytesReceived
                                        fromDataSource:dataSource
                                              complete:NO];
-
+    
     [super connection:con didReceiveData:data lengthReceived:lengthReceived];
     _bytesReceived += [data length];
 
     [self retain];
 
     [dataSource _finishedLoading];
-    [[dataSource _webView] _mainReceivedBytesSoFar:[[dataSource data] length]
+    [[dataSource _webView] _mainReceivedBytesSoFar:_bytesReceived
                                     fromDataSource:dataSource
                                             complete:YES];
     [super connectionDidFinishLoading:con];
index cc70966880e39727e8e8bafefdfbd9cb5fd94a41..91a469c3cba2eebce3aebaf008aa24cf26ed82c7 100644 (file)
     [super finalize];
 }
 
+- (void)releaseResources
+{
+    [dataSource _setData:[self resourceData]];
+    [super releaseResources];
+}
+
 - (void)receivedError:(NSError *)error
 {
     // Calling _receivedMainResourceError will likely result in a call to release, so we must retain.
     // Override. We don't want to save the main resource as a subresource of the data source.
 }
 
-- (void)saveResourceWithCachedResponse:(NSCachedURLResponse *)cachedResponse
-{
-    // Override. We don't want to save the main resource as a subresource of the data source.
-    // Replace the data on the data source with the cache copy to save memory.
-    [dataSource _setData:[cachedResponse data]];
-}
-
 - (NSURLRequest *)connection:(NSURLConnection *)con willSendRequest:(NSURLRequest *)newRequest redirectResponse:(NSURLResponse *)redirectResponse
 {
     // Note that there are no asserts here as there are for the other callbacks. This is due to the
     // 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 _webView] _mainReceivedBytesSoFar:[[dataSource data] length]
+    [[dataSource _webView] _mainReceivedBytesSoFar:_bytesReceived
                                        fromDataSource:dataSource
                                              complete:NO];
-
+    
     [super connection:con didReceiveData:data lengthReceived:lengthReceived];
     _bytesReceived += [data length];
 
     [self retain];
 
     [dataSource _finishedLoading];
-    [[dataSource _webView] _mainReceivedBytesSoFar:[[dataSource data] length]
+    [[dataSource _webView] _mainReceivedBytesSoFar:_bytesReceived
                                     fromDataSource:dataSource
                                             complete:YES];
     [super connectionDidFinishLoading:con];
index f2b1d181a5f13e07cc6a96396109e444a8ebd590..285d28a5524e031a6cb98cde62d13b7d61719d2f 100644 (file)
@@ -53,30 +53,7 @@ NSString *WebResourceTextEncodingNameKey =  @"WebResourceTextEncodingName";
 
 - (id)initWithData:(NSData *)data URL:(NSURL *)URL MIMEType:(NSString *)MIMEType textEncodingName:(NSString *)textEncodingName frameName:(NSString *)frameName
 {
-    [self init];    
-    
-    if (!data) {
-        [self release];
-        return nil;
-    }
-    _private->data = [data copy];
-    
-    if (!URL) {
-        [self release];
-        return nil;
-    }
-    _private->URL = [URL copy];
-    
-    if (!MIMEType) {
-        [self release];
-        return nil;
-    }
-    _private->MIMEType = [MIMEType copy];
-    
-    _private->textEncodingName = [textEncodingName copy];
-    _private->frameName = [frameName copy];
-    
-    return self;
+    return [self _initWithData:data URL:URL MIMEType:MIMEType textEncodingName:textEncodingName frameName:frameName copyData:YES];
 }
 
 - (id)initWithCoder:(NSCoder *)decoder
@@ -178,6 +155,34 @@ NSString *WebResourceTextEncodingNameKey =  @"WebResourceTextEncodingName";
     return propertyLists;
 }
 
+- (id)_initWithData:(NSData *)data URL:(NSURL *)URL MIMEType:(NSString *)MIMEType textEncodingName:(NSString *)textEncodingName frameName:(NSString *)frameName copyData:(BOOL)copyData
+{
+    [self init];    
+    
+    if (!data) {
+        [self release];
+        return nil;
+    }
+    _private->data = copyData ? [data copy] : [data retain];
+    
+    if (!URL) {
+        [self release];
+        return nil;
+    }
+    _private->URL = [URL copy];
+    
+    if (!MIMEType) {
+        [self release];
+        return nil;
+    }
+    _private->MIMEType = [MIMEType copy];
+    
+    _private->textEncodingName = [textEncodingName copy];
+    _private->frameName = [frameName copy];
+    
+    return self;
+}
+
 - (id)_initWithPropertyList:(id)propertyList
 {
     if (![propertyList isKindOfClass:[NSDictionary class]]) {
@@ -193,16 +198,6 @@ NSString *WebResourceTextEncodingNameKey =  @"WebResourceTextEncodingName";
                     frameName:[propertyList _web_stringForKey:WebResourceFrameNameKey]];
 }
 
-- (id)_initWithCachedResponse:(NSCachedURLResponse *)cachedResponse originalURL:(NSURL *)originalURL
-{
-    NSURLResponse *response = [cachedResponse response];
-    return [self initWithData:[cachedResponse data]
-                          URL:originalURL
-                     MIMEType:[response MIMEType]
-             textEncodingName:[response textEncodingName]
-                    frameName:nil];
-}
-
 - (NSFileWrapper *)_fileWrapperRepresentation
 {
     NSFileWrapper *wrapper = [[[NSFileWrapper alloc] initRegularFileWithContents:_private->data] autorelease];
index ca02b149adda70aaef0f7fcd987959b645a59a08..f2df9576984ab81a7cd7ea463e648adf159b453d 100644 (file)
@@ -9,11 +9,12 @@
 
 @interface WebResource (WebResourcePrivate)
 
+- (id)_initWithData:(NSData *)data URL:(NSURL *)URL MIMEType:(NSString *)MIMEType textEncodingName:(NSString *)textEncodingName frameName:(NSString *)frameName copyData:(BOOL)copyData;
+
 + (NSArray *)_resourcesFromPropertyLists:(NSArray *)propertyLists;
 + (NSArray *)_propertyListsFromResources:(NSArray *)resources;
 
 - (id)_initWithPropertyList:(id)propertyList;
-- (id)_initWithCachedResponse:(NSCachedURLResponse *)response originalURL:(NSURL *)originalURL;
 
 - (NSFileWrapper *)_fileWrapperRepresentation;
 - (id)_propertyListRepresentation;