diff options
author | John Mark Bell <jmb@netsurf-browser.org> | 2010-04-09 18:52:44 +0000 |
---|---|---|
committer | John Mark Bell <jmb@netsurf-browser.org> | 2010-04-09 18:52:44 +0000 |
commit | 4a4cc0d1bce9967fcd1fed4cea12c008702a38fc (patch) | |
tree | 42b2dce595096120ef57f022bd8c05275b9c1999 /content/content.c | |
parent | b2124867dba7c5cc5851bcb08448c02a8ef8718b (diff) | |
download | netsurf-4a4cc0d1bce9967fcd1fed4cea12c008702a38fc.tar.gz netsurf-4a4cc0d1bce9967fcd1fed4cea12c008702a38fc.tar.bz2 |
Introduce content_set_ready.
Make content_convert emit events only if content is in appropriate state.
Remove no-longer-relevant assertion from content_convert.
svn path=/trunk/netsurf/; revision=10330
Diffstat (limited to 'content/content.c')
-rw-r--r-- | content/content.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/content/content.c b/content/content.c index 2bf94431d..a5890e970 100644 --- a/content/content.c +++ b/content/content.c @@ -646,8 +646,6 @@ void content_update_status(struct content *c) void content_convert(struct content *c) { - union content_msg_data msg_data; - assert(c); assert(c->type < HANDLER_MAP_COUNT); assert(c->status == CONTENT_STATUS_LOADING); @@ -661,21 +659,30 @@ void content_convert(struct content *c) if (handler_map[c->type].convert) { if (!handler_map[c->type].convert(c)) { c->status = CONTENT_STATUS_ERROR; - c->locked = false; - return; } } else { c->status = CONTENT_STATUS_DONE; } c->locked = false; - assert(c->status == CONTENT_STATUS_READY || - c->status == CONTENT_STATUS_DONE); - content_broadcast(c, CONTENT_MSG_READY, msg_data); + if (c->status == CONTENT_STATUS_READY) + content_set_ready(c); if (c->status == CONTENT_STATUS_DONE) content_set_done(c); } +/** + * Put a content in status CONTENT_STATUS_READY. + */ + +void content_set_ready(struct content *c) +{ + union content_msg_data msg_data; + + c->status = CONTENT_STATUS_READY; + content_update_status(c); + content_broadcast(c, CONTENT_MSG_READY, msg_data); +} /** * Put a content in status CONTENT_STATUS_DONE. |