[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677
darin
darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 07:29:16 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit e1ec1e668b21f47b92c7defe9744c1a880f1d358
Author: darin <darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Wed Mar 12 19:40:48 2003 +0000
Reviewed by John.
- fixed 3193552 -- REGRESSION: crash loading ftp directory URL
- fixed minor problems with setDefersCallbacks handling and object lifetime
* WebView.subproj/WebBaseResourceHandleDelegate.h: Removed now-unused cancelQuietly.
* WebView.subproj/WebBaseResourceHandleDelegate.m:
(-[WebBaseResourceHandleDelegate cancel]): Changed cancel to tolerate being called
when we have already cancelled. It's an error to call cancelWithError once we
have cancelled.
* WebView.subproj/WebMainResourceClient.m:
(-[WebMainResourceClient interruptForPolicyChangeError]): Added. New function to
create the WebError object for policy change.
(-[WebMainResourceClient stopLoadingForPolicyChange]): Changed to just be a call
to cancelWithError:.
(-[WebMainResourceClient resource:willSendRequest:]): Call setDefersCallbacks:YES
here; continueAfterNavigationPolicy already takes care of setDefersCallbacks:NO,
but we lost this one somewhere along the way.
(-[WebMainResourceClient continueAfterContentPolicy:response:]): Changed to call
receivedError: on interruptForPolicyChangeError directly. It wasn't clearer to call
a method named interruptForPolicyChange.
(-[WebMainResourceClient resource:didReceiveResponse:]): Don't bother calling
setDefersCallbacks:YES here any more; checkContentPolicyForResponse: takes care
of that so there's no need to do it here. Initialize _contentLength before calling
checkContentPolicyForResponse:, since that method can result in deallocating self.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@3808 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 4c539ec..42fb97a 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,4 +1,33 @@
-(2003-03-12 John Sullivan <sullivan at apple.com>
+2003-03-12 Darin Adler <darin at apple.com>
+
+ Reviewed by John.
+
+ - fixed 3193552 -- REGRESSION: crash loading ftp directory URL
+ - fixed minor problems with setDefersCallbacks handling and object lifetime
+
+ * WebView.subproj/WebBaseResourceHandleDelegate.h: Removed now-unused cancelQuietly.
+ * WebView.subproj/WebBaseResourceHandleDelegate.m:
+ (-[WebBaseResourceHandleDelegate cancel]): Changed cancel to tolerate being called
+ when we have already cancelled. It's an error to call cancelWithError once we
+ have cancelled.
+
+ * WebView.subproj/WebMainResourceClient.m:
+ (-[WebMainResourceClient interruptForPolicyChangeError]): Added. New function to
+ create the WebError object for policy change.
+ (-[WebMainResourceClient stopLoadingForPolicyChange]): Changed to just be a call
+ to cancelWithError:.
+ (-[WebMainResourceClient resource:willSendRequest:]): Call setDefersCallbacks:YES
+ here; continueAfterNavigationPolicy already takes care of setDefersCallbacks:NO,
+ but we lost this one somewhere along the way.
+ (-[WebMainResourceClient continueAfterContentPolicy:response:]): Changed to call
+ receivedError: on interruptForPolicyChangeError directly. It wasn't clearer to call
+ a method named interruptForPolicyChange.
+ (-[WebMainResourceClient resource:didReceiveResponse:]): Don't bother calling
+ setDefersCallbacks:YES here any more; checkContentPolicyForResponse: takes care
+ of that so there's no need to do it here. Initialize _contentLength before calling
+ checkContentPolicyForResponse:, since that method can result in deallocating self.
+
+2003-03-12 John Sullivan <sullivan at apple.com>
Reviewed by Trey
diff --git a/WebKit/WebView.subproj/WebBaseResourceHandleDelegate.h b/WebKit/WebView.subproj/WebBaseResourceHandleDelegate.h
index 763fe88..4181ed1 100644
--- a/WebKit/WebView.subproj/WebBaseResourceHandleDelegate.h
+++ b/WebKit/WebView.subproj/WebBaseResourceHandleDelegate.h
@@ -43,7 +43,6 @@
- downloadDelegate;
- (void)cancel;
-- (void)cancelQuietly;
- (void)cancelWithError:(WebError *)error;
- (void)setDefersCallbacks:(BOOL)defers;
diff --git a/WebKit/WebView.subproj/WebBaseResourceHandleDelegate.m b/WebKit/WebView.subproj/WebBaseResourceHandleDelegate.m
index 559cbb3..17f8cbe 100644
--- a/WebKit/WebView.subproj/WebBaseResourceHandleDelegate.m
+++ b/WebKit/WebView.subproj/WebBaseResourceHandleDelegate.m
@@ -242,12 +242,9 @@
- (void)cancel
{
- [self cancelWithError:[self cancelledError]];
-}
-
-- (void)cancelQuietly
-{
- [self cancelWithError:nil];
+ if (!reachedTerminalState) {
+ [self cancelWithError:[self cancelledError]];
+ }
}
- (WebError *)cancelledError
diff --git a/WebKit/WebView.subproj/WebLoader.h b/WebKit/WebView.subproj/WebLoader.h
index 763fe88..4181ed1 100644
--- a/WebKit/WebView.subproj/WebLoader.h
+++ b/WebKit/WebView.subproj/WebLoader.h
@@ -43,7 +43,6 @@
- downloadDelegate;
- (void)cancel;
-- (void)cancelQuietly;
- (void)cancelWithError:(WebError *)error;
- (void)setDefersCallbacks:(BOOL)defers;
diff --git a/WebKit/WebView.subproj/WebLoader.m b/WebKit/WebView.subproj/WebLoader.m
index 559cbb3..17f8cbe 100644
--- a/WebKit/WebView.subproj/WebLoader.m
+++ b/WebKit/WebView.subproj/WebLoader.m
@@ -242,12 +242,9 @@
- (void)cancel
{
- [self cancelWithError:[self cancelledError]];
-}
-
-- (void)cancelQuietly
-{
- [self cancelWithError:nil];
+ if (!reachedTerminalState) {
+ [self cancelWithError:[self cancelledError]];
+ }
}
- (WebError *)cancelledError
diff --git a/WebKit/WebView.subproj/WebMainResourceClient.m b/WebKit/WebView.subproj/WebMainResourceClient.m
index f8de7ea..3b9d333 100644
--- a/WebKit/WebView.subproj/WebMainResourceClient.m
+++ b/WebKit/WebView.subproj/WebMainResourceClient.m
@@ -82,41 +82,22 @@
policyResponse = nil;
}
-- (void)cancel
-{
- [self cancelContentPolicy];
- LOG(Loading, "URL = %@", [dataSource _URL]);
-
- [resource cancel];
- [self receivedError:[self cancelledError]];
-}
-
--(void)cancelQuietly
-{
- [self cancelContentPolicy];
- [super cancelQuietly];
-}
-
-(void)cancelWithError:(WebError *)error
{
[self cancelContentPolicy];
[super cancelWithError:error];
}
-
-- (void)interruptForPolicyChange
+- (WebError *)interruptForPolicyChangeError
{
- // Terminate the locationChangeDelegate correctly.
- WebError *interruptError = [WebError errorWithCode:WebKitErrorLocationChangeInterruptedByPolicyChange
- inDomain:WebErrorDomainWebKit
- failingURL:nil];
- [self receivedError:interruptError];
+ return [WebError errorWithCode:WebKitErrorLocationChangeInterruptedByPolicyChange
+ inDomain:WebErrorDomainWebKit
+ failingURL:nil];
}
-(void)stopLoadingForPolicyChange
{
- [self interruptForPolicyChange];
- [self cancelQuietly];
+ [self cancelWithError:[self interruptForPolicyChangeError]];
}
-(void)continueAfterNavigationPolicy:(WebRequest *)_request formState:(WebFormState *)state
@@ -151,7 +132,13 @@
// Don't set this on the first request. It is set
// when the main load was started.
[dataSource _setRequest:newRequest];
- [[dataSource webFrame] _checkNavigationPolicyForRequest:newRequest dataSource:dataSource formState:nil andCall:self withSelector:@selector(continueAfterNavigationPolicy:formState:)];
+
+ [[dataSource _controller] setDefersCallbacks:YES];
+ [[dataSource webFrame] _checkNavigationPolicyForRequest:newRequest
+ dataSource:dataSource
+ formState:nil
+ andCall:self
+ withSelector:@selector(continueAfterNavigationPolicy:formState:)];
return newRequest;
}
@@ -179,13 +166,12 @@
proxy:proxy];
[proxy release];
proxy = nil;
- [self interruptForPolicyChange];
+ [self receivedError:[self interruptForPolicyChangeError]];
return;
case WebPolicyIgnore:
[self stopLoadingForPolicyChange];
return;
- break;
default:
ASSERT_NOT_REACHED();
@@ -215,9 +201,9 @@
WebController *c = [dataSource _controller];
[c setDefersCallbacks:YES];
[[c _policyDelegateForwarder] controller:c decideContentPolicyForMIMEType:[r contentType]
- andRequest:[dataSource request]
- inFrame:[dataSource webFrame]
- decisionListener:listener];
+ andRequest:[dataSource request]
+ inFrame:[dataSource webFrame]
+ decisionListener:listener];
}
@@ -226,16 +212,14 @@
ASSERT(![h defersCallbacks]);
ASSERT(![self defersCallbacks]);
ASSERT(![[dataSource _controller] defersCallbacks]);
- [dataSource _setResponse:r];
LOG(Loading, "main content type: %@", [r contentType]);
- [[dataSource _controller] setDefersCallbacks:YES];
+ [dataSource _setResponse:r];
+ _contentLength = [r contentLength];
// Figure out the content policy.
[self checkContentPolicyForResponse:r];
-
- _contentLength = [r contentLength];
}
- (void)resource:(WebResource *)h didReceiveData:(NSData *)data
diff --git a/WebKit/WebView.subproj/WebMainResourceLoader.m b/WebKit/WebView.subproj/WebMainResourceLoader.m
index f8de7ea..3b9d333 100644
--- a/WebKit/WebView.subproj/WebMainResourceLoader.m
+++ b/WebKit/WebView.subproj/WebMainResourceLoader.m
@@ -82,41 +82,22 @@
policyResponse = nil;
}
-- (void)cancel
-{
- [self cancelContentPolicy];
- LOG(Loading, "URL = %@", [dataSource _URL]);
-
- [resource cancel];
- [self receivedError:[self cancelledError]];
-}
-
--(void)cancelQuietly
-{
- [self cancelContentPolicy];
- [super cancelQuietly];
-}
-
-(void)cancelWithError:(WebError *)error
{
[self cancelContentPolicy];
[super cancelWithError:error];
}
-
-- (void)interruptForPolicyChange
+- (WebError *)interruptForPolicyChangeError
{
- // Terminate the locationChangeDelegate correctly.
- WebError *interruptError = [WebError errorWithCode:WebKitErrorLocationChangeInterruptedByPolicyChange
- inDomain:WebErrorDomainWebKit
- failingURL:nil];
- [self receivedError:interruptError];
+ return [WebError errorWithCode:WebKitErrorLocationChangeInterruptedByPolicyChange
+ inDomain:WebErrorDomainWebKit
+ failingURL:nil];
}
-(void)stopLoadingForPolicyChange
{
- [self interruptForPolicyChange];
- [self cancelQuietly];
+ [self cancelWithError:[self interruptForPolicyChangeError]];
}
-(void)continueAfterNavigationPolicy:(WebRequest *)_request formState:(WebFormState *)state
@@ -151,7 +132,13 @@
// Don't set this on the first request. It is set
// when the main load was started.
[dataSource _setRequest:newRequest];
- [[dataSource webFrame] _checkNavigationPolicyForRequest:newRequest dataSource:dataSource formState:nil andCall:self withSelector:@selector(continueAfterNavigationPolicy:formState:)];
+
+ [[dataSource _controller] setDefersCallbacks:YES];
+ [[dataSource webFrame] _checkNavigationPolicyForRequest:newRequest
+ dataSource:dataSource
+ formState:nil
+ andCall:self
+ withSelector:@selector(continueAfterNavigationPolicy:formState:)];
return newRequest;
}
@@ -179,13 +166,12 @@
proxy:proxy];
[proxy release];
proxy = nil;
- [self interruptForPolicyChange];
+ [self receivedError:[self interruptForPolicyChangeError]];
return;
case WebPolicyIgnore:
[self stopLoadingForPolicyChange];
return;
- break;
default:
ASSERT_NOT_REACHED();
@@ -215,9 +201,9 @@
WebController *c = [dataSource _controller];
[c setDefersCallbacks:YES];
[[c _policyDelegateForwarder] controller:c decideContentPolicyForMIMEType:[r contentType]
- andRequest:[dataSource request]
- inFrame:[dataSource webFrame]
- decisionListener:listener];
+ andRequest:[dataSource request]
+ inFrame:[dataSource webFrame]
+ decisionListener:listener];
}
@@ -226,16 +212,14 @@
ASSERT(![h defersCallbacks]);
ASSERT(![self defersCallbacks]);
ASSERT(![[dataSource _controller] defersCallbacks]);
- [dataSource _setResponse:r];
LOG(Loading, "main content type: %@", [r contentType]);
- [[dataSource _controller] setDefersCallbacks:YES];
+ [dataSource _setResponse:r];
+ _contentLength = [r contentLength];
// Figure out the content policy.
[self checkContentPolicyForResponse:r];
-
- _contentLength = [r contentLength];
}
- (void)resource:(WebResource *)h didReceiveData:(NSData *)data
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list