[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:57:47 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit 903537ac74763c510b8c845519f792d488a36d12
Author: kocienda <kocienda at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Mon Mar 18 15:34:15 2002 +0000
2002-03-18 Kenneth Kocienda <kocienda at apple.com>
I reworked the code a bit in IFURLLoadManager so I could remove some more locking and made
the locking that still needs to be there more fine grained.
* CacheLoader.subproj/IFURLLoadManager.m: (-[IFURLLoadManager objectForURL:]),
(-[IFURLLoadManager setObject:forURL:attributes:expiry:]), (-[IFURLLoadManager
invalidateURL:]), (-[IFURLLoadManager clearAllCaches]), (-[IFURLLoadManager
cancelRequestWithURLHandle:]), (-[IFURLLoadManager cancelAllRequestsWithURL:]),
(-[IFURLLoadManager cancelAllRequestsInGroup:]):
Some small code clean ups here.
* Database.subproj/IFURLFileDatabase.m: (-[IFURLFileDatabase initWithPath:]),
(-[IFURLFileDatabase setObject:forKey:]), (-[IFURLFileDatabase
removeObjectForKey:]), (-[IFURLFileDatabase objectForKey:]), (-[IFURLFileDatabase
open]):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@770 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKit/Misc.subproj/WebFileDatabase.m b/WebKit/Misc.subproj/WebFileDatabase.m
index b2525e2..1f0e95f 100644
--- a/WebKit/Misc.subproj/WebFileDatabase.m
+++ b/WebKit/Misc.subproj/WebFileDatabase.m
@@ -27,9 +27,11 @@ static NSNumber *IFURLFilePosixPermissions;
-(id)initWithPath:(NSString *)thePath
{
if ((self = [super initWithPath:thePath])) {
+
return self;
}
+ [self release];
return nil;
}
@@ -103,9 +105,10 @@ static NSNumber *IFURLFilePosixPermissions;
NULL
];
- filePath = [NSString stringWithFormat:@"%@/%@", path, [IFURLFileDatabase uniqueFilePathForKey:key]];
-
defaultManager = [NSFileManager defaultManager];
+
+ filePath = [NSString stringWithFormat:@"%@/%@", path, [IFURLFileDatabase uniqueFilePathForKey:key]];
+
result = [defaultManager createFileAtPath:filePath contents:data attributes:attributes];
if (!result) {
result = [defaultManager createFileAtPathWithIntermediateDirectories:filePath contents:data attributes:attributes directoryAttributes:directoryAttributes];
@@ -119,10 +122,10 @@ static NSNumber *IFURLFilePosixPermissions;
NSString *filePath;
filePath = [NSString stringWithFormat:@"%@/%@", path, [IFURLFileDatabase uniqueFilePathForKey:key]];
+
[[NSFileManager defaultManager] removeFileAtPath:filePath handler:nil];
}
-// FIXME: [kocienda] Radar 2861446 (Implement removeAllObjects on concrete IFDatabase classes)
-(void)removeAllObjects
{
[self close];
@@ -145,6 +148,7 @@ static NSNumber *IFURLFilePosixPermissions;
filePath = [NSString stringWithFormat:@"%@/%@", path, [IFURLFileDatabase uniqueFilePathForKey:key]];
data = [[NSFileManager defaultManager] contentsAtPath:filePath];
+
if (data) {
unarchiver = [[NSUnarchiver alloc] initForReadingWithData:data];
fileKey = [unarchiver decodeObject];
@@ -173,6 +177,7 @@ static NSNumber *IFURLFilePosixPermissions;
-(BOOL)open
{
NSFileManager *manager;
+ NSDictionary *attributes;
BOOL isDir;
if (!isOpen) {
@@ -183,20 +188,19 @@ static NSNumber *IFURLFilePosixPermissions;
}
}
else {
- isOpen = [manager createDirectoryAtPath:path attributes:[NSDictionary dictionaryWithObjectsAndKeys:
+ attributes = [NSDictionary dictionaryWithObjectsAndKeys:
[NSDate date], @"NSFileModificationDate",
NSUserName(), @"NSFileOwnerAccountName",
IFURLFileDirectoryPosixPermissions, @"NSFilePosixPermissions",
NULL
- ]];
+ ];
+ // be optimistic that full subpath leading to directory exists
+ isOpen = [manager createDirectoryAtPath:path attributes:attributes];
if (!isOpen) {
- isOpen = [manager createDirectoryAtPathWithIntermediateDirectories:path attributes:[NSDictionary dictionaryWithObjectsAndKeys:
- [NSDate date], @"NSFileModificationDate",
- NSUserName(), @"NSFileOwnerAccountName",
- IFURLFileDirectoryPosixPermissions, @"NSFilePosixPermissions",
- NULL
- ]];
+ // perhaps the optimism did not pay off ...
+ // try again, this time creating full subpath leading to directory
+ isOpen = [manager createDirectoryAtPathWithIntermediateDirectories:path attributes:attributes];
}
}
}
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list