diff options
Diffstat (limited to 'content')
-rw-r--r-- | content/content.c | 16 | ||||
-rw-r--r-- | content/content.h | 11 | ||||
-rw-r--r-- | content/content_protected.h | 1 |
3 files changed, 27 insertions, 1 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) diff --git a/content/content.h b/content/content.h index 67a519df6..bc47ffef0 100644 --- a/content/content.h +++ b/content/content.h @@ -90,7 +90,8 @@ typedef enum { /** Debugging dump operations */ enum content_debug { CONTENT_DEBUG_RENDER, /** Debug the contents rendering. */ - CONTENT_DEBUG_DOM /** Debug teh contents Document Object. */ + CONTENT_DEBUG_DOM, /** Debug the contents Document Object. */ + CONTENT_DEBUG_REDRAW /** Debug redraw operations. */ }; /** RFC5988 metadata link */ @@ -300,6 +301,14 @@ void content_search_clear(struct hlcache_handle *h); */ nserror content_debug_dump(struct hlcache_handle *h, FILE *f, enum content_debug op); +/** + * Control debug con a content. + * + * \param h content handle to debug. + * \param op Debug operation type. + */ +nserror content_debug(struct hlcache_handle *h, enum content_debug op); + struct content_rfc5988_link *content_find_rfc5988_link(struct hlcache_handle *c, lwc_string *rel); diff --git a/content/content_protected.h b/content/content_protected.h index ce161befc..af274ef5a 100644 --- a/content/content_protected.h +++ b/content/content_protected.h @@ -77,6 +77,7 @@ struct content_handler { const char *string); void (*search_clear)(struct content *c); nserror (*debug_dump)(struct content *c, FILE *f, enum content_debug op); + nserror (*debug)(struct content *c, enum content_debug op); nserror (*clone)(const struct content *old, struct content **newc); bool (*matches_quirks)(const struct content *c, bool quirks); const char *(*get_encoding)(const struct content *c); |