diff --git a/gfx/public/nsIImageManager.h b/gfx/public/nsIImageManager.h index 03b4b284437..40361ed2994 100644 --- a/gfx/public/nsIImageManager.h +++ b/gfx/public/nsIImageManager.h @@ -68,6 +68,12 @@ public: */ virtual PRInt32 ShrinkCache(void) = 0; + /** + * Flush the image cache as much as possible. The only images not + * flushed out will be those that are in use. + */ + NS_IMETHOD FlushCache(void) = 0; + /** * Determine the type of the image, based on the first few bytes of data. * diff --git a/gfx/src/nsImageManager.cpp b/gfx/src/nsImageManager.cpp index 5c4d969426e..2b526e3487f 100644 --- a/gfx/src/nsImageManager.cpp +++ b/gfx/src/nsImageManager.cpp @@ -38,6 +38,7 @@ public: virtual void SetCacheSize(PRInt32 aCacheSize); virtual PRInt32 GetCacheSize(void); virtual PRInt32 ShrinkCache(void); + NS_IMETHOD FlushCache(void); virtual nsImageType GetImageType(const char *buf, PRInt32 length); private: @@ -98,6 +99,13 @@ ImageManagerImpl::ShrinkCache(void) { return IL_ShrinkCache(); } + +NS_IMETHODIMP +ImageManagerImpl::FlushCache(void) +{ + IL_FlushCache(); + return NS_OK; +} nsImageType ImageManagerImpl::GetImageType(const char *buf, PRInt32 length)