path: root/content
diff options
authorVincent Sanders <>2015-03-15 00:00:45 +0000
committerVincent Sanders <>2015-03-15 00:00:45 +0000
commit8a99b045bc48e0c5eb89129ea8ee034c72b955de (patch)
treef2dabbca020b91b41ab3f476fca1ed2378f8ced2 /content
parent52b50db3a6f1d52b3c9e18b36121f487c09de906 (diff)
Remove url from content thumbnailers API
The content thumbnailers for each frontend were being provided the contents url. This was only ever used to call the urldb thumbnail setting API. This changes it so the single callsite that passed a valid url adds the bitmap to that url itself in desktop_history.c instead of forcing every frontend to require the urldb API. Additionally the old API could pass the url as NULL which was causing asserts where this was not an expected parameter value. Because of this this fixes bug #2286 which was also present in the monkey frontend as both called nsurl_access() on the url without the NULL check and caused an assertion.
Diffstat (limited to 'content')
1 files changed, 7 insertions, 5 deletions
diff --git a/content/urldb.c b/content/urldb.c
index e7cb551d0..f77f597c4 100644
--- a/content/urldb.c
+++ b/content/urldb.c
@@ -3061,13 +3061,15 @@ void urldb_set_thumbnail(nsurl *url, struct bitmap *bitmap)
p = urldb_find_url(url);
- if (!p)
- return;
+ if (p != NULL) {
- if (p->thumb && p->thumb != bitmap)
- bitmap_destroy(p->thumb);
+ LOG(("Setting bitmap on %s", nsurl_access(url)));
- p->thumb = bitmap;
+ if (p->thumb && p->thumb != bitmap)
+ bitmap_destroy(p->thumb);
+ p->thumb = bitmap;
+ }