HTML script handling: Convert to using content_broadcast_errorcode().

This commit is contained in:
Michael Drake 2017-08-28 11:01:30 +01:00
parent 830d7ec6b6
commit 771fe0d44c

View File

@ -346,7 +346,6 @@ exec_src_script(html_content *c,
nsurl *joined; nsurl *joined;
hlcache_child_context child; hlcache_child_context child;
struct html_script *nscript; struct html_script *nscript;
union content_msg_data msg_data;
bool async; bool async;
bool defer; bool defer;
enum html_script_type script_type; enum html_script_type script_type;
@ -357,8 +356,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) {
msg_data.error = messages_get("NoMemory"); content_broadcast_errorcode(&c->base, NSERROR_NOMEM);
content_broadcast(&c->base, CONTENT_MSG_ERROR, &msg_data);
return DOM_HUBBUB_NOMEM; return DOM_HUBBUB_NOMEM;
} }
@ -413,8 +411,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);
msg_data.error = messages_get("NoMemory"); content_broadcast_errorcode(&c->base, NSERROR_NOMEM);
content_broadcast(&c->base, CONTENT_MSG_ERROR, &msg_data);
return DOM_HUBBUB_NOMEM; return DOM_HUBBUB_NOMEM;
} }
@ -468,7 +465,6 @@ exec_src_script(html_content *c,
static dom_hubbub_error static dom_hubbub_error
exec_inline_script(html_content *c, dom_node *node, dom_string *mimetype) exec_inline_script(html_content *c, dom_node *node, dom_string *mimetype)
{ {
union content_msg_data msg_data;
dom_string *script; dom_string *script;
dom_exception exc; /* returned by libdom functions */ dom_exception exc; /* returned by libdom functions */
struct lwc_string_s *lwcmimetype; struct lwc_string_s *lwcmimetype;
@ -485,8 +481,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);
msg_data.error = messages_get("NoMemory"); content_broadcast_errorcode(&c->base, NSERROR_NOMEM);
content_broadcast(&c->base, CONTENT_MSG_ERROR, &msg_data);
return DOM_HUBBUB_NOMEM; return DOM_HUBBUB_NOMEM;
} }