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:
Родитель
973713ad4b
Коммит
525851d1cf
|
@ -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);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче