diff options
author | Vincent Sanders <vince@kyllikki.org> | 2014-05-13 15:55:24 +0100 |
---|---|---|
committer | Vincent Sanders <vince@kyllikki.org> | 2014-05-13 15:55:24 +0100 |
commit | 6c466c985f3c39df995b886c2b95f307d1285045 (patch) | |
tree | ec53707996fba31539e93bf19bfdc6b4ba3c84ba /desktop/gui_factory.c | |
parent | ccc9ad969b61758184e1b9129ce257cdd7c7ab4e (diff) | |
parent | 6d3f5d2338e4fa9cd880ce70ba01f665918e663a (diff) | |
download | netsurf-6c466c985f3c39df995b886c2b95f307d1285045.tar.gz netsurf-6c466c985f3c39df995b886c2b95f307d1285045.tar.bz2 |
Merge branch 'vince/llcache'
Diffstat (limited to 'desktop/gui_factory.c')
-rw-r--r-- | desktop/gui_factory.c | 41 |
1 files changed, 40 insertions, 1 deletions
diff --git a/desktop/gui_factory.c b/desktop/gui_factory.c index 756f5dd0e..45d9516fa 100644 --- a/desktop/gui_factory.c +++ b/desktop/gui_factory.c @@ -17,6 +17,8 @@ */ #include "content/hlcache.h" +#include "content/backing_store.h" + #include "desktop/download.h" #include "desktop/gui_factory.h" #include "utils/file.h" @@ -25,7 +27,6 @@ struct netsurf_table *guit = NULL; - static void gui_default_window_set_title(struct gui_window *g, const char *title) { } @@ -400,6 +401,34 @@ static nserror verify_search_register(struct gui_search_table *gst) return NSERROR_OK; } +/** verify low level cache persistant backing store table is valid */ +static nserror verify_llcache_register(struct gui_llcache_table *glt) +{ + /* check table is present */ + if (glt == NULL) { + return NSERROR_BAD_PARAMETER; + } + + /* mandantory operations */ + if (glt->store == NULL) { + return NSERROR_BAD_PARAMETER; + } + if (glt->fetch == NULL) { + return NSERROR_BAD_PARAMETER; + } + if (glt->invalidate == NULL) { + return NSERROR_BAD_PARAMETER; + } + if (glt->initialise == NULL) { + return NSERROR_BAD_PARAMETER; + } + if (glt->finalise == NULL) { + return NSERROR_BAD_PARAMETER; + } + + return NSERROR_OK; +} + static nsurl *gui_default_get_resource_url(const char *path) { return NULL; @@ -622,6 +651,16 @@ nserror gui_factory_register(struct netsurf_table *gt) return err; } + /* llcache table */ + if (gt->llcache == NULL) { + /* set default backing store table */ + gt->llcache = null_llcache_table; + } + err = verify_llcache_register(gt->llcache); + if (err != NSERROR_OK) { + return err; + } + guit = gt; return NSERROR_OK; |