[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677
cblu
cblu at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 08:27:58 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit 06ce262756551a79848f0b9f89c3b1603141b046
Author: cblu <cblu at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Mon Mar 1 22:22:41 2004 +0000
- Made WebResource loading not use Foundation at all. This allows "Mail Page" and paste to more directly load subresources without any indirection involving NSURLConnection and the Foundation cache.
- Made WebIconLoader a subclass of WebBaseResourceHandleDelegate. This makes favicons appear in the activity window among other things.
Reviewed by kocienda.
* Misc.subproj/WebIconLoader.h:
* Misc.subproj/WebIconLoader.m: removed connection and data ivars since WebBaseResourceHandleDelegate holds these
(-[WebIconLoaderPrivate dealloc]): removed calls to deleted ivars
(-[WebIconLoader URL]): call renamed request ivar
(-[WebIconLoader startLoading]): call loadWithRequest
(-[WebIconLoader stopLoading]): call cancel
(-[WebIconLoader didFinishLoading]):
* Plugins.subproj/WebNetscapePluginStream.m:
(-[WebNetscapePluginConnectionDelegate didReceiveResponse:]): renamed to be connection-less since callbacks may came from a WebResource and not an NSURLConnection
(-[WebNetscapePluginConnectionDelegate didReceiveData:lengthReceived:]): ditto
(-[WebNetscapePluginConnectionDelegate didFinishLoading]): ditto
(-[WebNetscapePluginConnectionDelegate didFailWithError:]): ditto
* WebCoreSupport.subproj/WebSubresourceClient.m:
(-[WebSubresourceClient didReceiveResponse:]): ditto
(-[WebSubresourceClient didReceiveData:lengthReceived:]): ditto
(-[WebSubresourceClient didFinishLoading]): ditto
(-[WebSubresourceClient didFailWithError:]): ditto
* WebKit.pbproj/project.pbxproj:
* WebView.subproj/WebBaseResourceHandleDelegate.h:
* WebView.subproj/WebBaseResourceHandleDelegate.m:
(-[WebBaseResourceHandleDelegate loadWithRequest:]): instead of storing the resource in the Foundation cache in order to later load it from the cache, deliver the callbacks ourselves after a delay
(-[WebBaseResourceHandleDelegate setDefersCallbacks:]): call deliverResource if callbacks are turned back on
(-[WebBaseResourceHandleDelegate deliverResource]): new, calls didReceiveResponse:, didReceiveData:lengthReceived:, and didFinishLoading
(-[WebBaseResourceHandleDelegate willSendRequest:redirectResponse:]): renamed to be connection-less since callbacks may came from a WebResource and not an NSURLConnection
(-[WebBaseResourceHandleDelegate didReceiveAuthenticationChallenge:]): ditto
(-[WebBaseResourceHandleDelegate didCancelAuthenticationChallenge:]): ditto
(-[WebBaseResourceHandleDelegate didReceiveResponse:]): ditto
(-[WebBaseResourceHandleDelegate didReceiveData:lengthReceived:]): ditto
(-[WebBaseResourceHandleDelegate didFinishLoading]): ditto
(-[WebBaseResourceHandleDelegate didFailWithError:]): ditto
(-[WebBaseResourceHandleDelegate willCacheResponse:]): ditto
(-[WebBaseResourceHandleDelegate connection:willSendRequest:redirectResponse:]): calls connection-less version of this method
(-[WebBaseResourceHandleDelegate connection:didReceiveAuthenticationChallenge:]): ditto
(-[WebBaseResourceHandleDelegate connection:didCancelAuthenticationChallenge:]): ditto
(-[WebBaseResourceHandleDelegate connection:didReceiveResponse:]): ditto
(-[WebBaseResourceHandleDelegate connection:didReceiveData:lengthReceived:]): ditto
(-[WebBaseResourceHandleDelegate connectionDidFinishLoading:]): ditto
(-[WebBaseResourceHandleDelegate connection:didFailWithError:]): ditto
(-[WebBaseResourceHandleDelegate connection:willCacheResponse:]): ditto
(-[WebBaseResourceHandleDelegate cancelWithError:]): call renamed _completeProgressForConnectionDelegate on WebView
(-[WebBaseResourceHandleDelegate cancelledError]): tweak
* WebView.subproj/WebDataSource.m:
(-[WebDataSource _loadIcon]): set the data source on the icon loader so it can callback
* WebView.subproj/WebResource.m:
(-[WebResource _response]): new, factored out from _cachedResponseRepresentation
(-[WebResource _cachedResponseRepresentation]): call _response
* WebView.subproj/WebResourcePrivate.h:
* WebView.subproj/WebView.m:
(-[WebView _incrementProgressForConnectionDelegate:response:]): renamed to be connection-less
(-[WebView _incrementProgressForConnectionDelegate:data:]): ditto
(-[WebView _completeProgressForConnectionDelegate:]): ditto
* WebView.subproj/WebViewPrivate.h:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@6139 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 2f7c76f..1d08865 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,63 @@
+2004-03-01 Chris Blumenberg <cblu at apple.com>
+
+ - Made WebResource loading not use Foundation at all. This allows "Mail Page" and paste to more directly load subresources without any indirection involving NSURLConnection and the Foundation cache.
+ - Made WebIconLoader a subclass of WebBaseResourceHandleDelegate. This makes favicons appear in the activity window among other things.
+
+ Reviewed by kocienda.
+
+ * Misc.subproj/WebIconLoader.h:
+ * Misc.subproj/WebIconLoader.m: removed connection and data ivars since WebBaseResourceHandleDelegate holds these
+ (-[WebIconLoaderPrivate dealloc]): removed calls to deleted ivars
+ (-[WebIconLoader URL]): call renamed request ivar
+ (-[WebIconLoader startLoading]): call loadWithRequest
+ (-[WebIconLoader stopLoading]): call cancel
+ (-[WebIconLoader didFinishLoading]):
+ * Plugins.subproj/WebNetscapePluginStream.m:
+ (-[WebNetscapePluginConnectionDelegate didReceiveResponse:]): renamed to be connection-less since callbacks may came from a WebResource and not an NSURLConnection
+ (-[WebNetscapePluginConnectionDelegate didReceiveData:lengthReceived:]): ditto
+ (-[WebNetscapePluginConnectionDelegate didFinishLoading]): ditto
+ (-[WebNetscapePluginConnectionDelegate didFailWithError:]): ditto
+ * WebCoreSupport.subproj/WebSubresourceClient.m:
+ (-[WebSubresourceClient didReceiveResponse:]): ditto
+ (-[WebSubresourceClient didReceiveData:lengthReceived:]): ditto
+ (-[WebSubresourceClient didFinishLoading]): ditto
+ (-[WebSubresourceClient didFailWithError:]): ditto
+ * WebKit.pbproj/project.pbxproj:
+ * WebView.subproj/WebBaseResourceHandleDelegate.h:
+ * WebView.subproj/WebBaseResourceHandleDelegate.m:
+ (-[WebBaseResourceHandleDelegate loadWithRequest:]): instead of storing the resource in the Foundation cache in order to later load it from the cache, deliver the callbacks ourselves after a delay
+ (-[WebBaseResourceHandleDelegate setDefersCallbacks:]): call deliverResource if callbacks are turned back on
+ (-[WebBaseResourceHandleDelegate deliverResource]): new, calls didReceiveResponse:, didReceiveData:lengthReceived:, and didFinishLoading
+ (-[WebBaseResourceHandleDelegate willSendRequest:redirectResponse:]): renamed to be connection-less since callbacks may came from a WebResource and not an NSURLConnection
+ (-[WebBaseResourceHandleDelegate didReceiveAuthenticationChallenge:]): ditto
+ (-[WebBaseResourceHandleDelegate didCancelAuthenticationChallenge:]): ditto
+ (-[WebBaseResourceHandleDelegate didReceiveResponse:]): ditto
+ (-[WebBaseResourceHandleDelegate didReceiveData:lengthReceived:]): ditto
+ (-[WebBaseResourceHandleDelegate didFinishLoading]): ditto
+ (-[WebBaseResourceHandleDelegate didFailWithError:]): ditto
+ (-[WebBaseResourceHandleDelegate willCacheResponse:]): ditto
+ (-[WebBaseResourceHandleDelegate connection:willSendRequest:redirectResponse:]): calls connection-less version of this method
+ (-[WebBaseResourceHandleDelegate connection:didReceiveAuthenticationChallenge:]): ditto
+ (-[WebBaseResourceHandleDelegate connection:didCancelAuthenticationChallenge:]): ditto
+ (-[WebBaseResourceHandleDelegate connection:didReceiveResponse:]): ditto
+ (-[WebBaseResourceHandleDelegate connection:didReceiveData:lengthReceived:]): ditto
+ (-[WebBaseResourceHandleDelegate connectionDidFinishLoading:]): ditto
+ (-[WebBaseResourceHandleDelegate connection:didFailWithError:]): ditto
+ (-[WebBaseResourceHandleDelegate connection:willCacheResponse:]): ditto
+ (-[WebBaseResourceHandleDelegate cancelWithError:]): call renamed _completeProgressForConnectionDelegate on WebView
+ (-[WebBaseResourceHandleDelegate cancelledError]): tweak
+ * WebView.subproj/WebDataSource.m:
+ (-[WebDataSource _loadIcon]): set the data source on the icon loader so it can callback
+ * WebView.subproj/WebResource.m:
+ (-[WebResource _response]): new, factored out from _cachedResponseRepresentation
+ (-[WebResource _cachedResponseRepresentation]): call _response
+ * WebView.subproj/WebResourcePrivate.h:
+ * WebView.subproj/WebView.m:
+ (-[WebView _incrementProgressForConnectionDelegate:response:]): renamed to be connection-less
+ (-[WebView _incrementProgressForConnectionDelegate:data:]): ditto
+ (-[WebView _completeProgressForConnectionDelegate:]): ditto
+ * WebView.subproj/WebViewPrivate.h:
+
2004-03-01 Ken Kocienda <kocienda at apple.com>
Reviewed by Darin
diff --git a/WebKit/Misc.subproj/WebIconLoader.h b/WebKit/Misc.subproj/WebIconLoader.h
index da9d8a2..7f1a2dd 100644
--- a/WebKit/Misc.subproj/WebIconLoader.h
+++ b/WebKit/Misc.subproj/WebIconLoader.h
@@ -1,17 +1,16 @@
/*
WebIconLoader.h
- Copyright 2002, Apple, Inc. All rights reserved.
+ Copyright 2004, Apple, Inc. All rights reserved.
*/
-#import <Cocoa/Cocoa.h>
+#import <WebKit/WebBaseResourceHandleDelegate.h>
- at class NSURLRequest;
@class WebIconLoaderPrivate;
/*!
@class WebIconLoader
*/
- at interface WebIconLoader : NSObject
+ at interface WebIconLoader : WebBaseResourceHandleDelegate
{
WebIconLoaderPrivate *_private;
}
diff --git a/WebKit/Misc.subproj/WebIconLoader.m b/WebKit/Misc.subproj/WebIconLoader.m
index 8dad29a..ab62441 100644
--- a/WebKit/Misc.subproj/WebIconLoader.m
+++ b/WebKit/Misc.subproj/WebIconLoader.m
@@ -12,20 +12,13 @@
#import <WebKit/WebIconDatabasePrivate.h>
#import <WebKit/WebNSURLExtras.h>
-#import <Foundation/NSURLConnection.h>
-#import <Foundation/NSURLRequest.h>
-#import <Foundation/NSURLRequestPrivate.h>
-
-
#define WebIconLoaderWeeksWorthOfSeconds (60 * 60 * 24 * 7)
@interface WebIconLoaderPrivate : NSObject
{
@public
- NSURLConnection *handle;
id delegate;
- NSURLRequest *request;
- NSMutableData *resourceData;
+ NSURLRequest *initialRequest;
}
@end;
@@ -34,9 +27,7 @@
- (void)dealloc
{
- [request release];
- [handle release];
- [resourceData release];
+ [initialRequest release];
[super dealloc];
}
@@ -44,12 +35,11 @@
@implementation WebIconLoader
-- (id)initWithRequest:(NSURLRequest *)request;
+- (id)initWithRequest:(NSURLRequest *)initialRequest;
{
[super init];
_private = [[WebIconLoaderPrivate alloc] init];
- _private->request = [request retain];
- _private->resourceData = [[NSMutableData alloc] init];
+ _private->initialRequest = [initialRequest copy];
return self;
}
@@ -61,7 +51,7 @@
- (NSURL *)URL
{
- return [_private->request URL];
+ return [_private->initialRequest URL];
}
- (id)delegate
@@ -76,40 +66,34 @@
- (void)startLoading
{
- if (_private->handle != nil) {
- return;
- }
-
- _private->handle = [[NSURLConnection alloc] initWithRequest:_private->request delegate:self];
+ [self loadWithRequest:_private->initialRequest];
}
- (void)stopLoading
{
- [_private->handle cancel];
- [_private->handle release];
- _private->handle = nil;
-}
-
-- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data
-{
- [_private->resourceData appendData:data];
+ [self cancel];
}
-- (void)connectionDidFinishLoading:(NSURLConnection *)connection
+- (void)didFinishLoading
{
- NSImage *icon;
+ NSImage *icon = nil;
NS_DURING
- icon = [[NSImage alloc] initWithData:_private->resourceData];
+ NSData *data = [self resourceData];
+ if ([data length] > 0) {
+ icon = [[NSImage alloc] initWithData:data];
+ }
NS_HANDLER
icon = nil;
NS_ENDHANDLER
- if (icon && [[icon representations] count]) {
+ if ([[icon representations] count] > 0) {
[[WebIconDatabase sharedIconDatabase] _setIcon:icon forIconURL:[[self URL] _web_originalDataAsString]];
} else {
- [[WebIconDatabase sharedIconDatabase] _setHaveNoIconForIconURL:[[self URL] _web_originalDataAsString]];
+ [[WebIconDatabase sharedIconDatabase] _setHaveNoIconForIconURL:[[self URL] _web_originalDataAsString]];
}
[_private->delegate _iconLoaderReceivedPageIcon:self];
[icon release];
+
+ [super didFinishLoading];
}
@end
diff --git a/WebKit/Plugins.subproj/WebNetscapePluginStream.m b/WebKit/Plugins.subproj/WebNetscapePluginStream.m
index 74b5ebe..dc99e7e 100644
--- a/WebKit/Plugins.subproj/WebNetscapePluginStream.m
+++ b/WebKit/Plugins.subproj/WebNetscapePluginStream.m
@@ -104,7 +104,7 @@
[super releaseResources];
}
-- (void)connection:(NSURLConnection *)con didReceiveResponse:(NSURLResponse *)theResponse
+- (void)didReceiveResponse:(NSURLResponse *)theResponse
{
// retain/release self in this delegate method since the additional processing can do
// anything including possibly releasing self; one example of this is 3266216
@@ -113,7 +113,7 @@
// Don't continue if the stream is cancelled in startStreamWithResponse or didReceiveResponse.
if (stream) {
- [super connection:con didReceiveResponse:theResponse];
+ [super didReceiveResponse:theResponse];
if (stream) {
if ([theResponse isKindOfClass:[NSHTTPURLResponse class]] &&
[NSHTTPURLResponse isErrorStatusCode:[(NSHTTPURLResponse *)theResponse statusCode]]) {
@@ -128,17 +128,17 @@
[self release];
}
-- (void)connection:(NSURLConnection *)con didReceiveData:(NSData *)data lengthReceived:(long long)lengthReceived
+- (void)didReceiveData:(NSData *)data lengthReceived:(long long)lengthReceived
{
// 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];
[stream receivedData:data];
- [super connection:con didReceiveData:data lengthReceived:lengthReceived];
+ [super didReceiveData:data lengthReceived:lengthReceived];
[self release];
}
-- (void)connectionDidFinishLoading:(NSURLConnection *)con
+- (void)didFinishLoading
{
// Calling _removePlugInStreamClient will likely result in a call to release, so we must retain.
[self retain];
@@ -146,12 +146,12 @@
[[self dataSource] _removePlugInStreamClient:self];
[[view webView] _finishedLoadingResourceFromDataSource:[self dataSource]];
[stream finishedLoadingWithData:[self resourceData]];
- [super connectionDidFinishLoading:con];
+ [super didFinishLoading];
[self release];
}
-- (void)connection:(NSURLConnection *)con didFailWithError:(NSError *)error
+- (void)didFailWithError:(NSError *)error
{
// Calling _removePlugInStreamClient will likely result in a call to release, so we must retain.
// The other additional processing can do anything including possibly releasing self;
@@ -161,7 +161,7 @@
[[self dataSource] _removePlugInStreamClient:self];
[[view webView] _receivedError:error fromDataSource:[self dataSource]];
[stream receivedError:error];
- [super connection:con didFailWithError:error];
+ [super didFailWithError:error];
[self release];
}
diff --git a/WebKit/WebCoreSupport.subproj/WebSubresourceClient.m b/WebKit/WebCoreSupport.subproj/WebSubresourceClient.m
index 3073b6a..20abeaf 100644
--- a/WebKit/WebCoreSupport.subproj/WebSubresourceClient.m
+++ b/WebKit/WebCoreSupport.subproj/WebSubresourceClient.m
@@ -5,18 +5,16 @@
#import <WebKit/WebSubresourceClient.h>
+#import <WebKit/WebAssertions.h>
#import <WebKit/WebBridge.h>
#import <WebKit/WebDataSourcePrivate.h>
#import <WebKit/WebFrame.h>
#import <WebKit/WebKitErrorsPrivate.h>
#import <WebKit/WebViewPrivate.h>
-#import <Foundation/NSURLConnection.h>
-#import <Foundation/NSURLRequest.h>
+#import <Foundation/NSError_NSURLExtras.h>
#import <Foundation/NSURLRequestPrivate.h>
#import <Foundation/NSURLResponse.h>
-#import <WebKit/WebAssertions.h>
-#import <Foundation/NSError_NSURLExtras.h>
#import <WebCore/WebCoreResourceLoader.h>
@@ -122,10 +120,10 @@
[[dataSource _webView] _receivedError:error fromDataSource:dataSource];
}
-- (NSURLRequest *)connection:(NSURLConnection *)con willSendRequest:(NSURLRequest *)newRequest redirectResponse:(NSURLResponse *)redirectResponse
+- (NSURLRequest *)willSendRequest:(NSURLRequest *)newRequest redirectResponse:(NSURLResponse *)redirectResponse;
{
NSURL *oldURL = [request URL];
- NSURLRequest *clientRequest = [super connection:con willSendRequest:newRequest redirectResponse:redirectResponse];
+ NSURLRequest *clientRequest = [super willSendRequest:newRequest redirectResponse:redirectResponse];
if (![oldURL isEqual:[clientRequest URL]]) {
[loader redirectedToURL:[clientRequest URL]];
@@ -134,28 +132,28 @@
return clientRequest;
}
-- (void)connection:(NSURLConnection *)con didReceiveResponse:(NSURLResponse *)r
+- (void)didReceiveResponse:(NSURLResponse *)r
{
ASSERT(r);
// 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];
[loader receivedResponse:r];
- [super connection:con didReceiveResponse:r];
+ [super didReceiveResponse:r];
[self release];
}
-- (void)connection:(NSURLConnection *)con didReceiveData:(NSData *)data lengthReceived:(long long)lengthReceived
+- (void)didReceiveData:(NSData *)data lengthReceived:(long long)lengthReceived
{
// 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];
[loader addData:data];
- [super connection:con didReceiveData:data lengthReceived:lengthReceived];
+ [super didReceiveData:data lengthReceived:lengthReceived];
[self release];
}
-- (void)connectionDidFinishLoading:(NSURLConnection *)con
+- (void)didFinishLoading
{
// Calling _removeSubresourceClient will likely result in a call to release, so we must retain.
[self retain];
@@ -166,12 +164,12 @@
[[dataSource _webView] _finishedLoadingResourceFromDataSource:dataSource];
- [super connectionDidFinishLoading:con];
+ [super didFinishLoading];
[self release];
}
-- (void)connection:(NSURLConnection *)con didFailWithError:(NSError *)error
+- (void)didFailWithError:(NSError *)error
{
// Calling _removeSubresourceClient will likely result in a call to release, so we must retain.
[self retain];
@@ -179,7 +177,7 @@
[loader reportError];
[dataSource _removeSubresourceClient:self];
[self receivedError:error];
- [super connection:con didFailWithError:error];
+ [super didFailWithError:error];
[self release];
}
diff --git a/WebKit/WebCoreSupport.subproj/WebSubresourceLoader.m b/WebKit/WebCoreSupport.subproj/WebSubresourceLoader.m
index 3073b6a..20abeaf 100644
--- a/WebKit/WebCoreSupport.subproj/WebSubresourceLoader.m
+++ b/WebKit/WebCoreSupport.subproj/WebSubresourceLoader.m
@@ -5,18 +5,16 @@
#import <WebKit/WebSubresourceClient.h>
+#import <WebKit/WebAssertions.h>
#import <WebKit/WebBridge.h>
#import <WebKit/WebDataSourcePrivate.h>
#import <WebKit/WebFrame.h>
#import <WebKit/WebKitErrorsPrivate.h>
#import <WebKit/WebViewPrivate.h>
-#import <Foundation/NSURLConnection.h>
-#import <Foundation/NSURLRequest.h>
+#import <Foundation/NSError_NSURLExtras.h>
#import <Foundation/NSURLRequestPrivate.h>
#import <Foundation/NSURLResponse.h>
-#import <WebKit/WebAssertions.h>
-#import <Foundation/NSError_NSURLExtras.h>
#import <WebCore/WebCoreResourceLoader.h>
@@ -122,10 +120,10 @@
[[dataSource _webView] _receivedError:error fromDataSource:dataSource];
}
-- (NSURLRequest *)connection:(NSURLConnection *)con willSendRequest:(NSURLRequest *)newRequest redirectResponse:(NSURLResponse *)redirectResponse
+- (NSURLRequest *)willSendRequest:(NSURLRequest *)newRequest redirectResponse:(NSURLResponse *)redirectResponse;
{
NSURL *oldURL = [request URL];
- NSURLRequest *clientRequest = [super connection:con willSendRequest:newRequest redirectResponse:redirectResponse];
+ NSURLRequest *clientRequest = [super willSendRequest:newRequest redirectResponse:redirectResponse];
if (![oldURL isEqual:[clientRequest URL]]) {
[loader redirectedToURL:[clientRequest URL]];
@@ -134,28 +132,28 @@
return clientRequest;
}
-- (void)connection:(NSURLConnection *)con didReceiveResponse:(NSURLResponse *)r
+- (void)didReceiveResponse:(NSURLResponse *)r
{
ASSERT(r);
// 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];
[loader receivedResponse:r];
- [super connection:con didReceiveResponse:r];
+ [super didReceiveResponse:r];
[self release];
}
-- (void)connection:(NSURLConnection *)con didReceiveData:(NSData *)data lengthReceived:(long long)lengthReceived
+- (void)didReceiveData:(NSData *)data lengthReceived:(long long)lengthReceived
{
// 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];
[loader addData:data];
- [super connection:con didReceiveData:data lengthReceived:lengthReceived];
+ [super didReceiveData:data lengthReceived:lengthReceived];
[self release];
}
-- (void)connectionDidFinishLoading:(NSURLConnection *)con
+- (void)didFinishLoading
{
// Calling _removeSubresourceClient will likely result in a call to release, so we must retain.
[self retain];
@@ -166,12 +164,12 @@
[[dataSource _webView] _finishedLoadingResourceFromDataSource:dataSource];
- [super connectionDidFinishLoading:con];
+ [super didFinishLoading];
[self release];
}
-- (void)connection:(NSURLConnection *)con didFailWithError:(NSError *)error
+- (void)didFailWithError:(NSError *)error
{
// Calling _removeSubresourceClient will likely result in a call to release, so we must retain.
[self retain];
@@ -179,7 +177,7 @@
[loader reportError];
[dataSource _removeSubresourceClient:self];
[self receivedError:error];
- [super connection:con didFailWithError:error];
+ [super didFailWithError:error];
[self release];
}
diff --git a/WebKit/WebKit.pbproj/project.pbxproj b/WebKit/WebKit.pbproj/project.pbxproj
index 76702fa..033b120 100644
--- a/WebKit/WebKit.pbproj/project.pbxproj
+++ b/WebKit/WebKit.pbproj/project.pbxproj
@@ -557,8 +557,8 @@
ED2B2475033A2DA800C1A526,
EDD1A5C605C83987008E3150,
EDD1A5C705C83987008E3150,
- BE6DC39904C62C4E004D0EF6,
BE6DC39A04C62C4E004D0EF6,
+ BE6DC39904C62C4E004D0EF6,
F508946902B71D59018A9CD4,
F508946A02B71D59018A9CD4,
9345DDAE0365FB27008635CE,
@@ -3704,7 +3704,6 @@
isa = PBXBuildFile;
settings = {
ATTRIBUTES = (
- Private,
);
};
};
diff --git a/WebKit/WebView.subproj/WebBaseResourceHandleDelegate.h b/WebKit/WebView.subproj/WebBaseResourceHandleDelegate.h
index a54f024..de1d573 100644
--- a/WebKit/WebView.subproj/WebBaseResourceHandleDelegate.h
+++ b/WebKit/WebView.subproj/WebBaseResourceHandleDelegate.h
@@ -35,10 +35,11 @@
BOOL cancelledFlag;
BOOL reachedTerminalState;
BOOL defersCallbacks;
+ BOOL waitingToDeliverResource;
WebResourceDelegateImplementationCache implementations;
NSURL *originalURL;
- WebResource *resource;
NSMutableData *resourceData;
+ WebResource *resource;
}
- (BOOL)loadWithRequest:(NSURLRequest *)request;
@@ -64,6 +65,15 @@
- (NSData *)resourceData;
+// Connection-less callbacks allow us to send callbacks using data attained from a WebResource instead of an NSURLConnection.
+- (NSURLRequest *)willSendRequest:(NSURLRequest *)newRequest redirectResponse:(NSURLResponse *)redirectResponse;
+- (void)didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge;
+- (void)didCancelAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge;
+- (void)didReceiveResponse:(NSURLResponse *)r;
+- (void)didReceiveData:(NSData *)data lengthReceived:(long long)lengthReceived;
+- (void)didFinishLoading;
+- (void)didFailWithError:(NSError *)error;
+
@end
// Note: This interface can be removed once this method is declared
diff --git a/WebKit/WebView.subproj/WebBaseResourceHandleDelegate.m b/WebKit/WebView.subproj/WebBaseResourceHandleDelegate.m
index 9aa8ef9..06a1d6d 100644
--- a/WebKit/WebView.subproj/WebBaseResourceHandleDelegate.m
+++ b/WebKit/WebView.subproj/WebBaseResourceHandleDelegate.m
@@ -121,6 +121,20 @@
[super dealloc];
}
+- (void)deliverResource
+{
+ ASSERT(resource);
+ ASSERT(waitingToDeliverResource);
+
+ if (!defersCallbacks) {
+ [self didReceiveResponse:[resource _response]];
+ NSData *data = [resource data];
+ [self didReceiveData:data lengthReceived:[data length]];
+ [self didFinishLoading];
+ waitingToDeliverResource = NO;
+ }
+}
+
- (BOOL)loadWithRequest:(NSURLRequest *)r
{
ASSERT(connection == nil);
@@ -135,12 +149,16 @@
if ([[r URL] isEqual:originalURL]) {
resource = [dataSource subresourceForURL:originalURL];
if (resource) {
- // FIXME: This is a hack to make Foundation hand us back the data that we're caching. We need something more direct.
[resource retain];
- [[NSURLCache sharedURLCache] storeCachedResponse:[resource _cachedResponseRepresentation] forRequest:r];
+ waitingToDeliverResource = YES;
+ if (!defersCallbacks) {
+ // Deliver the resource after a delay because callers don't expect to receive callbacks while calling this method.
+ [self performSelector:@selector(deliverResource) withObject:nil afterDelay:0];
+ }
+ return YES;
}
}
-
+
connection = [[NSURLConnection alloc] initWithRequest:r delegate:self];
if (defersCallbacks) {
[connection setDefersCallbacks:YES];
@@ -153,6 +171,9 @@
{
defersCallbacks = defers;
[connection setDefersCallbacks:defers];
+ if (!defersCallbacks && waitingToDeliverResource) {
+ [self deliverResource];
+ }
}
- (BOOL)defersCallbacks
@@ -234,9 +255,8 @@
return resource ? [resource data] : resourceData;
}
-- (NSURLRequest *)connection:(NSURLConnection *)con willSendRequest:(NSURLRequest *)newRequest redirectResponse:(NSURLResponse *)redirectResponse
+- (NSURLRequest *)willSendRequest:(NSURLRequest *)newRequest redirectResponse:(NSURLResponse *)redirectResponse
{
- ASSERT(con == connection);
ASSERT(!reachedTerminalState);
NSMutableURLRequest *mutableRequest = [newRequest mutableCopy];
NSURLRequest *clientRequest, *updatedRequest;
@@ -295,11 +315,9 @@
return request;
}
-- (void)connection:(NSURLConnection *)con didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge
+- (void)didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge
{
- ASSERT(con == connection);
ASSERT(!reachedTerminalState);
-
ASSERT(!currentConnectionChallenge);
ASSERT(!currentWebChallenge);
@@ -317,11 +335,9 @@
[self release];
}
--(void)connection:(NSURLConnection *)con didCancelAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge
+- (void)didCancelAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge
{
- ASSERT(con == connection);
ASSERT(!reachedTerminalState);
-
ASSERT(currentConnectionChallenge);
ASSERT(currentWebChallenge);
ASSERT(currentConnectionChallenge = challenge);
@@ -337,9 +353,8 @@
[self release];
}
-- (void)connection:(NSURLConnection *)con didReceiveResponse:(NSURLResponse *)r
+- (void)didReceiveResponse:(NSURLResponse *)r
{
- ASSERT(con == connection);
ASSERT(!reachedTerminalState);
// retain/release self in this delegate method since the additional processing can do
@@ -362,7 +377,7 @@
[dataSource _addResponse: r];
- [webView _incrementProgressForConnection:con response:r];
+ [webView _incrementProgressForConnectionDelegate:self response:r];
if (implementations.delegateImplementsDidReceiveResponse)
[resourceLoadDelegate webView:webView resource:identifier didReceiveResponse:r fromDataSource:dataSource];
@@ -371,12 +386,7 @@
[self release];
}
-- (void)connection:(NSURLConnection *)con didReceiveData:(NSData *)data
-{
- [self connection:con didReceiveData:data lengthReceived:[data length]];
-}
-
-- (void)connection:(NSURLConnection *)con didReceiveData:(NSData *)data lengthReceived:(long long)lengthReceived
+- (void)didReceiveData:(NSData *)data lengthReceived:(long long)lengthReceived
{
// The following assertions are not quite valid here, since a subclass
// might override didReceiveData: in a way that invalidates them. This
@@ -390,7 +400,7 @@
[self addData:data];
- [webView _incrementProgressForConnection:con data:data];
+ [webView _incrementProgressForConnectionDelegate:self data:data];
if (implementations.delegateImplementsDidReceiveContentLength)
[resourceLoadDelegate webView:webView resource:identifier didReceiveContentLength:lengthReceived fromDataSource:dataSource];
@@ -399,7 +409,7 @@
[self release];
}
-- (void)connectionDidFinishLoading:(NSURLConnection *)con
+- (void)didFinishLoading
{
// If load has been cancelled after finishing (which could happen with a
// javascript that changes the window location), do nothing.
@@ -407,12 +417,11 @@
return;
}
- ASSERT(con == connection);
ASSERT(!reachedTerminalState);
[self saveResource];
- [webView _completeProgressForConnection:con];
+ [webView _completeProgressForConnectionDelegate:self];
if (implementations.delegateImplementsDidFinishLoadingFromDataSource)
[resourceLoadDelegate webView:webView resource:identifier didFinishLoadingFromDataSource:dataSource];
@@ -422,28 +431,75 @@
[self releaseResources];
}
-- (void)connection:(NSURLConnection *)con didFailWithError:(NSError *)result
+- (void)didFailWithError:(NSError *)error
{
- ASSERT(con == connection);
ASSERT(!reachedTerminalState);
// 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];
- [webView _completeProgressForConnection:con];
+ [webView _completeProgressForConnectionDelegate:self];
- [[webView _resourceLoadDelegateForwarder] webView:webView resource:identifier didFailLoadingWithError:result fromDataSource:dataSource];
+ [[webView _resourceLoadDelegateForwarder] webView:webView resource:identifier didFailLoadingWithError:error fromDataSource:dataSource];
[self releaseResources];
[self release];
}
-- (NSCachedURLResponse *)connection:(NSURLConnection *)connection willCacheResponse:(NSCachedURLResponse *)cachedResponse
+- (NSCachedURLResponse *)willCacheResponse:(NSCachedURLResponse *)cachedResponse
{
[self saveResourceWithCachedResponse:cachedResponse];
return cachedResponse;
}
+- (NSURLRequest *)connection:(NSURLConnection *)con willSendRequest:(NSURLRequest *)newRequest redirectResponse:(NSURLResponse *)redirectResponse
+{
+ ASSERT(con == connection);
+ return [self willSendRequest:newRequest redirectResponse:redirectResponse];
+}
+
+- (void)connection:(NSURLConnection *)con didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge
+{
+ ASSERT(con == connection);
+ [self didReceiveAuthenticationChallenge:challenge];
+}
+
+- (void)connection:(NSURLConnection *)con didCancelAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge
+{
+ ASSERT(con == connection);
+ [self didCancelAuthenticationChallenge:challenge];
+}
+
+- (void)connection:(NSURLConnection *)con didReceiveResponse:(NSURLResponse *)r
+{
+ ASSERT(con == connection);
+ [self didReceiveResponse:r];
+}
+
+- (void)connection:(NSURLConnection *)con didReceiveData:(NSData *)data lengthReceived:(long long)lengthReceived
+{
+ ASSERT(con == connection);
+ [self didReceiveData:data lengthReceived:lengthReceived];
+}
+
+- (void)connectionDidFinishLoading:(NSURLConnection *)con
+{
+ ASSERT(con == connection);
+ [self didFinishLoading];
+}
+
+- (void)connection:(NSURLConnection *)con didFailWithError:(NSError *)error
+{
+ ASSERT(con == connection);
+ [self didFailWithError:error];
+}
+
+- (NSCachedURLResponse *)connection:(NSURLConnection *)con willCacheResponse:(NSCachedURLResponse *)cachedResponse
+{
+ ASSERT(con == connection);
+ return [self willCacheResponse:cachedResponse];
+}
+
- (void)cancelWithError:(NSError *)error
{
ASSERT(!reachedTerminalState);
@@ -463,7 +519,7 @@
[connection cancel];
- [webView _completeProgressForConnection:connection];
+ [webView _completeProgressForConnectionDelegate:self];
if (error) {
[[webView _resourceLoadDelegateForwarder] webView:webView resource:identifier didFailLoadingWithError:error fromDataSource:dataSource];
@@ -482,8 +538,8 @@
- (NSError *)cancelledError
{
return [NSError _webKitErrorWithDomain:NSURLErrorDomain
- code:NSURLErrorCancelled
- URL:[request URL]];
+ code:NSURLErrorCancelled
+ URL:[request URL]];
}
- (void)setIdentifier: ident
diff --git a/WebKit/WebView.subproj/WebDataSource.m b/WebKit/WebView.subproj/WebDataSource.m
index 0ee6c7c..b4028c5 100644
--- a/WebKit/WebView.subproj/WebDataSource.m
+++ b/WebKit/WebView.subproj/WebDataSource.m
@@ -726,6 +726,7 @@
_private->iconLoader = [[WebIconLoader alloc] initWithRequest:request];
[request release];
[_private->iconLoader setDelegate:self];
+ [_private->iconLoader setDataSource:self];
[_private->iconLoader startLoading];
}
}
diff --git a/WebKit/WebView.subproj/WebLoader.h b/WebKit/WebView.subproj/WebLoader.h
index a54f024..de1d573 100644
--- a/WebKit/WebView.subproj/WebLoader.h
+++ b/WebKit/WebView.subproj/WebLoader.h
@@ -35,10 +35,11 @@
BOOL cancelledFlag;
BOOL reachedTerminalState;
BOOL defersCallbacks;
+ BOOL waitingToDeliverResource;
WebResourceDelegateImplementationCache implementations;
NSURL *originalURL;
- WebResource *resource;
NSMutableData *resourceData;
+ WebResource *resource;
}
- (BOOL)loadWithRequest:(NSURLRequest *)request;
@@ -64,6 +65,15 @@
- (NSData *)resourceData;
+// Connection-less callbacks allow us to send callbacks using data attained from a WebResource instead of an NSURLConnection.
+- (NSURLRequest *)willSendRequest:(NSURLRequest *)newRequest redirectResponse:(NSURLResponse *)redirectResponse;
+- (void)didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge;
+- (void)didCancelAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge;
+- (void)didReceiveResponse:(NSURLResponse *)r;
+- (void)didReceiveData:(NSData *)data lengthReceived:(long long)lengthReceived;
+- (void)didFinishLoading;
+- (void)didFailWithError:(NSError *)error;
+
@end
// Note: This interface can be removed once this method is declared
diff --git a/WebKit/WebView.subproj/WebLoader.m b/WebKit/WebView.subproj/WebLoader.m
index 9aa8ef9..06a1d6d 100644
--- a/WebKit/WebView.subproj/WebLoader.m
+++ b/WebKit/WebView.subproj/WebLoader.m
@@ -121,6 +121,20 @@
[super dealloc];
}
+- (void)deliverResource
+{
+ ASSERT(resource);
+ ASSERT(waitingToDeliverResource);
+
+ if (!defersCallbacks) {
+ [self didReceiveResponse:[resource _response]];
+ NSData *data = [resource data];
+ [self didReceiveData:data lengthReceived:[data length]];
+ [self didFinishLoading];
+ waitingToDeliverResource = NO;
+ }
+}
+
- (BOOL)loadWithRequest:(NSURLRequest *)r
{
ASSERT(connection == nil);
@@ -135,12 +149,16 @@
if ([[r URL] isEqual:originalURL]) {
resource = [dataSource subresourceForURL:originalURL];
if (resource) {
- // FIXME: This is a hack to make Foundation hand us back the data that we're caching. We need something more direct.
[resource retain];
- [[NSURLCache sharedURLCache] storeCachedResponse:[resource _cachedResponseRepresentation] forRequest:r];
+ waitingToDeliverResource = YES;
+ if (!defersCallbacks) {
+ // Deliver the resource after a delay because callers don't expect to receive callbacks while calling this method.
+ [self performSelector:@selector(deliverResource) withObject:nil afterDelay:0];
+ }
+ return YES;
}
}
-
+
connection = [[NSURLConnection alloc] initWithRequest:r delegate:self];
if (defersCallbacks) {
[connection setDefersCallbacks:YES];
@@ -153,6 +171,9 @@
{
defersCallbacks = defers;
[connection setDefersCallbacks:defers];
+ if (!defersCallbacks && waitingToDeliverResource) {
+ [self deliverResource];
+ }
}
- (BOOL)defersCallbacks
@@ -234,9 +255,8 @@
return resource ? [resource data] : resourceData;
}
-- (NSURLRequest *)connection:(NSURLConnection *)con willSendRequest:(NSURLRequest *)newRequest redirectResponse:(NSURLResponse *)redirectResponse
+- (NSURLRequest *)willSendRequest:(NSURLRequest *)newRequest redirectResponse:(NSURLResponse *)redirectResponse
{
- ASSERT(con == connection);
ASSERT(!reachedTerminalState);
NSMutableURLRequest *mutableRequest = [newRequest mutableCopy];
NSURLRequest *clientRequest, *updatedRequest;
@@ -295,11 +315,9 @@
return request;
}
-- (void)connection:(NSURLConnection *)con didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge
+- (void)didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge
{
- ASSERT(con == connection);
ASSERT(!reachedTerminalState);
-
ASSERT(!currentConnectionChallenge);
ASSERT(!currentWebChallenge);
@@ -317,11 +335,9 @@
[self release];
}
--(void)connection:(NSURLConnection *)con didCancelAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge
+- (void)didCancelAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge
{
- ASSERT(con == connection);
ASSERT(!reachedTerminalState);
-
ASSERT(currentConnectionChallenge);
ASSERT(currentWebChallenge);
ASSERT(currentConnectionChallenge = challenge);
@@ -337,9 +353,8 @@
[self release];
}
-- (void)connection:(NSURLConnection *)con didReceiveResponse:(NSURLResponse *)r
+- (void)didReceiveResponse:(NSURLResponse *)r
{
- ASSERT(con == connection);
ASSERT(!reachedTerminalState);
// retain/release self in this delegate method since the additional processing can do
@@ -362,7 +377,7 @@
[dataSource _addResponse: r];
- [webView _incrementProgressForConnection:con response:r];
+ [webView _incrementProgressForConnectionDelegate:self response:r];
if (implementations.delegateImplementsDidReceiveResponse)
[resourceLoadDelegate webView:webView resource:identifier didReceiveResponse:r fromDataSource:dataSource];
@@ -371,12 +386,7 @@
[self release];
}
-- (void)connection:(NSURLConnection *)con didReceiveData:(NSData *)data
-{
- [self connection:con didReceiveData:data lengthReceived:[data length]];
-}
-
-- (void)connection:(NSURLConnection *)con didReceiveData:(NSData *)data lengthReceived:(long long)lengthReceived
+- (void)didReceiveData:(NSData *)data lengthReceived:(long long)lengthReceived
{
// The following assertions are not quite valid here, since a subclass
// might override didReceiveData: in a way that invalidates them. This
@@ -390,7 +400,7 @@
[self addData:data];
- [webView _incrementProgressForConnection:con data:data];
+ [webView _incrementProgressForConnectionDelegate:self data:data];
if (implementations.delegateImplementsDidReceiveContentLength)
[resourceLoadDelegate webView:webView resource:identifier didReceiveContentLength:lengthReceived fromDataSource:dataSource];
@@ -399,7 +409,7 @@
[self release];
}
-- (void)connectionDidFinishLoading:(NSURLConnection *)con
+- (void)didFinishLoading
{
// If load has been cancelled after finishing (which could happen with a
// javascript that changes the window location), do nothing.
@@ -407,12 +417,11 @@
return;
}
- ASSERT(con == connection);
ASSERT(!reachedTerminalState);
[self saveResource];
- [webView _completeProgressForConnection:con];
+ [webView _completeProgressForConnectionDelegate:self];
if (implementations.delegateImplementsDidFinishLoadingFromDataSource)
[resourceLoadDelegate webView:webView resource:identifier didFinishLoadingFromDataSource:dataSource];
@@ -422,28 +431,75 @@
[self releaseResources];
}
-- (void)connection:(NSURLConnection *)con didFailWithError:(NSError *)result
+- (void)didFailWithError:(NSError *)error
{
- ASSERT(con == connection);
ASSERT(!reachedTerminalState);
// 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];
- [webView _completeProgressForConnection:con];
+ [webView _completeProgressForConnectionDelegate:self];
- [[webView _resourceLoadDelegateForwarder] webView:webView resource:identifier didFailLoadingWithError:result fromDataSource:dataSource];
+ [[webView _resourceLoadDelegateForwarder] webView:webView resource:identifier didFailLoadingWithError:error fromDataSource:dataSource];
[self releaseResources];
[self release];
}
-- (NSCachedURLResponse *)connection:(NSURLConnection *)connection willCacheResponse:(NSCachedURLResponse *)cachedResponse
+- (NSCachedURLResponse *)willCacheResponse:(NSCachedURLResponse *)cachedResponse
{
[self saveResourceWithCachedResponse:cachedResponse];
return cachedResponse;
}
+- (NSURLRequest *)connection:(NSURLConnection *)con willSendRequest:(NSURLRequest *)newRequest redirectResponse:(NSURLResponse *)redirectResponse
+{
+ ASSERT(con == connection);
+ return [self willSendRequest:newRequest redirectResponse:redirectResponse];
+}
+
+- (void)connection:(NSURLConnection *)con didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge
+{
+ ASSERT(con == connection);
+ [self didReceiveAuthenticationChallenge:challenge];
+}
+
+- (void)connection:(NSURLConnection *)con didCancelAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge
+{
+ ASSERT(con == connection);
+ [self didCancelAuthenticationChallenge:challenge];
+}
+
+- (void)connection:(NSURLConnection *)con didReceiveResponse:(NSURLResponse *)r
+{
+ ASSERT(con == connection);
+ [self didReceiveResponse:r];
+}
+
+- (void)connection:(NSURLConnection *)con didReceiveData:(NSData *)data lengthReceived:(long long)lengthReceived
+{
+ ASSERT(con == connection);
+ [self didReceiveData:data lengthReceived:lengthReceived];
+}
+
+- (void)connectionDidFinishLoading:(NSURLConnection *)con
+{
+ ASSERT(con == connection);
+ [self didFinishLoading];
+}
+
+- (void)connection:(NSURLConnection *)con didFailWithError:(NSError *)error
+{
+ ASSERT(con == connection);
+ [self didFailWithError:error];
+}
+
+- (NSCachedURLResponse *)connection:(NSURLConnection *)con willCacheResponse:(NSCachedURLResponse *)cachedResponse
+{
+ ASSERT(con == connection);
+ return [self willCacheResponse:cachedResponse];
+}
+
- (void)cancelWithError:(NSError *)error
{
ASSERT(!reachedTerminalState);
@@ -463,7 +519,7 @@
[connection cancel];
- [webView _completeProgressForConnection:connection];
+ [webView _completeProgressForConnectionDelegate:self];
if (error) {
[[webView _resourceLoadDelegateForwarder] webView:webView resource:identifier didFailLoadingWithError:error fromDataSource:dataSource];
@@ -482,8 +538,8 @@
- (NSError *)cancelledError
{
return [NSError _webKitErrorWithDomain:NSURLErrorDomain
- code:NSURLErrorCancelled
- URL:[request URL]];
+ code:NSURLErrorCancelled
+ URL:[request URL]];
}
- (void)setIdentifier: ident
diff --git a/WebKit/WebView.subproj/WebResource.m b/WebKit/WebView.subproj/WebResource.m
index 8ecba0a..d351889 100644
--- a/WebKit/WebView.subproj/WebResource.m
+++ b/WebKit/WebView.subproj/WebResource.m
@@ -162,16 +162,17 @@ NSString *WebSubresourcesKey = @"WebSubresources";
return propertyList;
}
+- (NSURLResponse *)_response
+{
+ return [[[NSURLResponse alloc] initWithURL:_private->URL
+ MIMEType:_private->MIMEType
+ expectedContentLength:[_private->data length]
+ textEncodingName:_private->textEncodingName] autorelease];
+}
+
- (NSCachedURLResponse *)_cachedResponseRepresentation
{
- unsigned length = [_private->data length];
- NSURLResponse *response = [[NSURLResponse alloc] initWithURL:_private->URL
- MIMEType:_private->MIMEType
- expectedContentLength:length
- textEncodingName:_private->textEncodingName];
- NSCachedURLResponse *cachedResponse = [[[NSCachedURLResponse alloc] initWithResponse:response data:_private->data] autorelease];
- [response release];
- return cachedResponse;
+ return [[[NSCachedURLResponse alloc] initWithResponse:[self _response] data:_private->data] autorelease];
}
@end
diff --git a/WebKit/WebView.subproj/WebResourcePrivate.h b/WebKit/WebView.subproj/WebResourcePrivate.h
index d450b2a..52b408d 100644
--- a/WebKit/WebView.subproj/WebResourcePrivate.h
+++ b/WebKit/WebView.subproj/WebResourcePrivate.h
@@ -24,5 +24,6 @@ extern NSString *WebSubresourcesKey;
- (id)_propertyListRepresentation;
- (NSCachedURLResponse *)_cachedResponseRepresentation;
+- (NSURLResponse *)_response;
@end
\ No newline at end of file
diff --git a/WebKit/WebView.subproj/WebView.m b/WebKit/WebView.subproj/WebView.m
index 18549fd..a72e418 100644
--- a/WebKit/WebView.subproj/WebView.m
+++ b/WebKit/WebView.subproj/WebView.m
@@ -838,9 +838,9 @@ NSString *_WebMainFrameURLKey = @"mainFrameURL";
[self _didChangeValueForKey: @"estimatedProgress"];
}
-- (void)_incrementProgressForConnection:(NSURLConnection *)con response:(NSURLResponse *)response;
+- (void)_incrementProgressForConnectionDelegate:(id)connectionDelegate response:(NSURLResponse *)response;
{
- if (!con)
+ if (!connectionDelegate)
return;
LOG (Progress, "_private->numProgressTrackedFrames %d, _private->orginatingProgressFrame %p", _private->numProgressTrackedFrames, _private->orginatingProgressFrame);
@@ -863,16 +863,16 @@ NSString *_WebMainFrameURLKey = @"mainFrameURL";
if (!_private->progressItems)
_private->progressItems = [[NSMutableDictionary alloc] init];
- [_private->progressItems _web_setObject:item forUncopiedKey:con];
+ [_private->progressItems _web_setObject:item forUncopiedKey:connectionDelegate];
[item release];
}
-- (void)_incrementProgressForConnection:(NSURLConnection *)con data:(NSData *)data
+- (void)_incrementProgressForConnectionDelegate:(id)connectionDelegate data:(NSData *)data
{
- if (!con)
+ if (!connectionDelegate)
return;
- WebProgressItem *item = [_private->progressItems objectForKey:con];
+ WebProgressItem *item = [_private->progressItems objectForKey:connectionDelegate];
if (!item)
return;
@@ -925,9 +925,9 @@ NSString *_WebMainFrameURLKey = @"mainFrameURL";
[self _didChangeValueForKey: @"estimatedProgress"];
}
-- (void)_completeProgressForConnection:(NSURLConnection *)con
+- (void)_completeProgressForConnectionDelegate:(id)connectionDelegate
{
- WebProgressItem *item = [_private->progressItems objectForKey:con];
+ WebProgressItem *item = [_private->progressItems objectForKey:connectionDelegate];
if (!item)
return;
diff --git a/WebKit/WebView.subproj/WebViewPrivate.h b/WebKit/WebView.subproj/WebViewPrivate.h
index 4eee18e..7ac665c 100644
--- a/WebKit/WebView.subproj/WebViewPrivate.h
+++ b/WebKit/WebView.subproj/WebViewPrivate.h
@@ -240,9 +240,9 @@ Could be worth adding to the API.
// Methods dealing with the estimated progress completion.
- (void)_progressStarted:(WebFrame *)frame;
- (void)_progressCompleted:(WebFrame *)frame;
-- (void)_incrementProgressForConnection:(NSURLConnection *)con response:(NSURLResponse *)response;
-- (void)_incrementProgressForConnection:(NSURLConnection *)con data:(NSData *)dataSource;
-- (void)_completeProgressForConnection:(NSURLConnection *)con;
+- (void)_incrementProgressForConnectionDelegate:(id)connectionDelegate response:(NSURLResponse *)response;
+- (void)_incrementProgressForConnectionDelegate:(id)connectionDelegate data:(NSData *)dataSource;
+- (void)_completeProgressForConnectionDelegate:(id)connectionDelegate;
- (void)_didStartProvisionalLoadForFrame:(WebFrame *)frame;
- (void)_didCommitLoadForFrame:(WebFrame *)frame;
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list