From be77f764e296d18f9d463adbddf3950a5a316010 Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Thu, 23 Mar 2017 14:18:37 +0000 Subject: Improve content logging with content IDs (pointer values). This makes it easier to track a content by its ID through a log. --- render/html.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'render') diff --git a/render/html.c b/render/html.c index 6f7ad6249..544b7b61a 100644 --- a/render/html.c +++ b/render/html.c @@ -686,8 +686,9 @@ dom_default_action_DOMNodeInserted_cb(struct dom_event *evt, void *pw) content_broadcast(&htmlc->base, CONTENT_MSG_GETCTX, msg_data); - LOG("javascript context: %p", - htmlc->jscontext); + LOG("javascript context: %p (htmlc: %p)", + htmlc->jscontext, + htmlc); } if (htmlc->jscontext != NULL) { js_handle_new_element(htmlc->jscontext, @@ -1142,7 +1143,7 @@ static bool html_convert(struct content *c) } htmlc->base.active--; /* the html fetch is no longer active */ - LOG("%d fetches active", htmlc->base.active); + LOG("%d fetches active (%p)", htmlc->base.active, c); /* The parse cannot be completed here because it may be paused * untill all the resources being fetched have completed. @@ -1195,7 +1196,7 @@ html_begin_conversion(html_content *htmlc) * complete to avoid repeating the completion pointlessly. */ if (htmlc->parse_completed == false) { - LOG("Completing parse"); + LOG("Completing parse (%p)", htmlc); /* complete parsing */ error = dom_hubbub_parser_completed(htmlc->parser); if (error != DOM_HUBBUB_OK) { @@ -1210,12 +1211,15 @@ html_begin_conversion(html_content *htmlc) } if (html_can_begin_conversion(htmlc) == false) { + LOG("Can't begin conversion (%p)", htmlc); /* We can't proceed (see commentary above) */ return true; } /* Give up processing if we've been aborted */ if (htmlc->aborted) { + LOG("Conversion aborted (%p) (active: %u)", htmlc, + htmlc->base.active); content_broadcast_errorcode(&htmlc->base, NSERROR_STOPPED); return false; } @@ -1366,7 +1370,7 @@ static void html_stop(struct content *c) break; default: - LOG("Unexpected status %d", c->status); + LOG("Unexpected status %d (%p)", c->status, c); assert(0); } } -- cgit v1.2.3