From dec633ca8e4c2eef3139579dcd83736dcd14c5f6 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Thu, 8 Sep 2011 12:04:57 +0000 Subject: make high level cache take a parameter structure make hlcache have a single global container svn path=/trunk/netsurf/; revision=12779 --- content/hlcache.h | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'content/hlcache.h') diff --git a/content/hlcache.h b/content/hlcache.h index 714fcce45..196e689bb 100644 --- a/content/hlcache.h +++ b/content/hlcache.h @@ -42,6 +42,21 @@ typedef struct { union content_msg_data data; /**< Event data */ } hlcache_event; +struct hlcache_parameters { + llcache_query_callback cb; /**< Query handler for llcache */ + void *cb_ctx; /**< Pointer to llcache query handler data */ + + /** How frequently the background cache clean process is run (ms) */ + unsigned int bg_clean_time; + + /** The target upper bound for the cache size */ + size_t limit; + + /** The hysteresis allowed round the target size */ + size_t hysteresis; + +}; + /** * Client callback for high-level cache events * @@ -68,11 +83,10 @@ enum hlcache_retrieve_flag { /** * Initialise the high-level cache, preparing the llcache also. * - * \param cb Query handler for llcache - * \param pw Pointer to llcache query handler data + * \param hlcache_parameters Settings to initialise cache with * \return NSERROR_OK on success, appropriate error otherwise. */ -nserror hlcache_initialise(llcache_query_callback cb, void *pw); +nserror hlcache_initialise(const struct hlcache_parameters *hlcache_parameters); /** * Stop the high-level cache periodic functionality so that the -- cgit v1.2.3