diff options
author | John Mark Bell <jmb@netsurf-browser.org> | 2010-04-11 16:37:39 +0000 |
---|---|---|
committer | John Mark Bell <jmb@netsurf-browser.org> | 2010-04-11 16:37:39 +0000 |
commit | ff8791a3f79426fc49f4bb01a12e2c6c975fc455 (patch) | |
tree | 1011974304ea2218547884f8caae76a7d396b67b | |
parent | 7577e2a1e6a2b1c3b61cc01b3f3f18476afa05fb (diff) | |
download | netsurf-ff8791a3f79426fc49f4bb01a12e2c6c975fc455.tar.gz netsurf-ff8791a3f79426fc49f4bb01a12e2c6c975fc455.tar.bz2 |
Ensure content can be shared when retrieving from cache
svn path=/trunk/netsurf/; revision=10361
-rw-r--r-- | content/content.c | 11 | ||||
-rw-r--r-- | content/content.h | 1 | ||||
-rw-r--r-- | content/hlcache.c | 5 |
3 files changed, 16 insertions, 1 deletions
diff --git a/content/content.c b/content/content.c index ba4db702c..c215ed1f8 100644 --- a/content/content.c +++ b/content/content.c @@ -989,6 +989,17 @@ bool content_matches_quirks(struct content *c, bool quirks) } /** + * Determine if a content is shareable + * + * \param c Content to consider + * \return True if content is shareable, false otherwise + */ +bool content_is_shareable(struct content *c) +{ + return handler_map[c->type].no_share == false; +} + +/** * Send a message to all users. */ diff --git a/content/content.h b/content/content.h index f8838de2a..fbdb93454 100644 --- a/content/content.h +++ b/content/content.h @@ -104,6 +104,7 @@ void content_remove_user(struct content *c, uint32_t content_count_users(struct content *c); bool content_matches_quirks(struct content *c, bool quirks); +bool content_is_shareable(struct content *c); const struct llcache_handle *content_get_llcache_handle(struct content *c); diff --git a/content/hlcache.c b/content/hlcache.c index 3627343ad..2dd3c1526 100644 --- a/content/hlcache.c +++ b/content/hlcache.c @@ -427,7 +427,6 @@ nserror hlcache_find_content(hlcache_retrieval_ctx *ctx) hlcache_handle entry_handle = { entry, NULL, NULL }; const llcache_handle *entry_llcache; - /** \todo Need to ensure that content is shareable */ /** \todo Need to ensure that content can be reused */ if (entry->content == NULL) continue; @@ -436,6 +435,10 @@ nserror hlcache_find_content(hlcache_retrieval_ctx *ctx) if (content_get_status(&entry_handle) == CONTENT_STATUS_ERROR) continue; + /* Ensure that content is shareable */ + if (content_is_shareable(entry->content) == false) + continue; + /* Ensure that quirks mode is acceptable */ if (content_matches_quirks(entry->content, ctx->child.quirks) == false) |