content: Rename content_broadcast_errorcode()

Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
This commit is contained in:
Daniel Silverstone 2019-08-05 15:25:15 +01:00
parent 6ba199c7d7
commit 2be3ebd918
13 changed files with 70 additions and 61 deletions

View File

@ -810,7 +810,7 @@ void content_broadcast(struct content *c, content_msg msg,
} }
/* exported interface documented in content_protected.h */ /* exported interface documented in content_protected.h */
void content_broadcast_errorcode(struct content *c, nserror errorcode) void content_broadcast_error(struct content *c, nserror errorcode, const char *msg)
{ {
struct content_user *user, *next; struct content_user *user, *next;
union content_msg_data data; union content_msg_data data;
@ -818,7 +818,7 @@ void content_broadcast_errorcode(struct content *c, nserror errorcode)
assert(c); assert(c);
data.errordata.errorcode = errorcode; data.errordata.errorcode = errorcode;
data.errordata.errormsg = NULL; data.errordata.errormsg = msg;
for (user = c->user_list->next; user != 0; user = next) { for (user = c->user_list->next; user != 0; user = next) {
next = user->next; /* user may be destroyed during callback */ next = user->next; /* user may be destroyed during callback */

View File

@ -174,9 +174,13 @@ void content_set_status(struct content *c, const char *status_message);
void content_broadcast(struct content *c, content_msg msg, void content_broadcast(struct content *c, content_msg msg,
const union content_msg_data *data); const union content_msg_data *data);
/** /**
* Send an errorcode message to all users. * Send an error message to all users.
*
* \param c The content whose users should be informed of an error
* \param errorcode The nserror code to send
* \param msg The error message to send alongside
*/ */
void content_broadcast_errorcode(struct content *c, nserror errorcode); void content_broadcast_error(struct content *c, nserror errorcode, const char *msg);
void content_add_error(struct content *c, const char *token, void content_add_error(struct content *c, const char *token,
unsigned int line); unsigned int line);

View File

@ -168,7 +168,7 @@ nscss_create(const content_handler *handler,
xnsbase, charset, result->base.quirks, xnsbase, charset, result->base.quirks,
nscss_content_done, result); nscss_content_done, result);
if (error != NSERROR_OK) { if (error != NSERROR_OK) {
content_broadcast_errorcode(&result->base, NSERROR_NOMEM); content_broadcast_error(&result->base, NSERROR_NOMEM, NULL);
if (charset_value != NULL) if (charset_value != NULL)
lwc_string_unref(charset_value); lwc_string_unref(charset_value);
free(result); free(result);
@ -251,7 +251,7 @@ nscss_process_data(struct content *c, const char *data, unsigned int size)
error = nscss_process_css_data(&css->data, data, size); error = nscss_process_css_data(&css->data, data, size);
if (error != CSS_OK && error != CSS_NEEDDATA) { if (error != CSS_OK && error != CSS_NEEDDATA) {
content_broadcast_errorcode(c, NSERROR_CSS); content_broadcast_error(c, NSERROR_CSS, NULL);
} }
return (error == CSS_OK || error == CSS_NEEDDATA); return (error == CSS_OK || error == CSS_NEEDDATA);
@ -285,7 +285,7 @@ bool nscss_convert(struct content *c)
error = nscss_convert_css_data(&css->data); error = nscss_convert_css_data(&css->data);
if (error != CSS_OK) { if (error != CSS_OK) {
content_broadcast_errorcode(c, NSERROR_CSS); content_broadcast_error(c, NSERROR_CSS, NULL);
return false; return false;
} }
@ -480,7 +480,7 @@ void nscss_content_done(struct content_css_data *css, void *pw)
/* Retrieve the size of this sheet */ /* Retrieve the size of this sheet */
error = css_stylesheet_size(css->sheet, &size); error = css_stylesheet_size(css->sheet, &size);
if (error != CSS_OK) { if (error != CSS_OK) {
content_broadcast_errorcode(c, NSERROR_CSS); content_broadcast_error(c, NSERROR_CSS, NULL);
content_set_error(c); content_set_error(c);
return; return;
} }

View File

@ -120,9 +120,9 @@ static void html_box_convert_done(html_content *c, bool success)
html_object_free_objects(c); html_object_free_objects(c);
if (success == false) { if (success == false) {
content_broadcast_errorcode(&c->base, NSERROR_BOX_CONVERT); content_broadcast_error(&c->base, NSERROR_BOX_CONVERT, NULL);
} else { } else {
content_broadcast_errorcode(&c->base, NSERROR_STOPPED); content_broadcast_error(&c->base, NSERROR_STOPPED, NULL);
} }
content_set_error(&c->base); content_set_error(&c->base);
@ -144,7 +144,7 @@ static void html_box_convert_done(html_content *c, bool success)
* like the other error paths * like the other error paths
*/ */
NSLOG(netsurf, INFO, "error retrieving html element from dom"); NSLOG(netsurf, INFO, "error retrieving html element from dom");
content_broadcast_errorcode(&c->base, NSERROR_DOM); content_broadcast_error(&c->base, NSERROR_DOM, NULL);
content_set_error(&c->base); content_set_error(&c->base);
return; return;
} }
@ -154,7 +154,7 @@ static void html_box_convert_done(html_content *c, bool success)
if (err != NSERROR_OK) { if (err != NSERROR_OK) {
NSLOG(netsurf, INFO, "imagemap extraction failed"); NSLOG(netsurf, INFO, "imagemap extraction failed");
html_object_free_objects(c); html_object_free_objects(c);
content_broadcast_errorcode(&c->base, err); content_broadcast_error(&c->base, err, NULL);
content_set_error(&c->base); content_set_error(&c->base);
dom_node_unref(html); dom_node_unref(html);
return; return;
@ -602,7 +602,7 @@ void html_finish_conversion(html_content *htmlc)
/* Bail out if we've been aborted */ /* Bail out if we've been aborted */
if (htmlc->aborted) { if (htmlc->aborted) {
content_broadcast_errorcode(&htmlc->base, NSERROR_STOPPED); content_broadcast_error(&htmlc->base, NSERROR_STOPPED, NULL);
content_set_error(&htmlc->base); content_set_error(&htmlc->base);
return; return;
} }
@ -626,7 +626,7 @@ void html_finish_conversion(html_content *htmlc)
/* create new css selection context */ /* create new css selection context */
error = html_css_new_selection_context(htmlc, &htmlc->select_ctx); error = html_css_new_selection_context(htmlc, &htmlc->select_ctx);
if (error != NSERROR_OK) { if (error != NSERROR_OK) {
content_broadcast_errorcode(&htmlc->base, error); content_broadcast_error(&htmlc->base, error, NULL);
content_set_error(&htmlc->base); content_set_error(&htmlc->base);
return; return;
} }
@ -649,7 +649,7 @@ void html_finish_conversion(html_content *htmlc)
exc = dom_document_get_document_element(htmlc->document, (void *) &html); exc = dom_document_get_document_element(htmlc->document, (void *) &html);
if ((exc != DOM_NO_ERR) || (html == NULL)) { if ((exc != DOM_NO_ERR) || (html == NULL)) {
NSLOG(netsurf, INFO, "error retrieving html element from dom"); NSLOG(netsurf, INFO, "error retrieving html element from dom");
content_broadcast_errorcode(&htmlc->base, NSERROR_DOM); content_broadcast_error(&htmlc->base, NSERROR_DOM, NULL);
content_set_error(&htmlc->base); content_set_error(&htmlc->base);
return; return;
} }
@ -661,7 +661,7 @@ void html_finish_conversion(html_content *htmlc)
NSLOG(netsurf, INFO, "box conversion failed"); NSLOG(netsurf, INFO, "box conversion failed");
dom_node_unref(html); dom_node_unref(html);
html_object_free_objects(htmlc); html_object_free_objects(htmlc);
content_broadcast_errorcode(&htmlc->base, error); content_broadcast_error(&htmlc->base, error, NULL);
content_set_error(&htmlc->base); content_set_error(&htmlc->base);
return; return;
} }
@ -1130,14 +1130,14 @@ html_create(const content_handler *handler,
error = html_create_html_data(html, params); error = html_create_html_data(html, params);
if (error != NSERROR_OK) { if (error != NSERROR_OK) {
content_broadcast_errorcode(&html->base, error); content_broadcast_error(&html->base, error, NULL);
free(html); free(html);
return error; return error;
} }
error = html_css_new_stylesheets(html); error = html_css_new_stylesheets(html);
if (error != NSERROR_OK) { if (error != NSERROR_OK) {
content_broadcast_errorcode(&html->base, error); content_broadcast_error(&html->base, error, NULL);
free(html); free(html);
return error; return error;
} }
@ -1256,7 +1256,7 @@ html_process_data(struct content *c, const char *data, unsigned int size)
/* broadcast the error if necessary */ /* broadcast the error if necessary */
if (err != NSERROR_OK) { if (err != NSERROR_OK) {
content_broadcast_errorcode(c, err); content_broadcast_error(c, err, NULL);
return false; return false;
} }
@ -1361,8 +1361,9 @@ html_begin_conversion(html_content *htmlc)
if (error != DOM_HUBBUB_OK) { if (error != DOM_HUBBUB_OK) {
NSLOG(netsurf, INFO, "Parsing failed"); NSLOG(netsurf, INFO, "Parsing failed");
content_broadcast_errorcode(&htmlc->base, content_broadcast_error(&htmlc->base,
libdom_hubbub_error_to_nserror(error)); libdom_hubbub_error_to_nserror(error),
NULL);
return false; return false;
} }
@ -1380,7 +1381,7 @@ html_begin_conversion(html_content *htmlc)
NSLOG(netsurf, INFO, "Conversion aborted (%p) (active: %u)", NSLOG(netsurf, INFO, "Conversion aborted (%p) (active: %u)",
htmlc, htmlc->base.active); htmlc, htmlc->base.active);
content_set_error(&htmlc->base); content_set_error(&htmlc->base);
content_broadcast_errorcode(&htmlc->base, NSERROR_STOPPED); content_broadcast_error(&htmlc->base, NSERROR_STOPPED, NULL);
return false; return false;
} }
@ -1401,15 +1402,17 @@ html_begin_conversion(html_content *htmlc)
encoding = dom_hubbub_parser_get_encoding(htmlc->parser, encoding = dom_hubbub_parser_get_encoding(htmlc->parser,
&htmlc->encoding_source); &htmlc->encoding_source);
if (encoding == NULL) { if (encoding == NULL) {
content_broadcast_errorcode(&htmlc->base, content_broadcast_error(&htmlc->base,
NSERROR_NOMEM); NSERROR_NOMEM,
NULL);
return false; return false;
} }
htmlc->encoding = strdup(encoding); htmlc->encoding = strdup(encoding);
if (htmlc->encoding == NULL) { if (htmlc->encoding == NULL) {
content_broadcast_errorcode(&htmlc->base, content_broadcast_error(&htmlc->base,
NSERROR_NOMEM); NSERROR_NOMEM,
NULL);
return false; return false;
} }
} }
@ -1418,7 +1421,7 @@ html_begin_conversion(html_content *htmlc)
exc = dom_document_get_document_element(htmlc->document, (void *) &html); exc = dom_document_get_document_element(htmlc->document, (void *) &html);
if ((exc != DOM_NO_ERR) || (html == NULL)) { if ((exc != DOM_NO_ERR) || (html == NULL)) {
NSLOG(netsurf, INFO, "error retrieving html element from dom"); NSLOG(netsurf, INFO, "error retrieving html element from dom");
content_broadcast_errorcode(&htmlc->base, NSERROR_DOM); content_broadcast_error(&htmlc->base, NSERROR_DOM, NULL);
return false; return false;
} }
@ -1428,7 +1431,7 @@ html_begin_conversion(html_content *htmlc)
(!dom_string_caseless_lwc_isequal(node_name, (!dom_string_caseless_lwc_isequal(node_name,
corestring_lwc_html))) { corestring_lwc_html))) {
NSLOG(netsurf, INFO, "root element not html"); NSLOG(netsurf, INFO, "root element not html");
content_broadcast_errorcode(&htmlc->base, NSERROR_DOM); content_broadcast_error(&htmlc->base, NSERROR_DOM, NULL);
dom_node_unref(html); dom_node_unref(html);
return false; return false;
} }
@ -1454,7 +1457,7 @@ html_begin_conversion(html_content *htmlc)
} }
if (ns_error != NSERROR_OK) { if (ns_error != NSERROR_OK) {
content_broadcast_errorcode(&htmlc->base, ns_error); content_broadcast_error(&htmlc->base, ns_error, NULL);
dom_node_unref(html); dom_node_unref(html);
return false; return false;
@ -1464,8 +1467,9 @@ html_begin_conversion(html_content *htmlc)
f->action = strdup(nsurl_access(action)); f->action = strdup(nsurl_access(action));
nsurl_unref(action); nsurl_unref(action);
if (f->action == NULL) { if (f->action == NULL) {
content_broadcast_errorcode(&htmlc->base, content_broadcast_error(&htmlc->base,
NSERROR_NOMEM); NSERROR_NOMEM,
NULL);
dom_node_unref(html); dom_node_unref(html);
return false; return false;
@ -1475,8 +1479,9 @@ html_begin_conversion(html_content *htmlc)
if (f->document_charset == NULL) { if (f->document_charset == NULL) {
f->document_charset = strdup(htmlc->encoding); f->document_charset = strdup(htmlc->encoding);
if (f->document_charset == NULL) { if (f->document_charset == NULL) {
content_broadcast_errorcode(&htmlc->base, content_broadcast_error(&htmlc->base,
NSERROR_NOMEM); NSERROR_NOMEM,
NULL);
dom_node_unref(html); dom_node_unref(html);
return false; return false;
} }

View File

@ -248,7 +248,7 @@ html_create_style_element(html_content *c, dom_node *style)
(c->stylesheet_count + 1)); (c->stylesheet_count + 1));
if (stylesheets == NULL) { if (stylesheets == NULL) {
content_broadcast_errorcode(&c->base, NSERROR_NOMEM); content_broadcast_error(&c->base, NSERROR_NOMEM, NULL);
return false; return false;
} }
@ -272,7 +272,7 @@ static bool html_css_process_modified_style(html_content *c,
error = html_stylesheet_from_domnode(c, s->node, &sheet); error = html_stylesheet_from_domnode(c, s->node, &sheet);
if (error != NSERROR_OK) { if (error != NSERROR_OK) {
NSLOG(netsurf, INFO, "Failed to update sheet"); NSLOG(netsurf, INFO, "Failed to update sheet");
content_broadcast_errorcode(&c->base, error); content_broadcast_error(&c->base, error, NULL);
return false; return false;
} }
@ -480,7 +480,7 @@ bool html_css_process_link(html_content *htmlc, dom_node *node)
return true; return true;
no_memory: no_memory:
content_broadcast_errorcode(&htmlc->base, ns_error); content_broadcast_error(&htmlc->base, ns_error, NULL);
return false; return false;
} }

View File

@ -414,7 +414,7 @@ exec_src_script(html_content *c,
/* src url */ /* src url */
ns_error = nsurl_join(c->base_url, dom_string_data(src), &joined); ns_error = nsurl_join(c->base_url, dom_string_data(src), &joined);
if (ns_error != NSERROR_OK) { if (ns_error != NSERROR_OK) {
content_broadcast_errorcode(&c->base, NSERROR_NOMEM); content_broadcast_error(&c->base, NSERROR_NOMEM, NULL);
return DOM_HUBBUB_NOMEM; return DOM_HUBBUB_NOMEM;
} }
@ -476,7 +476,7 @@ exec_src_script(html_content *c,
nscript = html_process_new_script(c, mimetype, script_type); nscript = html_process_new_script(c, mimetype, script_type);
if (nscript == NULL) { if (nscript == NULL) {
nsurl_unref(joined); nsurl_unref(joined);
content_broadcast_errorcode(&c->base, NSERROR_NOMEM); content_broadcast_error(&c->base, NSERROR_NOMEM, NULL);
return DOM_HUBBUB_NOMEM; return DOM_HUBBUB_NOMEM;
} }
@ -546,7 +546,7 @@ exec_inline_script(html_content *c, dom_node *node, dom_string *mimetype)
if (nscript == NULL) { if (nscript == NULL) {
dom_string_unref(script); dom_string_unref(script);
content_broadcast_errorcode(&c->base, NSERROR_NOMEM); content_broadcast_error(&c->base, NSERROR_NOMEM, NULL);
return DOM_HUBBUB_NOMEM; return DOM_HUBBUB_NOMEM;
} }

View File

@ -78,7 +78,7 @@ static nserror nsbmp_create_bmp_data(nsbmp_content *bmp)
bmp->bmp = calloc(sizeof(struct bmp_image), 1); bmp->bmp = calloc(sizeof(struct bmp_image), 1);
if (bmp->bmp == NULL) { if (bmp->bmp == NULL) {
content_broadcast_errorcode(&bmp->base, NSERROR_NOMEM); content_broadcast_error(&bmp->base, NSERROR_NOMEM, NULL);
return NSERROR_NOMEM; return NSERROR_NOMEM;
} }
@ -135,11 +135,11 @@ static bool nsbmp_convert(struct content *c)
case BMP_OK: case BMP_OK:
break; break;
case BMP_INSUFFICIENT_MEMORY: case BMP_INSUFFICIENT_MEMORY:
content_broadcast_errorcode(c, NSERROR_NOMEM); content_broadcast_error(c, NSERROR_NOMEM, NULL);
return false; return false;
case BMP_INSUFFICIENT_DATA: case BMP_INSUFFICIENT_DATA:
case BMP_DATA_ERROR: case BMP_DATA_ERROR:
content_broadcast_errorcode(c, NSERROR_BMP_ERROR); content_broadcast_error(c, NSERROR_BMP_ERROR, NULL);
return false; return false;
} }

View File

@ -84,7 +84,7 @@ static nserror nsgif_create_gif_data(nsgif_content *c)
/* Initialise our data structure */ /* Initialise our data structure */
c->gif = calloc(sizeof(gif_animation), 1); c->gif = calloc(sizeof(gif_animation), 1);
if (c->gif == NULL) { if (c->gif == NULL) {
content_broadcast_errorcode(&c->base, NSERROR_NOMEM); content_broadcast_error(&c->base, NSERROR_NOMEM, NULL);
return NSERROR_NOMEM; return NSERROR_NOMEM;
} }
gif_create(c->gif, &gif_bitmap_callbacks); gif_create(c->gif, &gif_bitmap_callbacks);
@ -259,7 +259,7 @@ static bool nsgif_convert(struct content *c)
error = NSERROR_NOMEM; error = NSERROR_NOMEM;
break; break;
} }
content_broadcast_errorcode(c, error); content_broadcast_error(c, error, NULL);
return false; return false;
} }
} while (res != GIF_OK && res != GIF_INSUFFICIENT_FRAME_DATA); } while (res != GIF_OK && res != GIF_INSUFFICIENT_FRAME_DATA);
@ -267,7 +267,7 @@ static bool nsgif_convert(struct content *c)
/* Abort on bad GIFs */ /* Abort on bad GIFs */
if ((gif->gif->frame_count_partial == 0) || (gif->gif->width == 0) || if ((gif->gif->frame_count_partial == 0) || (gif->gif->width == 0) ||
(gif->gif->height == 0)) { (gif->gif->height == 0)) {
content_broadcast_errorcode(c, NSERROR_GIF_ERROR); content_broadcast_error(c, NSERROR_GIF_ERROR, NULL);
return false; return false;
} }

