diff options
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; |