[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:23:42 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 2a1198267a3504acbabcf006c553b454be3c4c4e
Author: darin <darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Jul 10 20:50:32 2002 +0000

    	Fix the underlying cause of a deadlock problem that I saw. It's important that IFURLHandle
    	drops its references to the handle clients on the thread that it's using for client notification
    	rather than the thread it happens to be deallocated on.
    
    	Also fix things so that the notifications can be sent without holding the lock the whole time,
    	by making a copy of the client array and any parameters, and fix one small problem related to this.
    
    	Use makeObjectsPerformSelector in a lot more places, and do a few other cleanups.
    
            * CacheLoader.subproj/IFURLHandle.m:
            (-[IFURLHandleSynchronousClient initWithHandle:monitor:]): Remove unneeded [self release] in the
    	case where self is nil.
            (-[IFURLHandle _didRedirectToURL:]): Lock around changes to the redirectedURL so we don't access
    	the object from the callback thread when it's invalid.
            (-[IFURLHandle _notifyClientsDidBeginLoading]): Do notifications outside the lock.
            (-[IFURLHandle _notifyClientsDidCancelLoading]): Do notifications outside the lock. Also empty
    	out the clients array because we are at an end state. It's important to empty it out here from
    	the thread we are calling back on rather than from dealloc on whatever thread that is called on.
            (-[IFURLHandle _notifyClientsDataDidBecomeAvailable]): Do notifications outside the lock.
            (-[IFURLHandle _notifyClientsDidFinishLoading]): Do notifications outside the lock. Also empty
    	out the clients array because we are at an end state. It's important to empty it out here from
    	the thread we are calling back on rather than from dealloc on whatever thread that is called on.
            (-[IFURLHandle _notifyClientsDidFailLoading]): Do notifications outside the lock. Also empty
    	out the clients array because we are at an end state. It's important to empty it out here from
    	the thread we are calling back on rather than from dealloc on whatever thread that is called on.
            (-[IFURLHandle _notifyClientsDidRedirectToURL]): Do notifications outside the lock.
    
            * AuthenticationManager.subproj/IFAuthenticationManager.m:
            (-[IFAuthenticationManager _retryWaitingRequests]): Remove unnecessary copy/autorelease since
    	we are the sole owner of the waitingRequests array.
    
            * CacheLoader.subproj/IFHTTPURLProtocolHandler.m:
            (-[IFHTTPURLProtocolHandler setRedirectedURL:]): Use makeObjectsPerformSelector for simplicity.
    	Also remove the exception handler since the handles accessor now does a copy/autorelease.
            (-[IFHTTPURLProtocolHandler setResponseHeaders:]): Use makeObjectsPerformSelector for simplicity.
    	Also remove the exception handler since the handles accessor now does a copy/autorelease.
    
            * CacheLoader.subproj/IFURLLoad.m:
            (-[IFURLLoad handles]): Return a copied auto-released version.
            (-[IFURLLoad updateHandles]): Use makeObjectsPerformSelector for simplicity.
    
            * Database.subproj/IFURLFileDatabase.m:
            (-[IFURLFileDatabase sync]): Remove unnecessary checks for nil and empty array in cases that
    	the nil behavior of Objective C already takes care of. Use makeObjectsPerformSelector for simplicity.
    
            * Misc.subproj/IFFileTypeMappings.m:
            (-[IFFileTypeMappingsPrivate init]): Create a reverse mapping dictionary too, so we can map in both
    	directions quickly. Also fix a storage leak in the failure case.
            (-[IFFileTypeMappings _init]): Fix a storage leak in the failure case.
            (-[IFFileTypeMappings MIMETypeForExtension:]): Use the new reverse dictionary.
    
            * Misc.subproj/IFNSArrayExtensions.h: Add _IF_makeObjectsPerformSelector:withObject:withObject:.
            * Misc.subproj/IFNSArrayExtensions.m: Fix name in comment for the benefit of the renamings script.
            (-[NSArray _IF_makeObjectsPerformSelector:withObject:withObject:]): Added. Stole the algorithm
    	from NSArray.m.
    
            * Misc.subproj/IFNSObjectExtensions.m: Fix name in comment for the benefit of the renamings script.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@1525 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/Misc.subproj/WebFileDatabase.m b/WebKit/Misc.subproj/WebFileDatabase.m
index 9d6f5ec..d7fd442 100644
--- a/WebKit/Misc.subproj/WebFileDatabase.m
+++ b/WebKit/Misc.subproj/WebFileDatabase.m
@@ -815,33 +815,21 @@ static void databaseInit()
 -(void)sync
 {
     NSArray *array;
-    int opCount;
-    int i;
-    IFURLFileDatabaseOp *op;
 
     touch = CFAbsoluteTimeGetCurrent();
     
-    array = nil;
-
     [mutex lock];
-    if ([ops count] > 0) {
-        array = [NSArray arrayWithArray:ops];
-        [ops removeAllObjects];
-    }
-    if (timer) {
-        [timer invalidate];
-        [timer autorelease];
-        timer = nil;
-    }
+    array = [ops copy];
+    [ops removeAllObjects];
+    [timer invalidate];
+    [timer autorelease];
+    timer = nil;
     [setCache removeAllObjects];
     [removeCache removeAllObjects];
     [mutex unlock];
 
-    opCount = [array count];
-    for (i = 0; i < opCount; i++) {
-        op = [array objectAtIndex:i];
-        [op perform:self];
-    }
+    [array makeObjectsPerformSelector:@selector(perform:) withObject:self];
+    [array release];
 }
 
 -(unsigned)count

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list