diff options
author | Vincent Sanders <vince@netsurf-browser.org> | 2011-09-08 12:04:57 +0000 |
---|---|---|
committer | Vincent Sanders <vince@netsurf-browser.org> | 2011-09-08 12:04:57 +0000 |
commit | dec633ca8e4c2eef3139579dcd83736dcd14c5f6 (patch) | |
tree | c61499a527a319b1a14484d6adbf169d8b262fd0 /content/hlcache.h | |
parent | f6ac059a05b65bd9e93ba59fd932e3f8568a250a (diff) | |
download | netsurf-dec633ca8e4c2eef3139579dcd83736dcd14c5f6.tar.gz netsurf-dec633ca8e4c2eef3139579dcd83736dcd14c5f6.tar.bz2 |
make high level cache take a parameter structure
make hlcache have a single global container
svn path=/trunk/netsurf/; revision=12779
Diffstat (limited to 'content/hlcache.h')
-rw-r--r-- | content/hlcache.h | 20 |
1 files changed, 17 insertions, 3 deletions
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 |