diff options
author | Daniel Silverstone <dsilvers@digital-scurf.org> | 2019-05-05 15:37:56 +0100 |
---|---|---|
committer | Daniel Silverstone <dsilvers@digital-scurf.org> | 2019-05-05 16:00:03 +0100 |
commit | f3892c98fdc734a0abca136ab712c94246fe66c0 (patch) | |
tree | c7ea397b8801893f6aa4c751ef974390f5488648 /content/content.c | |
parent | ec0028bdb96a03f83055f2798c498a36142d6b03 (diff) | |
download | netsurf-f3892c98fdc734a0abca136ab712c94246fe66c0.tar.gz netsurf-f3892c98fdc734a0abca136ab712c94246fe66c0.tar.bz2 |
Add content_exec and associated vtable entry
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
Diffstat (limited to 'content/content.c')
-rw-r--r-- | content/content.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/content/content.c b/content/content.c index 869750100..bb5c47b33 100644 --- a/content/content.c +++ b/content/content.c @@ -545,6 +545,27 @@ void content__request_redraw(struct content *c, content_broadcast(c, CONTENT_MSG_REDRAW, &data); } +/* exported interface, documented in content/content.h */ +bool content_exec(struct hlcache_handle *h, const char *src, size_t srclen) +{ + struct content *c = hlcache_handle_get_content(h); + + assert(c != NULL); + + if (c->locked) { + /* Not safe to do stuff */ + NSLOG(netsurf, DEEPDEBUG, "Unable to exec, content locked"); + return false; + } + + if (c->handler->exec == NULL) { + /* Can't exec something on this content */ + NSLOG(netsurf, DEEPDEBUG, "Unable to exec, no exec function"); + return false; + } + + return c->handler->exec(c, src, srclen); +} /* exported interface, documented in content/content.h */ bool content_redraw(hlcache_handle *h, struct content_redraw_data *data, |