Bug 722034 - Part 1 - Make AsyncOpenCacheEntry call the listener for non-blocking async requests from background threads, r=hurley
authorMichal Novotny <michal.novotny@gmail.com>
Thu, 31 May 2012 15:20:04 -0700
changeset 97634 369cb6c883309b9028fb11907a31643077302863
parent 97633 301d0d6bf24e9806c1a19670238f41164fd6c7df
child 97635 4de9e540c40f0cbbe3ee8cc36db153bcb0c21180
push idunknown
push userunknown
push dateunknown
reviewershurley
bugs722034
milestone15.0a1
Bug 722034 - Part 1 - Make AsyncOpenCacheEntry call the listener for non-blocking async requests from background threads, r=hurley
netwerk/cache/nsCacheService.cpp
--- a/netwerk/cache/nsCacheService.cpp
+++ b/netwerk/cache/nsCacheService.cpp
@@ -1754,17 +1754,17 @@ nsCacheService::ProcessRequest(nsCacheRe
         (void) ProcessPendingRequests(doomedEntry);
         if (doomedEntry->IsNotInUse())
             DeactivateEntry(doomedEntry);
         doomedEntry = nsnull;
     }
 
     if (request->mListener) {  // Asynchronous
     
-        if (NS_FAILED(rv) && calledFromOpenCacheEntry)
+        if (NS_FAILED(rv) && calledFromOpenCacheEntry && request->IsBlocking())
             return rv;  // skip notifying listener, just return rv to caller
             
         // call listener to report error or descriptor
         nsresult rv2 = NotifyListener(request, descriptor, accessGranted, rv);
         if (NS_FAILED(rv2) && NS_SUCCEEDED(rv)) {
             rv = rv2;  // trigger delete request
         }
     } else {        // Synchronous