mirror of
https://github.com/netsurf-browser/netsurf
synced 2025-03-05 14:51:47 +03:00
Remove asserts for default cases from all content message handlers; this is laborious and is no longer useful for catching bugs.
This commit is contained in:
parent
33f94c265e
commit
1bd4a34a27
13
css/css.c
13
css/css.c
@ -655,19 +655,8 @@ nserror nscss_import(hlcache_handle *handle,
|
||||
/* Already released handle */
|
||||
break;
|
||||
|
||||
case CONTENT_MSG_LOADING:
|
||||
case CONTENT_MSG_READY:
|
||||
case CONTENT_MSG_STATUS:
|
||||
case CONTENT_MSG_REDIRECT:
|
||||
/* messages content handler will legitamately recive
|
||||
* but does not need to handle
|
||||
*/
|
||||
break;
|
||||
|
||||
default:
|
||||
/* all other messages are unexpected and fatal */
|
||||
LOG(("Unhandled message type %d", event->type));
|
||||
assert(0);
|
||||
break;
|
||||
}
|
||||
|
||||
/* Preserve out-of-memory. Anything else is OK */
|
||||
|
@ -1556,7 +1556,7 @@ static nserror browser_window_callback(hlcache_handle *c,
|
||||
break;
|
||||
|
||||
default:
|
||||
assert(0);
|
||||
break;
|
||||
}
|
||||
|
||||
return NSERROR_OK;
|
||||
|
@ -304,9 +304,6 @@ nserror search_web_ico_callback(hlcache_handle *ico,
|
||||
const hlcache_event *event, void *pw)
|
||||
{
|
||||
switch (event->type) {
|
||||
case CONTENT_MSG_LOADING:
|
||||
case CONTENT_MSG_READY:
|
||||
break;
|
||||
|
||||
case CONTENT_MSG_DONE:
|
||||
LOG(("got favicon '%s'", nsurl_access(hlcache_handle_get_url(ico))));
|
||||
@ -322,11 +319,8 @@ nserror search_web_ico_callback(hlcache_handle *ico,
|
||||
search_web_retrieve_ico(true);
|
||||
break;
|
||||
|
||||
case CONTENT_MSG_STATUS:
|
||||
break;
|
||||
|
||||
default:
|
||||
assert(0);
|
||||
break;
|
||||
}
|
||||
|
||||
return NSERROR_OK;
|
||||
|
14
gtk/theme.c
14
gtk/theme.c
@ -793,11 +793,8 @@ theme_install_callback(hlcache_handle *c,
|
||||
const hlcache_event *event, void *pw)
|
||||
{
|
||||
switch (event->type) {
|
||||
case CONTENT_MSG_READY:
|
||||
break;
|
||||
|
||||
case CONTENT_MSG_DONE:
|
||||
{
|
||||
case CONTENT_MSG_DONE: {
|
||||
const char *source_data;
|
||||
unsigned long source_size;
|
||||
|
||||
@ -807,21 +804,14 @@ theme_install_callback(hlcache_handle *c,
|
||||
warn_user("ThemeInvalid", 0);
|
||||
|
||||
hlcache_handle_release(c);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case CONTENT_MSG_ERROR:
|
||||
warn_user(event->data.error, 0);
|
||||
break;
|
||||
|
||||
case CONTENT_MSG_STATUS:
|
||||
break;
|
||||
|
||||
case CONTENT_MSG_LOADING:
|
||||
case CONTENT_MSG_REFORMAT:
|
||||
case CONTENT_MSG_REDRAW:
|
||||
default:
|
||||
assert(0);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -97,14 +97,6 @@ html_convert_css_callback(hlcache_handle *css,
|
||||
assert(i != parent->stylesheet_count);
|
||||
|
||||
switch (event->type) {
|
||||
case CONTENT_MSG_LOADING:
|
||||
break;
|
||||
|
||||
case CONTENT_MSG_READY:
|
||||
break;
|
||||
|
||||
case CONTENT_MSG_REDIRECT:
|
||||
break;
|
||||
|
||||
case CONTENT_MSG_DONE:
|
||||
LOG(("done stylesheet slot %d '%s'", i,
|
||||
@ -143,7 +135,7 @@ html_convert_css_callback(hlcache_handle *css,
|
||||
return NSERROR_OK;
|
||||
|
||||
default:
|
||||
assert(0);
|
||||
break;
|
||||
}
|
||||
|
||||
if (html_can_begin_conversion(parent)) {
|
||||
|
@ -203,10 +203,6 @@ html_object_callback(hlcache_handle *object,
|
||||
}
|
||||
break;
|
||||
|
||||
case CONTENT_MSG_REFORMAT:
|
||||
case CONTENT_MSG_REDIRECT:
|
||||
break;
|
||||
|
||||
case CONTENT_MSG_REDRAW:
|
||||
if (c->base.status != CONTENT_STATUS_LOADING) {
|
||||
union content_msg_data data = event->data;
|
||||
@ -440,7 +436,7 @@ html_object_callback(hlcache_handle *object,
|
||||
break;
|
||||
|
||||
default:
|
||||
assert(0);
|
||||
break;
|
||||
}
|
||||
|
||||
if (c->base.status == CONTENT_STATUS_READY && c->base.active == 0 &&
|
||||
|
@ -172,8 +172,6 @@ convert_script_async_cb(hlcache_handle *script,
|
||||
parent->base.active--;
|
||||
LOG(("%d fetches active", parent->base.active));
|
||||
|
||||
|
||||
|
||||
break;
|
||||
|
||||
case CONTENT_MSG_ERROR:
|
||||
@ -188,11 +186,8 @@ convert_script_async_cb(hlcache_handle *script,
|
||||
|
||||
break;
|
||||
|
||||
case CONTENT_MSG_STATUS:
|
||||
break;
|
||||
|
||||
default:
|
||||
assert(0);
|
||||
break;
|
||||
}
|
||||
|
||||
return NSERROR_OK;
|
||||
@ -219,11 +214,6 @@ convert_script_defer_cb(hlcache_handle *script,
|
||||
assert(i != parent->scripts_count);
|
||||
|
||||
switch (event->type) {
|
||||
case CONTENT_MSG_LOADING:
|
||||
break;
|
||||
|
||||
case CONTENT_MSG_READY:
|
||||
break;
|
||||
|
||||
case CONTENT_MSG_DONE:
|
||||
LOG(("script %d done '%s'", i,
|
||||
@ -245,11 +235,8 @@ convert_script_defer_cb(hlcache_handle *script,
|
||||
|
||||
break;
|
||||
|
||||
case CONTENT_MSG_STATUS:
|
||||
break;
|
||||
|
||||
default:
|
||||
assert(0);
|
||||
break;
|
||||
}
|
||||
|
||||
/* if there are no active fetches remaining begin post parse
|
||||
@ -333,19 +320,8 @@ convert_script_sync_cb(hlcache_handle *script,
|
||||
|
||||
break;
|
||||
|
||||
case CONTENT_MSG_LOADING:
|
||||
case CONTENT_MSG_READY:
|
||||
case CONTENT_MSG_STATUS:
|
||||
case CONTENT_MSG_REDIRECT:
|
||||
/* messages content handler will legitamately recive
|
||||
* but does not need to handle
|
||||
*/
|
||||
break;
|
||||
|
||||
default:
|
||||
/* all other messages are unexpected and fatal */
|
||||
LOG(("Unhandled message type %d", event->type));
|
||||
assert(0);
|
||||
break;
|
||||
}
|
||||
|
||||
/* if there are no active fetches remaining begin post parse
|
||||
|
@ -89,8 +89,6 @@ nserror theme_install_callback(hlcache_handle *handle,
|
||||
int author_indent = 0;
|
||||
|
||||
switch (event->type) {
|
||||
case CONTENT_MSG_READY:
|
||||
break;
|
||||
|
||||
case CONTENT_MSG_DONE:
|
||||
{
|
||||
@ -129,11 +127,7 @@ nserror theme_install_callback(hlcache_handle *handle,
|
||||
warn_user(event->data.error, 0);
|
||||
break;
|
||||
|
||||
case CONTENT_MSG_STATUS:
|
||||
break;
|
||||
|
||||
default:
|
||||
assert(0);
|
||||
break;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user