fix for bug 38322 r=cmanske sr=jst a=tor

This commit is contained in:
pavlov%netscape.com 2001-06-18 06:36:37 +00:00
Родитель 9fc5103445
Коммит 5a9a9bd2e7
2 изменённых файлов: 24 добавлений и 1 удалений

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

@ -23,6 +23,8 @@
#include "nsISupports.idl"
interface nsIURI;
/**
* imgICache interface
*
@ -40,4 +42,13 @@ interface imgICache : nsISupports
* If FALSE, evict everything except chrome images.
*/
void clearCache(in boolean chrome);
/**
* Evict images from the cache.
*
* @param uri The URI to remove.
* @return NS_OK if \a uri was removed from the cache.
* NS_ERROR_NOT_AVAILABLE if \a uri was unable to be removed from the cache.
*/
void removeEntry(in nsIURI uri);
};

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

@ -58,6 +58,16 @@ NS_IMETHODIMP imgCache::ClearCache(PRBool chrome)
return imgCache::ClearImageCache();
}
/* void removeEntry(in nsIURI uri); */
NS_IMETHODIMP imgCache::RemoveEntry(nsIURI *uri)
{
if (imgCache::Remove(uri))
return NS_OK;
return NS_ERROR_NOT_AVAILABLE;
}
static nsCOMPtr<nsICacheSession> gSession = nsnull;
static nsCOMPtr<nsICacheSession> gChromeSession = nsnull;
@ -129,6 +139,8 @@ nsresult imgCache::ClearImageCache()
return gSession->EvictEntries();
}
PRBool imgCache::Put(nsIURI *aKey, imgRequest *request, nsICacheEntryDescriptor **aEntry)
{
LOG_STATIC_FUNC(gImgLog, "imgCache::Put");
@ -197,9 +209,9 @@ PRBool imgCache::Get(nsIURI *aKey, imgRequest **aRequest, nsICacheEntryDescripto
PRBool imgCache::Remove(nsIURI *aKey)
{
LOG_STATIC_FUNC(gImgLog, "imgCache::Remove");
if (!aKey) return PR_FALSE;
nsresult rv;
nsCOMPtr<nsICacheSession> ses;
GetCacheSession(aKey, getter_AddRefs(ses));
if (!ses) return PR_FALSE;