Gitweb links:
...log
http://git.netsurf-browser.org/netsurf.git/shortlog/cebfa6c2cc69e4fba1491...
...commit
http://git.netsurf-browser.org/netsurf.git/commit/cebfa6c2cc69e4fba14910b...
...tree
http://git.netsurf-browser.org/netsurf.git/tree/cebfa6c2cc69e4fba14910b5f...
The branch, master has been updated
via cebfa6c2cc69e4fba14910b5f93c7b0e9d538197 (commit)
via 3a0e87e89f57a6082074438e038098bfbe688f2a (commit)
via 9fd0e065010015a52e200ce3b28566782b12f4a5 (commit)
via 7385f74141248dfc738b7952fad37c024320673f (commit)
via 771fe0d44c924a05afe9e951669fcdfbb9d56913 (commit)
via 830d7ec6b6d368db55233b41c26ff1744d03945c (commit)
via a30ae27e5ccbd0772044df768a2d6fe26ee6a8d9 (commit)
via adc6ceb0bb64382a3b46dc3fcbe3fb621e719896 (commit)
via 8180116d965d12e9a5da1b5c139bbb7ee838e069 (commit)
via e411c84e9bc1075b54373ce3d5eb6bbb6706ccde (commit)
via 9e64f37846f80413cc94bf40effec8eecdeb7cf6 (commit)
from cae1c44f8fe61a4df20f000d0b57ac78e5527170 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=cebfa6c2cc69e4fba14...
commit cebfa6c2cc69e4fba14910b5f93c7b0e9d538197
Author: Michael Drake <michael.drake(a)codethink.co.uk>
Commit: Michael Drake <michael.drake(a)codethink.co.uk>
Tests: Squash warning: "_BSD_SOURCE and _SVID_SOURCE are deprecated, use
_DEFAULT_SOURCE".
diff --git a/test/Makefile b/test/Makefile
index 39953a3..64c3f39 100644
--- a/test/Makefile
+++ b/test/Makefile
@@ -134,7 +134,7 @@ endif
BASE_TESTCFLAGS := -std=c99 -g \
$(COMMON_WARNFLAGS) \
- -D_BSD_SOURCE \
+ -D_DEFAULT_SOURCE \
-D_POSIX_C_SOURCE=200809L \
-D_XOPEN_SOURCE=600 \
-Itest -Iinclude -Icontent/handlers -Ifrontends -I. -I.. \
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=3a0e87e89f57a608207...
commit 3a0e87e89f57a6082074438e038098bfbe688f2a
Author: Michael Drake <michael.drake(a)codethink.co.uk>
Commit: Michael Drake <michael.drake(a)codethink.co.uk>
Errorcodes: Remove redundant MNG error.
diff --git a/test/messages.c b/test/messages.c
index d102e36..ae82d1e 100644
--- a/test/messages.c
+++ b/test/messages.c
@@ -52,7 +52,6 @@ struct message_test_vec_s message_errorcode_test_vec[] = {
{ NSERROR_SAVE_FAILED, "SaveFailed" },
{ NSERROR_CLONE_FAILED, "CloneFailed" },
{ NSERROR_INIT_FAILED, "InitFailed" },
- { NSERROR_MNG_ERROR, "Error converting MNG/PNG/JNG: %i" },
{ NSERROR_BAD_ENCODING, "BadEncoding" },
{ NSERROR_NEED_DATA, "NeedData" },
{ NSERROR_ENCODING_CHANGE, "EncodingChanged" },
diff --git a/utils/errors.h b/utils/errors.h
index 55f921e..ad8ae42 100644
--- a/utils/errors.h
+++ b/utils/errors.h
@@ -36,7 +36,6 @@ typedef enum {
NSERROR_SAVE_FAILED, /**< Failed to save data */
NSERROR_CLONE_FAILED, /**< Failed to clone handle */
NSERROR_INIT_FAILED, /**< Initialisation failed */
- NSERROR_MNG_ERROR, /**< An MNG error occurred */
NSERROR_BMP_ERROR, /**< A BMP error occurred */
NSERROR_GIF_ERROR, /**< A GIF error occurred */
NSERROR_ICO_ERROR, /**< A ICO error occurred */
diff --git a/utils/messages.c b/utils/messages.c
index 0c558cd..5f55cb9 100644
--- a/utils/messages.c
+++ b/utils/messages.c
@@ -350,10 +350,6 @@ const char *messages_get_errorcode(nserror code)
/* Initialisation failed */
return messages_get_ctx("InitFailed", messages_hash);
- case NSERROR_MNG_ERROR:
- /* An MNG error occurred */
- return messages_get_ctx("MNGError", messages_hash);
-
case NSERROR_BAD_ENCODING:
/* The character set is unknown */
return messages_get_ctx("BadEncoding", messages_hash);
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=9fd0e065010015a52e2...
commit 9fd0e065010015a52e200ce3b28566782b12f4a5
Author: Michael Drake <michael.drake(a)codethink.co.uk>
Commit: Michael Drake <michael.drake(a)codethink.co.uk>
Whitespace: Tidy up errorcodes.
diff --git a/utils/errors.h b/utils/errors.h
index cce8d6e..55f921e 100644
--- a/utils/errors.h
+++ b/utils/errors.h
@@ -27,68 +27,37 @@
* Enumeration of error codes
*/
typedef enum {
- NSERROR_OK, /**< No error */
-
- NSERROR_UNKNOWN, /**< Unknown error - DO *NOT* USE */
-
- NSERROR_NOMEM, /**< Memory exhaustion */
-
- NSERROR_NO_FETCH_HANDLER, /**< No fetch handler for URL scheme */
-
- NSERROR_NOT_FOUND, /**< Requested item not found */
-
- NSERROR_NOT_DIRECTORY, /**< Missing directory */
-
- NSERROR_SAVE_FAILED, /**< Failed to save data */
-
- NSERROR_CLONE_FAILED, /**< Failed to clone handle */
-
- NSERROR_INIT_FAILED, /**< Initialisation failed */
-
- NSERROR_MNG_ERROR, /**< An MNG error occurred */
-
+ NSERROR_OK, /**< No error */
+ NSERROR_UNKNOWN, /**< Unknown error - DO *NOT* USE */
+ NSERROR_NOMEM, /**< Memory exhaustion */
+ NSERROR_NO_FETCH_HANDLER, /**< No fetch handler for URL scheme */
+ NSERROR_NOT_FOUND, /**< Requested item not found */
+ NSERROR_NOT_DIRECTORY, /**< Missing directory */
+ NSERROR_SAVE_FAILED, /**< Failed to save data */
+ NSERROR_CLONE_FAILED, /**< Failed to clone handle */
+ NSERROR_INIT_FAILED, /**< Initialisation failed */
+ NSERROR_MNG_ERROR, /**< An MNG error occurred */
NSERROR_BMP_ERROR, /**< A BMP error occurred */
-
NSERROR_GIF_ERROR, /**< A GIF error occurred */
-
NSERROR_ICO_ERROR, /**< A ICO error occurred */
-
NSERROR_PNG_ERROR, /**< A PNG error occurred */
-
NSERROR_SVG_ERROR, /**< A SVG error occurred */
-
- NSERROR_BAD_ENCODING, /**< The character set is unknown */
-
- NSERROR_NEED_DATA, /**< More data needed */
-
- NSERROR_ENCODING_CHANGE, /**< The character changed */
-
- NSERROR_BAD_PARAMETER, /**< Bad Parameter */
-
- NSERROR_INVALID, /**< Invalid data */
-
- NSERROR_BOX_CONVERT, /**< Box conversion failed */
-
- NSERROR_STOPPED, /**< Content conversion stopped */
-
- NSERROR_DOM, /**< DOM call returned error */
-
- NSERROR_CSS, /**< CSS call returned error */
-
+ NSERROR_BAD_ENCODING, /**< The character set is unknown */
+ NSERROR_NEED_DATA, /**< More data needed */
+ NSERROR_ENCODING_CHANGE, /**< The character changed */
+ NSERROR_BAD_PARAMETER, /**< Bad Parameter */
+ NSERROR_INVALID, /**< Invalid data */
+ NSERROR_BOX_CONVERT, /**< Box conversion failed */
+ NSERROR_STOPPED, /**< Content conversion stopped */
+ NSERROR_DOM, /**< DOM call returned error */
+ NSERROR_CSS, /**< CSS call returned error */
NSERROR_CSS_BASE, /**< CSS base sheet failed */
-
- NSERROR_BAD_URL, /**< Bad URL */
-
- NSERROR_BAD_CONTENT, /**< Bad Content */
-
+ NSERROR_BAD_URL, /**< Bad URL */
+ NSERROR_BAD_CONTENT, /**< Bad Content */
NSERROR_FRAME_DEPTH, /**< Exceeded frame depth */
-
NSERROR_PERMISSION, /**< Permission error */
-
- NSERROR_NOSPACE, /**< Insufficient space */
-
+ NSERROR_NOSPACE, /**< Insufficient space */
NSERROR_BAD_SIZE, /**< Bad size */
-
NSERROR_NOT_IMPLEMENTED, /**< Functionality is not implemented */
} nserror;
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=7385f74141248dfc738...
commit 7385f74141248dfc738b7952fad37c024320673f
Author: Michael Drake <michael.drake(a)codethink.co.uk>
Commit: Michael Drake <michael.drake(a)codethink.co.uk>
Browser favicon: Handle errorcode in the hlcache callback.
diff --git a/desktop/browser.c b/desktop/browser.c
index e7ff158..8d57a2a 100644
--- a/desktop/browser.c
+++ b/desktop/browser.c
@@ -1094,6 +1094,7 @@ browser_window_favicon_callback(hlcache_handle *c,
break;
case CONTENT_MSG_ERROR:
+ case CONTENT_MSG_ERRORCODE:
/* clean up after ourselves */
if (c == bw->favicon.loading) {
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=771fe0d44c924a05afe...
commit 771fe0d44c924a05afe9e951669fcdfbb9d56913
Author: Michael Drake <michael.drake(a)codethink.co.uk>
Commit: Michael Drake <michael.drake(a)codethink.co.uk>
HTML script handling: Convert to using content_broadcast_errorcode().
diff --git a/render/html_script.c b/render/html_script.c
index 05e7d9b..6ed74c5 100644
--- a/render/html_script.c
+++ b/render/html_script.c
@@ -346,7 +346,6 @@ exec_src_script(html_content *c,
nsurl *joined;
hlcache_child_context child;
struct html_script *nscript;
- union content_msg_data msg_data;
bool async;
bool defer;
enum html_script_type script_type;
@@ -357,8 +356,7 @@ exec_src_script(html_content *c,
/* src url */
ns_error = nsurl_join(c->base_url, dom_string_data(src), &joined);
if (ns_error != NSERROR_OK) {
- msg_data.error = messages_get("NoMemory");
- content_broadcast(&c->base, CONTENT_MSG_ERROR, &msg_data);
+ content_broadcast_errorcode(&c->base, NSERROR_NOMEM);
return DOM_HUBBUB_NOMEM;
}
@@ -413,8 +411,7 @@ exec_src_script(html_content *c,
nscript = html_process_new_script(c, mimetype, script_type);
if (nscript == NULL) {
nsurl_unref(joined);
- msg_data.error = messages_get("NoMemory");
- content_broadcast(&c->base, CONTENT_MSG_ERROR, &msg_data);
+ content_broadcast_errorcode(&c->base, NSERROR_NOMEM);
return DOM_HUBBUB_NOMEM;
}
@@ -468,7 +465,6 @@ exec_src_script(html_content *c,
static dom_hubbub_error
exec_inline_script(html_content *c, dom_node *node, dom_string *mimetype)
{
- union content_msg_data msg_data;
dom_string *script;
dom_exception exc; /* returned by libdom functions */
struct lwc_string_s *lwcmimetype;
@@ -485,8 +481,7 @@ exec_inline_script(html_content *c, dom_node *node, dom_string
*mimetype)
if (nscript == NULL) {
dom_string_unref(script);
- msg_data.error = messages_get("NoMemory");
- content_broadcast(&c->base, CONTENT_MSG_ERROR, &msg_data);
+ content_broadcast_errorcode(&c->base, NSERROR_NOMEM);
return DOM_HUBBUB_NOMEM;
}
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=830d7ec6b6d368db552...
commit 830d7ec6b6d368db55233b41c26ff1744d03945c
Author: Michael Drake <michael.drake(a)codethink.co.uk>
Commit: Michael Drake <michael.drake(a)codethink.co.uk>
HTML content handler: Ensure script fetch hlcache callback handles errorcode.
diff --git a/render/html_script.c b/render/html_script.c
index c07e5a3..05e7d9b 100644
--- a/render/html_script.c
+++ b/render/html_script.c
@@ -173,6 +173,7 @@ convert_script_async_cb(hlcache_handle *script,
case CONTENT_MSG_ERROR:
LOG("script %s failed: %s", nsurl_access(hlcache_handle_get_url(script)),
event->data.error);
+ case CONTENT_MSG_ERRORCODE:
hlcache_handle_release(script);
s->data.handle = NULL;
parent->base.active--;
@@ -226,6 +227,7 @@ convert_script_defer_cb(hlcache_handle *script,
case CONTENT_MSG_ERROR:
LOG("script %s failed: %s", nsurl_access(hlcache_handle_get_url(script)),
event->data.error);
+ case CONTENT_MSG_ERRORCODE:
hlcache_handle_release(script);
s->data.handle = NULL;
parent->base.active--;
@@ -298,6 +300,7 @@ convert_script_sync_cb(hlcache_handle *script,
case CONTENT_MSG_ERROR:
LOG("script %s failed: %s", nsurl_access(hlcache_handle_get_url(script)),
event->data.error);
+ case CONTENT_MSG_ERRORCODE:
hlcache_handle_release(script);
s->data.handle = NULL;
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=a30ae27e5ccbd077204...
commit a30ae27e5ccbd0772044df768a2d6fe26ee6a8d9
Author: Michael Drake <michael.drake(a)codethink.co.uk>
Commit: Michael Drake <michael.drake(a)codethink.co.uk>
HTML content handler: Ensure object fetch hlcache callback handles errorcode.
diff --git a/render/html_object.c b/render/html_object.c
index 12780ca..f304e91 100644
--- a/render/html_object.c
+++ b/render/html_object.c
@@ -181,6 +181,7 @@ html_object_callback(hlcache_handle *object,
}
break;
+ case CONTENT_MSG_ERRORCODE:
case CONTENT_MSG_ERROR:
hlcache_handle_release(object);
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=adc6ceb0bb64382a3b4...
commit adc6ceb0bb64382a3b46dc3fcbe3fb621e719896
Author: Michael Drake <michael.drake(a)codethink.co.uk>
Commit: Michael Drake <michael.drake(a)codethink.co.uk>
CSS content handler: Ensure fetch hlcache callback handles errorcode.
diff --git a/render/html_css.c b/render/html_css.c
index 4d54693..47c2185 100644
--- a/render/html_css.c
+++ b/render/html_css.c
@@ -109,6 +109,7 @@ html_convert_css_callback(hlcache_handle *css,
break;
case CONTENT_MSG_ERROR:
+ case CONTENT_MSG_ERRORCODE:
LOG("stylesheet %s failed: %s", nsurl_access(hlcache_handle_get_url(css)),
event->data.error);
hlcache_handle_release(css);
s->sheet = NULL;
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=8180116d965d12e9a5d...
commit 8180116d965d12e9a5da1b5c139bbb7ee838e069
Author: Michael Drake <michael.drake(a)codethink.co.uk>
Commit: Michael Drake <michael.drake(a)codethink.co.uk>
Plain text content handler: Convert to using content_broadcast_errorcode().
diff --git a/render/textplain.c b/render/textplain.c
index 35e3e4b..2f2d757 100644
--- a/render/textplain.c
+++ b/render/textplain.c
@@ -150,7 +150,6 @@ textplain_create_internal(textplain_content *c, lwc_string *encoding)
char *utf8_data;
parserutils_inputstream *stream;
parserutils_error error;
- union content_msg_data msg_data;
textplain_style.size = (nsoption_int(font_size) * FONT_SIZE_SCALE) / 10;
@@ -185,8 +184,7 @@ textplain_create_internal(textplain_content *c, lwc_string *encoding)
return NSERROR_OK;
no_memory:
- msg_data.error = messages_get("NoMemory");
- content_broadcast(&c->base, CONTENT_MSG_ERROR, &msg_data);
+ content_broadcast_errorcode(&c->base, NSERROR_NOMEM);
return NSERROR_NOMEM;
}
@@ -347,7 +345,6 @@ textplain_process_data(struct content *c, const char *data, unsigned
int size)
{
textplain_content *text = (textplain_content *) c;
parserutils_inputstream *stream = text->inputstream;
- union content_msg_data msg_data;
parserutils_error error;
error = parserutils_inputstream_append(stream,
@@ -362,8 +359,7 @@ textplain_process_data(struct content *c, const char *data, unsigned
int size)
return true;
no_memory:
- msg_data.error = messages_get("NoMemory");
- content_broadcast(c, CONTENT_MSG_ERROR, &msg_data);
+ content_broadcast_errorcode(c, NSERROR_NOMEM);
return false;
}
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=e411c84e9bc1075b543...
commit e411c84e9bc1075b54373ce3d5eb6bbb6706ccde
Author: Michael Drake <michael.drake(a)codethink.co.uk>
Commit: Michael Drake <michael.drake(a)codethink.co.uk>
SVG content handler: Convert to using content_broadcast_errorcode().
diff --git a/content/handlers/image/svg.c b/content/handlers/image/svg.c
index f31ee1f..2edc7bd 100644
--- a/content/handlers/image/svg.c
+++ b/content/handlers/image/svg.c
@@ -49,8 +49,6 @@ typedef struct svg_content {
static nserror svg_create_svg_data(svg_content *c)
{
- union content_msg_data msg_data;
-
c->diagram = svgtiny_create();
if (c->diagram == NULL)
goto no_memory;
@@ -61,8 +59,7 @@ static nserror svg_create_svg_data(svg_content *c)
return NSERROR_OK;
no_memory:
- msg_data.error = messages_get("NoMemory");
- content_broadcast(&c->base, CONTENT_MSG_ERROR, &msg_data);
+ content_broadcast_errorcode(&c->base, NSERROR_NOMEM);
return NSERROR_NOMEM;
}
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=9e64f37846f80413cc9...
commit 9e64f37846f80413cc94bf40effec8eecdeb7cf6
Author: Michael Drake <michael.drake(a)codethink.co.uk>
Commit: Michael Drake <michael.drake(a)codethink.co.uk>
RSVG content handler: Convert to using content_broadcast_errorcode().
diff --git a/content/handlers/image/rsvg.c b/content/handlers/image/rsvg.c
index 24819df..d45a968 100644
--- a/content/handlers/image/rsvg.c
+++ b/content/handlers/image/rsvg.c
@@ -62,8 +62,6 @@ typedef struct rsvg_content {
static nserror rsvg_create_svg_data(rsvg_content *c)
{
- union content_msg_data msg_data;
-
c->rsvgh = NULL;
c->cs = NULL;
c->ct = NULL;
@@ -71,8 +69,7 @@ static nserror rsvg_create_svg_data(rsvg_content *c)
if ((c->rsvgh = rsvg_handle_new()) == NULL) {
LOG("rsvg_handle_new() returned NULL.");
- msg_data.error = messages_get("NoMemory");
- content_broadcast(&c->base, CONTENT_MSG_ERROR, &msg_data);
+ content_broadcast_errorcode(&c->base, NSERROR_NOMEM);
return NSERROR_NOMEM;
}
@@ -115,14 +112,12 @@ static bool rsvg_process_data(struct content *c, const char *data,
unsigned int size)
{
rsvg_content *d = (rsvg_content *) c;
- union content_msg_data msg_data;
GError *err = NULL;
if (rsvg_handle_write(d->rsvgh, (const guchar *)data, (gsize)size,
&err) == FALSE) {
LOG("rsvg_handle_write returned an error: %s", err->message);
- msg_data.error = err->message;
- content_broadcast(c, CONTENT_MSG_ERROR, &msg_data);
+ content_broadcast_errorcode(c, NSERROR_SVG_ERROR);
return false;
}
@@ -161,14 +156,12 @@ static inline void rsvg_argb_to_abgr(uint8_t *pixels,
static bool rsvg_convert(struct content *c)
{
rsvg_content *d = (rsvg_content *) c;
- union content_msg_data msg_data;
RsvgDimensionData rsvgsize;
GError *err = NULL;
if (rsvg_handle_close(d->rsvgh, &err) == FALSE) {
LOG("rsvg_handle_close returned an error: %s", err->message);
- msg_data.error = err->message;
- content_broadcast(c, CONTENT_MSG_ERROR, &msg_data);
+ content_broadcast_errorcode(c, NSERROR_SVG_ERROR);
return false;
}
@@ -186,7 +179,7 @@ static bool rsvg_convert(struct content *c)
BITMAP_NEW)) == NULL) {
LOG("Failed to create bitmap for rsvg render.");
msg_data.error = messages_get("NoMemory");
- content_broadcast(c, CONTENT_MSG_ERROR, &msg_data);
+ content_broadcast_errorcode(c, NSERROR_NOMEM);
return false;
}
@@ -196,15 +189,13 @@ static bool rsvg_convert(struct content *c)
c->width, c->height,
guit->bitmap->get_rowstride(d->bitmap))) == NULL) {
LOG("Failed to create Cairo image surface for rsvg render.");
- msg_data.error = messages_get("NoMemory");
- content_broadcast(c, CONTENT_MSG_ERROR, &msg_data);
+ content_broadcast_errorcode(c, NSERROR_NOMEM);
return false;
}
if ((d->ct = cairo_create(d->cs)) == NULL) {
LOG("Failed to create Cairo drawing context for rsvg render.");
- msg_data.error = messages_get("NoMemory");
- content_broadcast(c, CONTENT_MSG_ERROR, &msg_data);
+ content_broadcast_errorcode(c, NSERROR_NOMEM);
return false;
}
diff --git a/utils/errors.h b/utils/errors.h
index 3ab40b2..cce8d6e 100644
--- a/utils/errors.h
+++ b/utils/errors.h
@@ -55,6 +55,8 @@ typedef enum {
NSERROR_PNG_ERROR, /**< A PNG error occurred */
+ NSERROR_SVG_ERROR, /**< A SVG error occurred */
+
NSERROR_BAD_ENCODING, /**< The character set is unknown */
NSERROR_NEED_DATA, /**< More data needed */
-----------------------------------------------------------------------
Summary of changes:
content/handlers/image/rsvg.c | 21 ++++--------
content/handlers/image/svg.c | 5 +--
desktop/browser.c | 1 +
render/html_css.c | 1 +
render/html_object.c | 1 +
render/html_script.c | 14 ++++----
render/textplain.c | 8 ++---
test/Makefile | 2 +-
test/messages.c | 1 -
utils/errors.h | 74 ++++++++++++-----------------------------
utils/messages.c | 4 ---
11 files changed, 41 insertions(+), 91 deletions(-)
diff --git a/content/handlers/image/rsvg.c b/content/handlers/image/rsvg.c
index 24819df..d45a968 100644
--- a/content/handlers/image/rsvg.c
+++ b/content/handlers/image/rsvg.c
@@ -62,8 +62,6 @@ typedef struct rsvg_content {
static nserror rsvg_create_svg_data(rsvg_content *c)
{
- union content_msg_data msg_data;
-
c->rsvgh = NULL;
c->cs = NULL;
c->ct = NULL;
@@ -71,8 +69,7 @@ static nserror rsvg_create_svg_data(rsvg_content *c)
if ((c->rsvgh = rsvg_handle_new()) == NULL) {
LOG("rsvg_handle_new() returned NULL.");
- msg_data.error = messages_get("NoMemory");
- content_broadcast(&c->base, CONTENT_MSG_ERROR, &msg_data);
+ content_broadcast_errorcode(&c->base, NSERROR_NOMEM);
return NSERROR_NOMEM;
}
@@ -115,14 +112,12 @@ static bool rsvg_process_data(struct content *c, const char *data,
unsigned int size)
{
rsvg_content *d = (rsvg_content *) c;
- union content_msg_data msg_data;
GError *err = NULL;
if (rsvg_handle_write(d->rsvgh, (const guchar *)data, (gsize)size,
&err) == FALSE) {
LOG("rsvg_handle_write returned an error: %s", err->message);
- msg_data.error = err->message;
- content_broadcast(c, CONTENT_MSG_ERROR, &msg_data);
+ content_broadcast_errorcode(c, NSERROR_SVG_ERROR);
return false;
}
@@ -161,14 +156,12 @@ static inline void rsvg_argb_to_abgr(uint8_t *pixels,
static bool rsvg_convert(struct content *c)
{
rsvg_content *d = (rsvg_content *) c;
- union content_msg_data msg_data;
RsvgDimensionData rsvgsize;
GError *err = NULL;
if (rsvg_handle_close(d->rsvgh, &err) == FALSE) {
LOG("rsvg_handle_close returned an error: %s", err->message);
- msg_data.error = err->message;
- content_broadcast(c, CONTENT_MSG_ERROR, &msg_data);
+ content_broadcast_errorcode(c, NSERROR_SVG_ERROR);
return false;
}
@@ -186,7 +179,7 @@ static bool rsvg_convert(struct content *c)
BITMAP_NEW)) == NULL) {
LOG("Failed to create bitmap for rsvg render.");
msg_data.error = messages_get("NoMemory");
- content_broadcast(c, CONTENT_MSG_ERROR, &msg_data);
+ content_broadcast_errorcode(c, NSERROR_NOMEM);
return false;
}
@@ -196,15 +189,13 @@ static bool rsvg_convert(struct content *c)
c->width, c->height,
guit->bitmap->get_rowstride(d->bitmap))) == NULL) {
LOG("Failed to create Cairo image surface for rsvg render.");
- msg_data.error = messages_get("NoMemory");
- content_broadcast(c, CONTENT_MSG_ERROR, &msg_data);
+ content_broadcast_errorcode(c, NSERROR_NOMEM);
return false;
}
if ((d->ct = cairo_create(d->cs)) == NULL) {
LOG("Failed to create Cairo drawing context for rsvg render.");
- msg_data.error = messages_get("NoMemory");
- content_broadcast(c, CONTENT_MSG_ERROR, &msg_data);
+ content_broadcast_errorcode(c, NSERROR_NOMEM);
return false;
}
diff --git a/content/handlers/image/svg.c b/content/handlers/image/svg.c
index f31ee1f..2edc7bd 100644
--- a/content/handlers/image/svg.c
+++ b/content/handlers/image/svg.c
@@ -49,8 +49,6 @@ typedef struct svg_content {
static nserror svg_create_svg_data(svg_content *c)
{
- union content_msg_data msg_data;
-
c->diagram = svgtiny_create();
if (c->diagram == NULL)
goto no_memory;
@@ -61,8 +59,7 @@ static nserror svg_create_svg_data(svg_content *c)
return NSERROR_OK;
no_memory:
- msg_data.error = messages_get("NoMemory");
- content_broadcast(&c->base, CONTENT_MSG_ERROR, &msg_data);
+ content_broadcast_errorcode(&c->base, NSERROR_NOMEM);
return NSERROR_NOMEM;
}
diff --git a/desktop/browser.c b/desktop/browser.c
index e7ff158..8d57a2a 100644
--- a/desktop/browser.c
+++ b/desktop/browser.c
@@ -1094,6 +1094,7 @@ browser_window_favicon_callback(hlcache_handle *c,
break;
case CONTENT_MSG_ERROR:
+ case CONTENT_MSG_ERRORCODE:
/* clean up after ourselves */
if (c == bw->favicon.loading) {
diff --git a/render/html_css.c b/render/html_css.c
index 4d54693..47c2185 100644
--- a/render/html_css.c
+++ b/render/html_css.c
@@ -109,6 +109,7 @@ html_convert_css_callback(hlcache_handle *css,
break;
case CONTENT_MSG_ERROR:
+ case CONTENT_MSG_ERRORCODE:
LOG("stylesheet %s failed: %s", nsurl_access(hlcache_handle_get_url(css)),
event->data.error);
hlcache_handle_release(css);
s->sheet = NULL;
diff --git a/render/html_object.c b/render/html_object.c
index 12780ca..f304e91 100644
--- a/render/html_object.c
+++ b/render/html_object.c
@@ -181,6 +181,7 @@ html_object_callback(hlcache_handle *object,
}
break;
+ case CONTENT_MSG_ERRORCODE:
case CONTENT_MSG_ERROR:
hlcache_handle_release(object);
diff --git a/render/html_script.c b/render/html_script.c
index c07e5a3..6ed74c5 100644
--- a/render/html_script.c
+++ b/render/html_script.c
@@ -173,6 +173,7 @@ convert_script_async_cb(hlcache_handle *script,
case CONTENT_MSG_ERROR:
LOG("script %s failed: %s", nsurl_access(hlcache_handle_get_url(script)),
event->data.error);
+ case CONTENT_MSG_ERRORCODE:
hlcache_handle_release(script);
s->data.handle = NULL;
parent->base.active--;
@@ -226,6 +227,7 @@ convert_script_defer_cb(hlcache_handle *script,
case CONTENT_MSG_ERROR:
LOG("script %s failed: %s", nsurl_access(hlcache_handle_get_url(script)),
event->data.error);
+ case CONTENT_MSG_ERRORCODE:
hlcache_handle_release(script);
s->data.handle = NULL;
parent->base.active--;
@@ -298,6 +300,7 @@ convert_script_sync_cb(hlcache_handle *script,
case CONTENT_MSG_ERROR:
LOG("script %s failed: %s", nsurl_access(hlcache_handle_get_url(script)),
event->data.error);
+ case CONTENT_MSG_ERRORCODE:
hlcache_handle_release(script);
s->data.handle = NULL;
@@ -343,7 +346,6 @@ exec_src_script(html_content *c,
nsurl *joined;
hlcache_child_context child;
struct html_script *nscript;
- union content_msg_data msg_data;
bool async;
bool defer;
enum html_script_type script_type;
@@ -354,8 +356,7 @@ exec_src_script(html_content *c,
/* src url */
ns_error = nsurl_join(c->base_url, dom_string_data(src), &joined);
if (ns_error != NSERROR_OK) {
- msg_data.error = messages_get("NoMemory");
- content_broadcast(&c->base, CONTENT_MSG_ERROR, &msg_data);
+ content_broadcast_errorcode(&c->base, NSERROR_NOMEM);
return DOM_HUBBUB_NOMEM;
}
@@ -410,8 +411,7 @@ exec_src_script(html_content *c,
nscript = html_process_new_script(c, mimetype, script_type);
if (nscript == NULL) {
nsurl_unref(joined);
- msg_data.error = messages_get("NoMemory");
- content_broadcast(&c->base, CONTENT_MSG_ERROR, &msg_data);
+ content_broadcast_errorcode(&c->base, NSERROR_NOMEM);
return DOM_HUBBUB_NOMEM;
}
@@ -465,7 +465,6 @@ exec_src_script(html_content *c,
static dom_hubbub_error
exec_inline_script(html_content *c, dom_node *node, dom_string *mimetype)
{
- union content_msg_data msg_data;
dom_string *script;
dom_exception exc; /* returned by libdom functions */
struct lwc_string_s *lwcmimetype;
@@ -482,8 +481,7 @@ exec_inline_script(html_content *c, dom_node *node, dom_string
*mimetype)
if (nscript == NULL) {
dom_string_unref(script);
- msg_data.error = messages_get("NoMemory");
- content_broadcast(&c->base, CONTENT_MSG_ERROR, &msg_data);
+ content_broadcast_errorcode(&c->base, NSERROR_NOMEM);
return DOM_HUBBUB_NOMEM;
}
diff --git a/render/textplain.c b/render/textplain.c
index 35e3e4b..2f2d757 100644
--- a/render/textplain.c
+++ b/render/textplain.c
@@ -150,7 +150,6 @@ textplain_create_internal(textplain_content *c, lwc_string *encoding)
char *utf8_data;
parserutils_inputstream *stream;
parserutils_error error;
- union content_msg_data msg_data;
textplain_style.size = (nsoption_int(font_size) * FONT_SIZE_SCALE) / 10;
@@ -185,8 +184,7 @@ textplain_create_internal(textplain_content *c, lwc_string *encoding)
return NSERROR_OK;
no_memory:
- msg_data.error = messages_get("NoMemory");
- content_broadcast(&c->base, CONTENT_MSG_ERROR, &msg_data);
+ content_broadcast_errorcode(&c->base, NSERROR_NOMEM);
return NSERROR_NOMEM;
}
@@ -347,7 +345,6 @@ textplain_process_data(struct content *c, const char *data, unsigned
int size)
{
textplain_content *text = (textplain_content *) c;
parserutils_inputstream *stream = text->inputstream;
- union content_msg_data msg_data;
parserutils_error error;
error = parserutils_inputstream_append(stream,
@@ -362,8 +359,7 @@ textplain_process_data(struct content *c, const char *data, unsigned
int size)
return true;
no_memory:
- msg_data.error = messages_get("NoMemory");
- content_broadcast(c, CONTENT_MSG_ERROR, &msg_data);
+ content_broadcast_errorcode(c, NSERROR_NOMEM);
return false;
}
diff --git a/test/Makefile b/test/Makefile
index 39953a3..64c3f39 100644
--- a/test/Makefile
+++ b/test/Makefile
@@ -134,7 +134,7 @@ endif
BASE_TESTCFLAGS := -std=c99 -g \
$(COMMON_WARNFLAGS) \
- -D_BSD_SOURCE \
+ -D_DEFAULT_SOURCE \
-D_POSIX_C_SOURCE=200809L \
-D_XOPEN_SOURCE=600 \
-Itest -Iinclude -Icontent/handlers -Ifrontends -I. -I.. \
diff --git a/test/messages.c b/test/messages.c
index d102e36..ae82d1e 100644
--- a/test/messages.c
+++ b/test/messages.c
@@ -52,7 +52,6 @@ struct message_test_vec_s message_errorcode_test_vec[] = {
{ NSERROR_SAVE_FAILED, "SaveFailed" },
{ NSERROR_CLONE_FAILED, "CloneFailed" },
{ NSERROR_INIT_FAILED, "InitFailed" },
- { NSERROR_MNG_ERROR, "Error converting MNG/PNG/JNG: %i" },
{ NSERROR_BAD_ENCODING, "BadEncoding" },
{ NSERROR_NEED_DATA, "NeedData" },
{ NSERROR_ENCODING_CHANGE, "EncodingChanged" },
diff --git a/utils/errors.h b/utils/errors.h
index 3ab40b2..ad8ae42 100644
--- a/utils/errors.h
+++ b/utils/errors.h
@@ -27,66 +27,36 @@
* Enumeration of error codes
*/
typedef enum {
- NSERROR_OK, /**< No error */
-
- NSERROR_UNKNOWN, /**< Unknown error - DO *NOT* USE */
-
- NSERROR_NOMEM, /**< Memory exhaustion */
-
- NSERROR_NO_FETCH_HANDLER, /**< No fetch handler for URL scheme */
-
- NSERROR_NOT_FOUND, /**< Requested item not found */
-
- NSERROR_NOT_DIRECTORY, /**< Missing directory */
-
- NSERROR_SAVE_FAILED, /**< Failed to save data */
-
- NSERROR_CLONE_FAILED, /**< Failed to clone handle */
-
- NSERROR_INIT_FAILED, /**< Initialisation failed */
-
- NSERROR_MNG_ERROR, /**< An MNG error occurred */
-
+ NSERROR_OK, /**< No error */
+ NSERROR_UNKNOWN, /**< Unknown error - DO *NOT* USE */
+ NSERROR_NOMEM, /**< Memory exhaustion */
+ NSERROR_NO_FETCH_HANDLER, /**< No fetch handler for URL scheme */
+ NSERROR_NOT_FOUND, /**< Requested item not found */
+ NSERROR_NOT_DIRECTORY, /**< Missing directory */
+ NSERROR_SAVE_FAILED, /**< Failed to save data */
+ NSERROR_CLONE_FAILED, /**< Failed to clone handle */
+ NSERROR_INIT_FAILED, /**< Initialisation failed */
NSERROR_BMP_ERROR, /**< A BMP error occurred */
-
NSERROR_GIF_ERROR, /**< A GIF error occurred */
-
NSERROR_ICO_ERROR, /**< A ICO error occurred */
-
NSERROR_PNG_ERROR, /**< A PNG error occurred */
-
- NSERROR_BAD_ENCODING, /**< The character set is unknown */
-
- NSERROR_NEED_DATA, /**< More data needed */
-
- NSERROR_ENCODING_CHANGE, /**< The character changed */
-
- NSERROR_BAD_PARAMETER, /**< Bad Parameter */
-
- NSERROR_INVALID, /**< Invalid data */
-
- NSERROR_BOX_CONVERT, /**< Box conversion failed */
-
- NSERROR_STOPPED, /**< Content conversion stopped */
-
- NSERROR_DOM, /**< DOM call returned error */
-
- NSERROR_CSS, /**< CSS call returned error */
-
+ NSERROR_SVG_ERROR, /**< A SVG error occurred */
+ NSERROR_BAD_ENCODING, /**< The character set is unknown */
+ NSERROR_NEED_DATA, /**< More data needed */
+ NSERROR_ENCODING_CHANGE, /**< The character changed */
+ NSERROR_BAD_PARAMETER, /**< Bad Parameter */
+ NSERROR_INVALID, /**< Invalid data */
+ NSERROR_BOX_CONVERT, /**< Box conversion failed */
+ NSERROR_STOPPED, /**< Content conversion stopped */
+ NSERROR_DOM, /**< DOM call returned error */
+ NSERROR_CSS, /**< CSS call returned error */
NSERROR_CSS_BASE, /**< CSS base sheet failed */
-
- NSERROR_BAD_URL, /**< Bad URL */
-
- NSERROR_BAD_CONTENT, /**< Bad Content */
-
+ NSERROR_BAD_URL, /**< Bad URL */
+ NSERROR_BAD_CONTENT, /**< Bad Content */
NSERROR_FRAME_DEPTH, /**< Exceeded frame depth */
-
NSERROR_PERMISSION, /**< Permission error */
-
- NSERROR_NOSPACE, /**< Insufficient space */
-
+ NSERROR_NOSPACE, /**< Insufficient space */
NSERROR_BAD_SIZE, /**< Bad size */
-
NSERROR_NOT_IMPLEMENTED, /**< Functionality is not implemented */
} nserror;
diff --git a/utils/messages.c b/utils/messages.c
index 0c558cd..5f55cb9 100644
--- a/utils/messages.c
+++ b/utils/messages.c
@@ -350,10 +350,6 @@ const char *messages_get_errorcode(nserror code)
/* Initialisation failed */
return messages_get_ctx("InitFailed", messages_hash);
- case NSERROR_MNG_ERROR:
- /* An MNG error occurred */
- return messages_get_ctx("MNGError", messages_hash);
-
case NSERROR_BAD_ENCODING:
/* The character set is unknown */
return messages_get_ctx("BadEncoding", messages_hash);
--
NetSurf Browser