View File

@ -75,7 +75,7 @@ static nserror nsico_create_ico_data(nsico_content *c)
c->ico = calloc(sizeof(ico_collection), 1); c->ico = calloc(sizeof(ico_collection), 1);
if (c->ico == NULL) { if (c->ico == NULL) {
content_broadcast_errorcode(&c->base, NSERROR_NOMEM); content_broadcast_error(&c->base, NSERROR_NOMEM, NULL);
return NSERROR_NOMEM; return NSERROR_NOMEM;
} }
ico_collection_create(c->ico, &bmp_bitmap_callbacks); ico_collection_create(c->ico, &bmp_bitmap_callbacks);
@ -134,11 +134,11 @@ static bool nsico_convert(struct content *c)
case BMP_OK: case BMP_OK:
break; break;
case BMP_INSUFFICIENT_MEMORY: case BMP_INSUFFICIENT_MEMORY:
content_broadcast_errorcode(c, NSERROR_NOMEM); content_broadcast_error(c, NSERROR_NOMEM, NULL);
return false; return false;
case BMP_INSUFFICIENT_DATA: case BMP_INSUFFICIENT_DATA:
case BMP_DATA_ERROR: case BMP_DATA_ERROR:
content_broadcast_errorcode(c, NSERROR_ICO_ERROR); content_broadcast_error(c, NSERROR_ICO_ERROR, NULL);
return false; return false;
} }

