[not part of build]

Restructured open cache entry code in preparation for async implementation, to better share code with synchronous version.

Changed nsCacheRequest, nsCacheEntry, nsCacheEntryDescriptor to inherit from PRCList rather than include mListLink member, and removed extraneous GetListNode/GetInstance methods.

Consolidated mAccessRequested, mStreamBased, and mStoragePolicy into a single PRUint32 in nsCacheRequest.  Added PRLock, PRCondVar, and a 'wait for validation' flag, used for synchronously opening cache entries.  Added accessor functions for these "attributes".

Record current event queue for asychronous requests to be used with GetProxyForObject().  Removed mRequestThread.


git-svn-id: svn://10.0.0.236/trunk@88535 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
gordon%netscape.com
2001-03-05 07:17:58 +00:00
parent b2477d93b9
commit 0ea21fde31
9 changed files with 266 additions and 80 deletions

View File

@@ -67,8 +67,8 @@ nsMemoryCacheDevice::FindEntry(nsCString * key)
if (!entry) return nsnull;
// move entry to the tail of the eviction list
PR_REMOVE_AND_INIT_LINK(entry->GetListNode());
PR_APPEND_LINK(entry->GetListNode(), &mEvictionList);
PR_REMOVE_AND_INIT_LINK(entry);
PR_APPEND_LINK(entry, &mEvictionList);
return entry;;
}
@@ -98,15 +98,15 @@ nsMemoryCacheDevice::DeactivateEntry(nsCacheEntry * entry)
nsresult
nsMemoryCacheDevice::BindEntry(nsCacheEntry * entry)
{
NS_ASSERTION(PR_CLIST_IS_EMPTY(entry->GetListNode()),"entry is already on a list!");
NS_ASSERTION(PR_CLIST_IS_EMPTY(entry),"entry is already on a list!");
// append entry to the eviction list
PR_APPEND_LINK(entry->GetListNode(), &mEvictionList);
PR_APPEND_LINK(entry, &mEvictionList);
// add entry to hashtable of mem cache entries
nsresult rv = mMemCacheEntries.AddEntry(entry);
if (NS_FAILED(rv)) {
PR_REMOVE_AND_INIT_LINK(entry->GetListNode());
PR_REMOVE_AND_INIT_LINK(entry);
return rv;
}
@@ -123,7 +123,7 @@ nsMemoryCacheDevice::DoomEntry(nsCacheEntry * entry)
if (NS_FAILED(rv)) return rv;
// remove entry from our eviction list
PR_REMOVE_AND_INIT_LINK(entry->GetListNode());
PR_REMOVE_AND_INIT_LINK(entry);
return NS_OK;
}