Fix bug 73441 "New cache needs "Clear" functionality. Changed pref advanced cache panel clear buttons to clear new cache devices, and fixed bug in nsMemoryCacheDevice to avoid calling nsCRT::strlen(nsnull). sr=darin.

This commit is contained in:
gordon%netscape.com 2001-04-09 09:52:15 +00:00
Родитель 973713ad4b
Коммит 525851d1cf
2 изменённых файлов: 6 добавлений и 7 удалений

2
netwerk/cache/src/nsMemoryCacheDevice.cpp поставляемый
Просмотреть файл

@ -364,7 +364,7 @@ nsresult
nsMemoryCacheDevice::EvictEntries(const char * clientID)
{
nsCacheEntry * entry;
PRUint32 prefixLength = nsCRT::strlen(clientID);
PRUint32 prefixLength = (clientID ? nsCRT::strlen(clientID) : 0);
PRCList * elem = PR_LIST_HEAD(&mEvictionList);
while (elem != &mEvictionList) {

Просмотреть файл

@ -26,18 +26,17 @@ function prefCacheSelectFolder()
function prefClearCache(aType)
{
var cacheService = Components.classes['@mozilla.org/network/cache;1?name=manager']
.getService(nsINetDataCacheManager);
cacheService.clear(aType);
var classID = Components.classes["@mozilla.org/network/cache-service;1"];
var cacheService = classID.getService(Components.interfaces.nsICacheService);
cacheService.evictEntries(aType);
}
function prefClearMemCache()
{
prefClearCache(nsINetDataCacheManager.MEM_CACHE);
prefClearCache(Components.interfaces.nsICache.STORE_IN_MEMORY);
}
function prefClearDiskCache()
{
prefClearCache(nsINetDataCacheManager.FILE_CACHE |
nsINetDataCacheManager.FLAT_CACHE);
prefClearCache(Components.interfaces.nsICache.STORE_ON_DISK);
}