summaryrefslogtreecommitdiff
path: root/content/hlcache.c
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2011-12-04 14:55:23 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2011-12-04 14:55:23 +0000
commitf2993e6ed037023e28837c7c666627380235bd14 (patch)
tree8d3d27a37e14a49a33a327074d08fb7177b3834c /content/hlcache.c
parent890bb679939c9ecde30af7ed752e292bfe6feb28 (diff)
downloadnetsurf-f2993e6ed037023e28837c7c666627380235bd14.tar.gz
netsurf-f2993e6ed037023e28837c7c666627380235bd14.tar.bz2
content_get_url -> hlcache_handle_get_url, content__get_url -> content_get_url
svn path=/trunk/netsurf/; revision=13236
Diffstat (limited to 'content/hlcache.c')
-rw-r--r--content/hlcache.c29
1 files changed, 28 insertions, 1 deletions
diff --git a/content/hlcache.c b/content/hlcache.c
index 954f9a63d..88c88dfc9 100644
--- a/content/hlcache.c
+++ b/content/hlcache.c
@@ -176,7 +176,7 @@ void hlcache_finalise(void)
if (entry->content != NULL) {
LOG((" %p : %s (%d users)", entry,
- nsurl_access(content_get_url(&entry_handle)), content_count_users(entry->content)));
+ nsurl_access(hlcache_handle_get_url(&entry_handle)), content_count_users(entry->content)));
} else {
LOG((" %p", entry));
}
@@ -416,6 +416,33 @@ nserror hlcache_handle_clone(hlcache_handle *handle, hlcache_handle **result)
return NSERROR_CLONE_FAILED;
}
+/* See hlcache.h for documentation */
+nsurl *hlcache_handle_get_url(const hlcache_handle *handle)
+{
+ nsurl *result = NULL;
+
+ assert(handle != NULL);
+
+ if (handle->entry != NULL) {
+ result = content_get_url(handle->entry->content);
+ } else {
+ RING_ITERATE_START(struct hlcache_retrieval_ctx,
+ hlcache->retrieval_ctx_ring,
+ ictx) {
+ if (ictx->handle == handle) {
+ /* This is the nascent context for us */
+ result = llcache_handle_get_url(ictx->llcache);
+
+ /* And stop */
+ RING_ITERATE_STOP(hlcache->retrieval_ctx_ring,
+ ictx);
+ }
+ } RING_ITERATE_END(hlcache->retrieval_ctx_ring, ictx);
+ }
+
+ return result;
+}
+
/******************************************************************************
* High-level cache internals *
******************************************************************************/