commit: c14d50f1da273620944f2f60a3af43d3d9f35c57
parent 0728f8a127f4dc14e438b9912feefc2799aa8ba2
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date: Sat, 13 Apr 2019 20:29:34 +0200
WebViewCb_web_process_terminated: Change tab’s title with the reason
Diffstat:
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/badwolf.c b/badwolf.c
@@ -87,19 +87,18 @@ static gboolean
WebViewCb_web_process_terminated(WebKitWebView *webView, WebKitWebProcessTerminationReason reason)
{
(void)webView;
- char *str_reason;
switch(reason)
{
- case WEBKIT_WEB_PROCESS_CRASHED: str_reason = "the web process crashed."; break;
+ case WEBKIT_WEB_PROCESS_CRASHED: g_fprintf(stderr, "the web process crashed."; webView_tab_label_change(browser, "Crashed"); break;
case WEBKIT_WEB_PROCESS_EXCEEDED_MEMORY_LIMIT:
- str_reason = "the web process exceeded the memory limit.";
+ g_fprintf(stderr, "the web process exceeded the memory limit.";
+ webView_tab_label_change(browser, "Out of Memory");
break;
- default: str_reason = "the web process terminated for an unknown reason.";
+ default: g_fprintf(stderr, "the web process terminated for an unknown reason.");
+ webView_tab_label_change(browser, "Unknown Crash");
}
- g_fprintf(stderr, "BadWolf [signal: web-process-terminated]: %s\n", str_reason);
-
return FALSE;
}