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 2006-05-17 02:29:04 +00:00
Родитель 3d6c6d7bed
Коммит 30ec787f12
1 изменённых файлов: 5 добавлений и 6 удалений

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

@ -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);
}