mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-12 04:45:45 +00:00
Bug 633146 - Remove unnecessary locking in nsCacheService::OpenCacheEntry; r=michal.novotny,bzbarsky
This commit is contained in:
parent
9e7db677a2
commit
28a4c2e085
9
netwerk/cache/nsCacheService.cpp
vendored
9
netwerk/cache/nsCacheService.cpp
vendored
@ -1637,7 +1637,6 @@ nsCacheService::OpenCacheEntry(nsCacheSession * session,
|
||||
|
||||
nsCacheRequest * request = nsnull;
|
||||
|
||||
nsCacheServiceAutoLock lock;
|
||||
nsresult rv = gService->CreateRequest(session,
|
||||
key,
|
||||
accessRequested,
|
||||
@ -1653,17 +1652,15 @@ nsCacheService::OpenCacheEntry(nsCacheSession * session,
|
||||
if (NS_IsMainThread() && listener && gService->mCacheIOThread) {
|
||||
nsCOMPtr<nsIRunnable> ev =
|
||||
new nsProcessRequestEvent(request);
|
||||
if (ev) {
|
||||
rv = gService->mCacheIOThread->Dispatch(ev, NS_DISPATCH_NORMAL);
|
||||
} else {
|
||||
rv = NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
rv = DispatchToCacheIOThread(ev);
|
||||
|
||||
// delete request if we didn't post the event
|
||||
if (NS_FAILED(rv))
|
||||
delete request;
|
||||
}
|
||||
else {
|
||||
|
||||
nsCacheServiceAutoLock lock;
|
||||
rv = gService->ProcessRequest(request, PR_TRUE, result);
|
||||
|
||||
// delete requests that have completed
|
||||
|
Loading…
Reference in New Issue
Block a user