mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-12-22 04:02:34 +03:00
add errorcode content broadcast API
This commit is contained in:
parent
840284b24d
commit
2fef76db15
@ -678,6 +678,23 @@ void content_broadcast(struct content *c, content_msg msg,
|
||||
}
|
||||
}
|
||||
|
||||
/* exported interface documented in content_protected.h */
|
||||
void content_broadcast_errorcode(struct content *c, nserror errorcode)
|
||||
{
|
||||
struct content_user *user, *next;
|
||||
union content_msg_data data;
|
||||
|
||||
assert(c);
|
||||
|
||||
data.errorcode = errorcode;
|
||||
|
||||
for (user = c->user_list->next; user != 0; user = next) {
|
||||
next = user->next; /* user may be destroyed during callback */
|
||||
if (user->callback != 0)
|
||||
user->callback(c, CONTENT_MSG_ERRORCODE, data, user->pw);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* A window containing the content has been opened.
|
||||
|
@ -160,6 +160,11 @@ void content_set_error(struct content *c);
|
||||
void content_set_status(struct content *c, const char *status_message);
|
||||
void content_broadcast(struct content *c, content_msg msg,
|
||||
union content_msg_data data);
|
||||
/**
|
||||
* Send an errorcode message to all users.
|
||||
*/
|
||||
void content_broadcast_errorcode(struct content *c, nserror errorcode);
|
||||
|
||||
void content_add_error(struct content *c, const char *token,
|
||||
unsigned int line);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user