[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677
kocienda
kocienda at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 05:59:29 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit 5785f6b248c06bb069e21f8d26aeb2be5fb085ec
Author: kocienda <kocienda at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Fri Mar 29 17:53:58 2002 +0000
2002-03-29 Kenneth Kocienda <kocienda at apple.com>
Added exception handling to the code that reads cache files from
disk. This should isolate the application from exiting when
an exception is thrown by NSArchiver in its efforts to unarchive
cache files.
* Database.subproj/IFURLFileDatabase.m: (-[IFURLFileDatabase objectForKey:]):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@890 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKit/Misc.subproj/WebFileDatabase.m b/WebKit/Misc.subproj/WebFileDatabase.m
index e2f6586..6598d0d 100644
--- a/WebKit/Misc.subproj/WebFileDatabase.m
+++ b/WebKit/Misc.subproj/WebFileDatabase.m
@@ -247,6 +247,8 @@ enum
result = nil;
fileKey = nil;
+ data = nil;
+ unarchiver = nil;
touch = CFAbsoluteTimeGetCurrent();
@@ -265,22 +267,32 @@ enum
// go to disk
filePath = [NSString stringWithFormat:@"%@/%@", path, [IFURLFileDatabase uniqueFilePathForKey:key]];
- data = [[NSData alloc] initWithContentsOfMappedFile:filePath];
- if (!data) {
- data = [[NSData alloc] initWithContentsOfFile:filePath];
- }
- if (data) {
- unarchiver = [[NSUnarchiver alloc] initForReadingWithData:data];
- fileKey = [unarchiver decodeObject];
- object = [unarchiver decodeObject];
- if (object && [fileKey isEqual:key]) {
- // make sure this object stays around until client has had a chance at it
- result = [object retain];
- [result autorelease];
+ NS_DURING
+ data = [[NSData alloc] initWithContentsOfMappedFile:filePath];
+ if (!data) {
+ data = [[NSData alloc] initWithContentsOfFile:filePath];
}
- [unarchiver release];
- [data release];
- }
+ if (data) {
+ unarchiver = [[NSUnarchiver alloc] initForReadingWithData:data];
+ }
+ if (unarchiver) {
+ fileKey = [unarchiver decodeObject];
+ object = [unarchiver decodeObject];
+ if (object && [fileKey isEqual:key]) {
+ // make sure this object stays around until client has had a chance at it
+ result = [object retain];
+ [result autorelease];
+ }
+ }
+ NS_HANDLER
+#ifdef WEBFOUNDATION_DEBUG
+ WebFoundationLogAtLevel(WebFoundationLogDiskCacheActivity, @"- [WEBFOUNDATION_DEBUG] - cannot unarchive cache file - %@", key);
+#endif
+ result = nil;
+ NS_ENDHANDLER
+
+ [unarchiver release];
+ [data release];
return result;
}
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list