View File

@ -242,7 +242,7 @@ static nserror nspng_create_png_data(nspng_content *png_c)
png_c->png = png_create_read_struct(PNG_LIBPNG_VER_STRING, 0, 0, 0); png_c->png = png_create_read_struct(PNG_LIBPNG_VER_STRING, 0, 0, 0);
if (png_c->png == NULL) { if (png_c->png == NULL) {
content_broadcast_errorcode(&png_c->base, NSERROR_NOMEM); content_broadcast_error(&png_c->base, NSERROR_NOMEM, NULL);
return NSERROR_NOMEM; return NSERROR_NOMEM;
} }
@ -252,7 +252,7 @@ static nserror nspng_create_png_data(nspng_content *png_c)
if (png_c->info == NULL) { if (png_c->info == NULL) {
png_destroy_read_struct(&png_c->png, &png_c->info, 0); png_destroy_read_struct(&png_c->png, &png_c->info, 0);
content_broadcast_errorcode(&png_c->base, NSERROR_NOMEM); content_broadcast_error(&png_c->base, NSERROR_NOMEM, NULL);
return NSERROR_NOMEM; return NSERROR_NOMEM;
} }
@ -262,7 +262,7 @@ static nserror nspng_create_png_data(nspng_content *png_c)
png_c->png = NULL; png_c->png = NULL;
png_c->info = NULL; png_c->info = NULL;
content_broadcast_errorcode(&png_c->base, NSERROR_PNG_ERROR); content_broadcast_error(&png_c->base, NSERROR_PNG_ERROR, NULL);
return NSERROR_NOMEM; return NSERROR_NOMEM;
} }
@ -355,7 +355,7 @@ static bool nspng_process_data(struct content *c, const char *data,
png_c->png = NULL; png_c->png = NULL;
png_c->info = NULL; png_c->info = NULL;
content_broadcast_errorcode(c, NSERROR_PNG_ERROR); content_broadcast_error(c, NSERROR_PNG_ERROR, NULL);
ret = false; ret = false;

View File

@ -71,7 +71,7 @@ static nserror rsvg_create_svg_data(rsvg_content *c)
if ((c->rsvgh = rsvg_handle_new()) == NULL) { if ((c->rsvgh = rsvg_handle_new()) == NULL) {
NSLOG(netsurf, INFO, "rsvg_handle_new() returned NULL."); NSLOG(netsurf, INFO, "rsvg_handle_new() returned NULL.");
content_broadcast_errorcode(&c->base, NSERROR_NOMEM); content_broadcast_error(&c->base, NSERROR_NOMEM, NULL);
return NSERROR_NOMEM; return NSERROR_NOMEM;
} }
@ -120,7 +120,7 @@ static bool rsvg_process_data(struct content *c, const char *data,
&err) == FALSE) { &err) == FALSE) {
NSLOG(netsurf, INFO, NSLOG(netsurf, INFO,
"rsvg_handle_write returned an error: %s", err->message); "rsvg_handle_write returned an error: %s", err->message);
content_broadcast_errorcode(c, NSERROR_SVG_ERROR); content_broadcast_error(c, NSERROR_SVG_ERROR, NULL);
return false; return false;
} }
@ -171,7 +171,7 @@ static bool rsvg_convert(struct content *c)
if (rsvg_handle_close(d->rsvgh, &err) == FALSE) { if (rsvg_handle_close(d->rsvgh, &err) == FALSE) {
NSLOG(netsurf, INFO, NSLOG(netsurf, INFO,
"rsvg_handle_close returned an error: %s", err->message); "rsvg_handle_close returned an error: %s", err->message);
content_broadcast_errorcode(c, NSERROR_SVG_ERROR); content_broadcast_error(c, NSERROR_SVG_ERROR, NULL);
return false; return false;
} }
@ -189,7 +189,7 @@ static bool rsvg_convert(struct content *c)
BITMAP_NEW)) == NULL) { BITMAP_NEW)) == NULL) {
NSLOG(netsurf, INFO, NSLOG(netsurf, INFO,
"Failed to create bitmap for rsvg render."); "Failed to create bitmap for rsvg render.");
content_broadcast_errorcode(c, NSERROR_NOMEM); content_broadcast_error(c, NSERROR_NOMEM, NULL);
return false; return false;
} }
@ -200,14 +200,14 @@ static bool rsvg_convert(struct content *c)
guit->bitmap->get_rowstride(d->bitmap))) == NULL) { guit->bitmap->get_rowstride(d->bitmap))) == NULL) {
NSLOG(netsurf, INFO, NSLOG(netsurf, INFO,
"Failed to create Cairo image surface for rsvg render."); "Failed to create Cairo image surface for rsvg render.");
content_broadcast_errorcode(c, NSERROR_NOMEM); content_broadcast_error(c, NSERROR_NOMEM, NULL);
return false; return false;
} }
if ((d->ct = cairo_create(d->cs)) == NULL) { if ((d->ct = cairo_create(d->cs)) == NULL) {
NSLOG(netsurf, INFO, NSLOG(netsurf, INFO,
"Failed to create Cairo drawing context for rsvg render."); "Failed to create Cairo drawing context for rsvg render.");
content_broadcast_errorcode(c, NSERROR_NOMEM); content_broadcast_error(c, NSERROR_NOMEM, NULL);
return false; return false;
} }

View File

@ -59,7 +59,7 @@ static nserror svg_create_svg_data(svg_content *c)
return NSERROR_OK; return NSERROR_OK;
no_memory: no_memory:
content_broadcast_errorcode(&c->base, NSERROR_NOMEM); content_broadcast_error(&c->base, NSERROR_NOMEM, NULL);
return NSERROR_NOMEM; return NSERROR_NOMEM;
} }

View File

@ -182,7 +182,7 @@ textplain_create_internal(textplain_content *c, lwc_string *encoding)
return NSERROR_OK; return NSERROR_OK;
no_memory: no_memory:
content_broadcast_errorcode(&c->base, NSERROR_NOMEM); content_broadcast_error(&c->base, NSERROR_NOMEM, NULL);
return NSERROR_NOMEM; return NSERROR_NOMEM;
} }
@ -357,7 +357,7 @@ textplain_process_data(struct content *c, const char *data, unsigned int size)
return true; return true;
no_memory: no_memory:
content_broadcast_errorcode(c, NSERROR_NOMEM); content_broadcast_error(c, NSERROR_NOMEM, NULL);
return false; return false;
} }