[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 06:37:21 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit fe2b30d71cbe37816331d4cbbd5f9ffb14ea4594
Author: darin <darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Mon Sep 9 16:03:08 2002 +0000
Fixed lifetime problems happening due to new cancel mechanism.
* WebCoreSupport.subproj/WebSubresourceClient.m: Add comments explaining why
retain/release is needed.
* WebView.subproj/WebDataSourcePrivate.m:
(-[WebDataSource _recursiveStopLoading]): Add a retain/release so that we don't
run into problems if _stopLoading causes the data source to go away.
* WebView.subproj/WebMainResourceClient.m:
(-[WebMainResourceClient didCancelWithHandle:]): Add retain/release for similar reasons,
with comment explaining why.
(-[WebMainResourceClient handleDidFinishLoading:]): Ditto.
(-[WebMainResourceClient handleDidFailLoading:withError:]): Ditto.
Fixed the problem that was leading to the NSImage exception, but didn't turn on
the whizzy scaling -- leaving that to Chris.
* Misc.subproj/WebIconDatabase.m: (-[WebIconDatabase iconForSiteURL:withSize:]):
Eliminate the "size 0x0" feature. It was only implemented in one place, and tons
of other places would actually make a size 0x0 icon. But also, we don't need it any more.
* WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource iconLoader: receivedPageIcon:),
(-[WebDataSource _loadIcon]): Don't bother actually passing the icon to
[WebLocationChangeHandler receivedPageIcon:forDataSource:]. We should probably eventually
either just get rid of this method, or remove the icon parameter.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2004 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 6553597..a488717 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,29 @@
+2002-09-09 Darin Adler <darin at apple.com>
+
+ Fixed lifetime problems happening due to new cancel mechanism.
+
+ * WebCoreSupport.subproj/WebSubresourceClient.m: Add comments explaining why
+ retain/release is needed.
+ * WebView.subproj/WebDataSourcePrivate.m:
+ (-[WebDataSource _recursiveStopLoading]): Add a retain/release so that we don't
+ run into problems if _stopLoading causes the data source to go away.
+ * WebView.subproj/WebMainResourceClient.m:
+ (-[WebMainResourceClient didCancelWithHandle:]): Add retain/release for similar reasons,
+ with comment explaining why.
+ (-[WebMainResourceClient handleDidFinishLoading:]): Ditto.
+ (-[WebMainResourceClient handleDidFailLoading:withError:]): Ditto.
+
+ Fixed the problem that was leading to the NSImage exception, but didn't turn on
+ the whizzy scaling -- leaving that to Chris.
+
+ * Misc.subproj/WebIconDatabase.m: (-[WebIconDatabase iconForSiteURL:withSize:]):
+ Eliminate the "size 0x0" feature. It was only implemented in one place, and tons
+ of other places would actually make a size 0x0 icon. But also, we don't need it any more.
+ * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource iconLoader: receivedPageIcon:),
+ (-[WebDataSource _loadIcon]): Don't bother actually passing the icon to
+ [WebLocationChangeHandler receivedPageIcon:forDataSource:]. We should probably eventually
+ either just get rid of this method, or remove the icon parameter.
+
2002-09-09 Chris Blumenberg <cblu at apple.com>
diff --git a/WebKit/ChangeLog-2002-12-03 b/WebKit/ChangeLog-2002-12-03
index 6553597..a488717 100644
--- a/WebKit/ChangeLog-2002-12-03
+++ b/WebKit/ChangeLog-2002-12-03
@@ -1,3 +1,29 @@
+2002-09-09 Darin Adler <darin at apple.com>
+
+ Fixed lifetime problems happening due to new cancel mechanism.
+
+ * WebCoreSupport.subproj/WebSubresourceClient.m: Add comments explaining why
+ retain/release is needed.
+ * WebView.subproj/WebDataSourcePrivate.m:
+ (-[WebDataSource _recursiveStopLoading]): Add a retain/release so that we don't
+ run into problems if _stopLoading causes the data source to go away.
+ * WebView.subproj/WebMainResourceClient.m:
+ (-[WebMainResourceClient didCancelWithHandle:]): Add retain/release for similar reasons,
+ with comment explaining why.
+ (-[WebMainResourceClient handleDidFinishLoading:]): Ditto.
+ (-[WebMainResourceClient handleDidFailLoading:withError:]): Ditto.
+
+ Fixed the problem that was leading to the NSImage exception, but didn't turn on
+ the whizzy scaling -- leaving that to Chris.
+
+ * Misc.subproj/WebIconDatabase.m: (-[WebIconDatabase iconForSiteURL:withSize:]):
+ Eliminate the "size 0x0" feature. It was only implemented in one place, and tons
+ of other places would actually make a size 0x0 icon. But also, we don't need it any more.
+ * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource iconLoader: receivedPageIcon:),
+ (-[WebDataSource _loadIcon]): Don't bother actually passing the icon to
+ [WebLocationChangeHandler receivedPageIcon:forDataSource:]. We should probably eventually
+ either just get rid of this method, or remove the icon parameter.
+
2002-09-09 Chris Blumenberg <cblu at apple.com>
diff --git a/WebKit/Misc.subproj/WebIconDatabase.m b/WebKit/Misc.subproj/WebIconDatabase.m
index f603629..cd0b7fc 100644
--- a/WebKit/Misc.subproj/WebIconDatabase.m
+++ b/WebKit/Misc.subproj/WebIconDatabase.m
@@ -97,6 +97,9 @@ NSSize WebIconMediumSize = {32, 32};
- (NSImage *)iconForSiteURL:(NSURL *)siteURL withSize:(NSSize)size
{
+ ASSERT(size.width);
+ ASSERT(size.height);
+
if(!siteURL){
return [self defaultIconWithSize:size];
}
@@ -109,7 +112,6 @@ NSSize WebIconMediumSize = {32, 32};
if(!icons){
NSURL *iconURL = [_private->siteURLToIconURL objectForKey:siteURL];
-
if(!iconURL){
// Don't have it
//NSLog(@"iconForSiteURL no iconURL for siteURL: %@", siteURL);
@@ -124,16 +126,14 @@ NSSize WebIconMediumSize = {32, 32};
}
}
- if(size.width == 0 && size.height == 0){
- // Don't cause a resize, just send the original in this case
- return [icons objectAtIndex:0];
- }else{
- return [self _cachedIconFromArray:icons withSize:size];
- }
+ return [self _cachedIconFromArray:icons withSize:size];
}
- (NSImage *)defaultIconWithSize:(NSSize)size
{
+ ASSERT(size.width);
+ ASSERT(size.height);
+
if (!_private->defaultIcons) {
NSString *pathForDefaultImage = [[NSBundle bundleForClass:[self class]] pathForResource:@"url_icon" ofType:@"tiff"];
if (pathForDefaultImage != nil) {
@@ -383,6 +383,9 @@ NSSize WebIconMediumSize = {32, 32};
- (NSImage *)_iconForFileURL:(NSURL *)fileURL withSize:(NSSize)size
{
+ ASSERT(size.width);
+ ASSERT(size.height);
+
NSWorkspace *workspace = [NSWorkspace sharedWorkspace];
NSImage *icon;
@@ -683,6 +686,9 @@ NSSize WebIconMediumSize = {32, 32};
- (NSImage *)_cachedIconFromArray:(NSMutableArray *)icons withSize:(NSSize)size
{
+ ASSERT(size.width);
+ ASSERT(size.height);
+
NSEnumerator *enumerator = [icons objectEnumerator];
NSImage *icon;
@@ -706,6 +712,9 @@ NSSize WebIconMediumSize = {32, 32};
- (NSImage *)_iconByScalingIcon:(NSImage *)icon toSize:(NSSize)size
{
+ ASSERT(size.width);
+ ASSERT(size.height);
+
double start, duration;
NSImage *scaledIcon;
diff --git a/WebKit/WebCoreSupport.subproj/WebSubresourceClient.m b/WebKit/WebCoreSupport.subproj/WebSubresourceClient.m
index 75d4baf..fbde186 100644
--- a/WebKit/WebCoreSupport.subproj/WebSubresourceClient.m
+++ b/WebKit/WebCoreSupport.subproj/WebSubresourceClient.m
@@ -120,8 +120,9 @@
ASSERT([currentURL isEqual:[handle URL]]);
ASSERT([[handle response] statusCode] == WebResourceHandleStatusLoadComplete);
+ // Calling _removeSubresourceClient will likely result in a call to release, so we must retain.
[self retain];
-
+
[loader finish];
[dataSource _removeSubresourceClient:self];
@@ -146,8 +147,9 @@
ASSERT(handle == h);
ASSERT([currentURL isEqual:[handle URL]]);
+ // Calling _removeSubresourceClient will likely result in a call to release, so we must retain.
[self retain];
-
+
[loader cancel];
[dataSource _removeSubresourceClient:self];
@@ -177,11 +179,11 @@
[self didStopLoading];
[self didStartLoadingWithURL:URL];
-
}
- (void)cancel
{
+ // Calling _removeSubresourceClient will likely result in a call to release, so we must retain.
[self retain];
[handle cancelLoadInBackground];
diff --git a/WebKit/WebCoreSupport.subproj/WebSubresourceLoader.m b/WebKit/WebCoreSupport.subproj/WebSubresourceLoader.m
index 75d4baf..fbde186 100644
--- a/WebKit/WebCoreSupport.subproj/WebSubresourceLoader.m
+++ b/WebKit/WebCoreSupport.subproj/WebSubresourceLoader.m
@@ -120,8 +120,9 @@
ASSERT([currentURL isEqual:[handle URL]]);
ASSERT([[handle response] statusCode] == WebResourceHandleStatusLoadComplete);
+ // Calling _removeSubresourceClient will likely result in a call to release, so we must retain.
[self retain];
-
+
[loader finish];
[dataSource _removeSubresourceClient:self];
@@ -146,8 +147,9 @@
ASSERT(handle == h);
ASSERT([currentURL isEqual:[handle URL]]);
+ // Calling _removeSubresourceClient will likely result in a call to release, so we must retain.
[self retain];
-
+
[loader cancel];
[dataSource _removeSubresourceClient:self];
@@ -177,11 +179,11 @@
[self didStopLoading];
[self didStartLoadingWithURL:URL];
-
}
- (void)cancel
{
+ // Calling _removeSubresourceClient will likely result in a call to release, so we must retain.
[self retain];
[handle cancelLoadInBackground];
diff --git a/WebKit/WebView.subproj/WebDataSourcePrivate.m b/WebKit/WebView.subproj/WebDataSourcePrivate.m
index 9f8fb6c..61acbdd 100644
--- a/WebKit/WebView.subproj/WebDataSourcePrivate.m
+++ b/WebKit/WebView.subproj/WebDataSourcePrivate.m
@@ -236,8 +236,10 @@
- (void)_recursiveStopLoading
{
+ [self retain];
[self _stopLoading];
[[self children] makeObjectsPerformSelector:@selector(stopLoading)];
+ [self release];
}
- (double)_loadingStartedTime
@@ -440,7 +442,7 @@
- (void)iconLoader:(WebIconLoader *)iconLoader receivedPageIcon:(NSImage *)icon;
{
[[WebIconDatabase sharedIconDatabase] _setIconURL:[iconLoader URL] forSiteURL:[self URL]];
- [[_private->controller locationChangeHandler] receivedPageIcon:icon forDataSource:self];
+ [[_private->controller locationChangeHandler] receivedPageIcon:nil forDataSource:self];
}
- (void)_loadIcon
@@ -453,9 +455,8 @@
WebIconDatabase *iconDB = [WebIconDatabase sharedIconDatabase];
if([iconDB _hasIconForSiteURL:dataSourceURL]){
- // Return the icon immediately if the db already has it
- NSImage *icon = [iconDB iconForSiteURL:dataSourceURL withSize:NSMakeSize(0,0)];
- [[_private->controller locationChangeHandler] receivedPageIcon:icon forDataSource:self];
+ // Tell about the icon immediately if the db already has it
+ [[_private->controller locationChangeHandler] receivedPageIcon:nil forDataSource:self];
}else{
if(!_private->iconURL){
diff --git a/WebKit/WebView.subproj/WebMainResourceClient.m b/WebKit/WebView.subproj/WebMainResourceClient.m
index d406ae6..a3ba365 100644
--- a/WebKit/WebView.subproj/WebMainResourceClient.m
+++ b/WebKit/WebView.subproj/WebMainResourceClient.m
@@ -122,6 +122,9 @@
LOG(Loading, "URL = %@", [handle URL]);
+ // Calling receivedError will likely result in a call to release, so we must retain.
+ [self retain];
+
// FIXME: Maybe we should be passing the URL from the handle here, not from the dataSource.
WebError *error = [[WebError alloc] initWithErrorCode:WebResultCancelled
inDomain:WebErrorDomainWebFoundation failingURL:[[dataSource originalURL] absoluteString]];
@@ -133,6 +136,8 @@
downloadHandler = nil;
[self didStopLoading];
+
+ [self release];
}
- (void)handleDidFinishLoading:(WebResourceHandle *)handle
@@ -142,6 +147,9 @@
ASSERT([currentURL isEqual:[handle URL]]);
ASSERT([[handle response] statusCode] == WebResourceHandleStatusLoadComplete);
+ // Calling receivedError will likely result in a call to release, so we must retain.
+ [self retain];
+
WebContentAction contentAction = [[dataSource contentPolicy] policyAction];
// Don't retain data for downloaded files
@@ -166,6 +174,8 @@
downloadHandler = nil;
[self didStopLoading];
+
+ [self release];
}
- (void)handleDidReceiveData:(WebResourceHandle *)handle data:(NSData *)data
@@ -240,6 +250,9 @@
ASSERT([currentURL isEqual:[handle URL]]);
+ // Calling receivedError will likely result in a call to release, so we must retain.
+ [self retain];
+
[self receivedError:result forHandle:handle];
[downloadHandler cancel];
@@ -247,6 +260,8 @@
downloadHandler = nil;
[self didStopLoading];
+
+ [self release];
}
- (void)handleDidRedirect:(WebResourceHandle *)handle toURL:(NSURL *)URL
diff --git a/WebKit/WebView.subproj/WebMainResourceLoader.m b/WebKit/WebView.subproj/WebMainResourceLoader.m
index d406ae6..a3ba365 100644
--- a/WebKit/WebView.subproj/WebMainResourceLoader.m
+++ b/WebKit/WebView.subproj/WebMainResourceLoader.m
@@ -122,6 +122,9 @@
LOG(Loading, "URL = %@", [handle URL]);
+ // Calling receivedError will likely result in a call to release, so we must retain.
+ [self retain];
+
// FIXME: Maybe we should be passing the URL from the handle here, not from the dataSource.
WebError *error = [[WebError alloc] initWithErrorCode:WebResultCancelled
inDomain:WebErrorDomainWebFoundation failingURL:[[dataSource originalURL] absoluteString]];
@@ -133,6 +136,8 @@
downloadHandler = nil;
[self didStopLoading];
+
+ [self release];
}
- (void)handleDidFinishLoading:(WebResourceHandle *)handle
@@ -142,6 +147,9 @@
ASSERT([currentURL isEqual:[handle URL]]);
ASSERT([[handle response] statusCode] == WebResourceHandleStatusLoadComplete);
+ // Calling receivedError will likely result in a call to release, so we must retain.
+ [self retain];
+
WebContentAction contentAction = [[dataSource contentPolicy] policyAction];
// Don't retain data for downloaded files
@@ -166,6 +174,8 @@
downloadHandler = nil;
[self didStopLoading];
+
+ [self release];
}
- (void)handleDidReceiveData:(WebResourceHandle *)handle data:(NSData *)data
@@ -240,6 +250,9 @@
ASSERT([currentURL isEqual:[handle URL]]);
+ // Calling receivedError will likely result in a call to release, so we must retain.
+ [self retain];
+
[self receivedError:result forHandle:handle];
[downloadHandler cancel];
@@ -247,6 +260,8 @@
downloadHandler = nil;
[self didStopLoading];
+
+ [self release];
}
- (void)handleDidRedirect:(WebResourceHandle *)handle toURL:(NSURL *)URL
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list