diff options
author | Vincent Sanders <vince@kyllikki.org> | 2014-11-06 22:51:46 +0000 |
---|---|---|
committer | Vincent Sanders <vince@kyllikki.org> | 2014-11-06 22:51:46 +0000 |
commit | 8c2cfecfb5e83d023609914dd101c23777fd2906 (patch) | |
tree | df076fe2b22f0ecc6ec97d32a6b59f8ffa278d9b /content/content.c | |
parent | 46f369ca9ee79af5e7a121551fe9715101d27395 (diff) | |
download | netsurf-8c2cfecfb5e83d023609914dd101c23777fd2906.tar.gz netsurf-8c2cfecfb5e83d023609914dd101c23777fd2906.tar.bz2 |
Allow content handlers to have debug values set through API
Previously content handler debugging features were accessed by global
variables. This allows the setting of debugging parameters via a
content API giving per content control over debugging features.
Currently only used by the html content handler to toggle global
redraw debugging.
Diffstat (limited to 'content/content.c')
-rw-r--r-- | content/content.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/content/content.c b/content/content.c index 728147f31..83fdacf78 100644 --- a/content/content.c +++ b/content/content.c @@ -872,6 +872,22 @@ nserror content_debug_dump(struct hlcache_handle *h, FILE *f, enum content_debug return c->handler->debug_dump(c, f, op); } +/* exported interface documented in content/content.h */ +nserror content_debug(struct hlcache_handle *h, enum content_debug op) +{ + struct content *c = hlcache_handle_get_content(h); + + if (c == NULL) { + return NSERROR_BAD_PARAMETER; + } + + if (c->handler->debug == NULL) { + return NSERROR_NOT_IMPLEMENTED; + } + + return c->handler->debug(c, op); +} + void content_add_error(struct content *c, const char *token, unsigned int line) |