<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[226019] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/226019">226019</a></dd>
<dt>Author</dt> <dd>carlosgc@webkit.org</dd>
<dt>Date</dt> <dd>2017-12-18 00:55:12 -0800 (Mon, 18 Dec 2017)</dd>
</dl>

<h3>Log Message</h3>
<pre>[GTK][WPE] Add WebKitWebView::web-process-terminated signal and deprecate web-process-crashed
https://bugs.webkit.org/show_bug.cgi?id=180862

Reviewed by Michael Catanzaro.

Source/WebKit:

Once the memory pressure web process monitor is enabled in bug #180861 the web process can be killed due to
memory limits. We need to expose the reason of the web process termination to allow applications handle the
memory limit case.

* UIProcess/API/glib/WebKitNavigationClient.cpp:
* UIProcess/API/glib/WebKitWebView.cpp:
(webkit_web_view_class_init):
(webkitWebViewWebProcessTerminated):
(webkitWebViewWebProcessCrashed): Deleted.
* UIProcess/API/glib/WebKitWebViewPrivate.h:
* UIProcess/API/gtk/WebKitWebView.h:
* UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
* UIProcess/API/wpe/WebKitWebView.h:

Tools:

Use WebKitWebView::web-process-terminated instead of web-process-crashed in tests. I'm not adding a test for
WEBKIT_WEB_PROCESS_EXCEEDED_MEMORY_LIMIT because we would need to allocate more than 1GB in the test and wait
30 seconds, and we don't want to do either in unit tests.

* TestWebKitAPI/Tests/WebKitGLib/TestWebExtensions.cpp:
(webProcessTerminatedCallback):
(testWebKitWebViewProcessCrashed):
(webProcessCrashedCallback): Deleted.
* TestWebKitAPI/glib/WebKitGLib/WebViewTest.cpp:
(WebViewTest::initializeWebView):
(WebViewTest::webProcessTerminated):
(WebViewTest::webProcessCrashed): Deleted.
* TestWebKitAPI/glib/WebKitGLib/WebViewTest.h:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebKitChangeLog">trunk/Source/WebKit/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitUIProcessAPIglibWebKitNavigationClientcpp">trunk/Source/WebKit/UIProcess/API/glib/WebKitNavigationClient.cpp</a></li>
<li><a href="#trunkSourceWebKitUIProcessAPIglibWebKitWebViewcpp">trunk/Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp</a></li>
<li><a href="#trunkSourceWebKitUIProcessAPIglibWebKitWebViewPrivateh">trunk/Source/WebKit/UIProcess/API/glib/WebKitWebViewPrivate.h</a></li>
<li><a href="#trunkSourceWebKitUIProcessAPIgtkWebKitWebViewh">trunk/Source/WebKit/UIProcess/API/gtk/WebKitWebView.h</a></li>
<li><a href="#trunkSourceWebKitUIProcessAPIgtkdocswebkit2gtk40sectionstxt">trunk/Source/WebKit/UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt</a></li>
<li><a href="#trunkSourceWebKitUIProcessAPIwpeWebKitWebViewh">trunk/Source/WebKit/UIProcess/API/wpe/WebKitWebView.h</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsWebKitGLibTestWebExtensionscpp">trunk/Tools/TestWebKitAPI/Tests/WebKitGLib/TestWebExtensions.cpp</a></li>
<li><a href="#trunkToolsTestWebKitAPIglibWebKitGLibWebViewTestcpp">trunk/Tools/TestWebKitAPI/glib/WebKitGLib/WebViewTest.cpp</a></li>
<li><a href="#trunkToolsTestWebKitAPIglibWebKitGLibWebViewTesth">trunk/Tools/TestWebKitAPI/glib/WebKitGLib/WebViewTest.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKitChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/ChangeLog (226018 => 226019)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/ChangeLog    2017-12-18 08:25:08 UTC (rev 226018)
+++ trunk/Source/WebKit/ChangeLog       2017-12-18 08:55:12 UTC (rev 226019)
</span><span class="lines">@@ -1,5 +1,26 @@
</span><span class="cx"> 2017-12-18  Carlos Garcia Campos  <cgarcia@igalia.com>
</span><span class="cx"> 
</span><ins>+        [GTK][WPE] Add WebKitWebView::web-process-terminated signal and deprecate web-process-crashed
+        https://bugs.webkit.org/show_bug.cgi?id=180862
+
+        Reviewed by Michael Catanzaro.
+
+        Once the memory pressure web process monitor is enabled in bug #180861 the web process can be killed due to
+        memory limits. We need to expose the reason of the web process termination to allow applications handle the
+        memory limit case.
+
+        * UIProcess/API/glib/WebKitNavigationClient.cpp:
+        * UIProcess/API/glib/WebKitWebView.cpp:
+        (webkit_web_view_class_init):
+        (webkitWebViewWebProcessTerminated):
+        (webkitWebViewWebProcessCrashed): Deleted.
+        * UIProcess/API/glib/WebKitWebViewPrivate.h:
+        * UIProcess/API/gtk/WebKitWebView.h:
+        * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
+        * UIProcess/API/wpe/WebKitWebView.h:
+
+2017-12-18  Carlos Garcia Campos  <cgarcia@igalia.com>
+
</ins><span class="cx">         [GTK][WPE] Enable WebProcess memory monitor
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=180861
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessAPIglibWebKitNavigationClientcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/API/glib/WebKitNavigationClient.cpp (226018 => 226019)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/API/glib/WebKitNavigationClient.cpp        2017-12-18 08:25:08 UTC (rev 226018)
+++ trunk/Source/WebKit/UIProcess/API/glib/WebKitNavigationClient.cpp   2017-12-18 08:55:12 UTC (rev 226019)
</span><span class="lines">@@ -107,9 +107,17 @@
</span><span class="cx"> 
</span><span class="cx">     void processDidTerminate(WebPageProxy&, ProcessTerminationReason reason) override
</span><span class="cx">     {
</span><del>-        if (reason == ProcessTerminationReason::RequestedByClient)
-            return;
-        webkitWebViewWebProcessCrashed(m_webView);
</del><ins>+        switch (reason) {
+        case ProcessTerminationReason::Crash:
+            webkitWebViewWebProcessTerminated(m_webView, WEBKIT_WEB_PROCESS_CRASHED);
+            break;
+        case ProcessTerminationReason::ExceededMemoryLimit:
+            webkitWebViewWebProcessTerminated(m_webView, WEBKIT_WEB_PROCESS_EXCEEDED_MEMORY_LIMIT);
+            break;
+        case ProcessTerminationReason::ExceededCPULimit:
+        case ProcessTerminationReason::RequestedByClient:
+            break;
+        }
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     void decidePolicyForNavigationAction(WebPageProxy&, Ref<API::NavigationAction>&& navigationAction, Ref<WebFramePolicyListenerProxy>&& listener, API::Object* /* userData */) override
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessAPIglibWebKitWebViewcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp (226018 => 226019)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp 2017-12-18 08:25:08 UTC (rev 226018)
+++ trunk/Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp    2017-12-18 08:55:12 UTC (rev 226019)
</span><span class="lines">@@ -145,6 +145,7 @@
</span><span class="cx">     INSECURE_CONTENT_DETECTED,
</span><span class="cx"> 
</span><span class="cx">     WEB_PROCESS_CRASHED,
</span><ins>+    WEB_PROCESS_TERMINATED,
</ins><span class="cx"> 
</span><span class="cx">     AUTHENTICATE,
</span><span class="cx"> 
</span><span class="lines">@@ -1806,6 +1807,8 @@
</span><span class="cx">      *
</span><span class="cx">      * Returns: %TRUE to stop other handlers from being invoked for the event.
</span><span class="cx">      *    %FALSE to propagate the event further.
</span><ins>+     *
+     * Deprecated: 2.20: Use WebKitWebView::web-process-terminated instead.
</ins><span class="cx">      */
</span><span class="cx">     signals[WEB_PROCESS_CRASHED] = g_signal_new(
</span><span class="cx">         "web-process-crashed",
</span><span class="lines">@@ -1817,6 +1820,26 @@
</span><span class="cx">         G_TYPE_BOOLEAN, 0);
</span><span class="cx"> 
</span><span class="cx">     /**
</span><ins>+     * WebKitWebView::web-process-terminated:
+     * @web_view: the #WebKitWebView
+     * @reason: the a #WebKitWebProcessTerminationReason
+     *
+     * This signal is emitted when the web process terminates abnormally due
+     * to @reason.
+     *
+     * Since: 2.20
+     */
+    signals[WEB_PROCESS_TERMINATED] = g_signal_new(
+        "web-process-terminated",
+        G_TYPE_FROM_CLASS(webViewClass),
+        G_SIGNAL_RUN_LAST,
+        G_STRUCT_OFFSET(WebKitWebViewClass, web_process_terminated),
+        0, 0,
+        g_cclosure_marshal_VOID__ENUM,
+        G_TYPE_NONE, 1,
+        WEBKIT_TYPE_WEB_PROCESS_TERMINATION_REASON);
+
+    /**
</ins><span class="cx">      * WebKitWebView::authenticate:
</span><span class="cx">      * @web_view: the #WebKitWebView on which the signal is emitted
</span><span class="cx">      * @request: a #WebKitAuthenticationRequest
</span><span class="lines">@@ -3818,10 +3841,13 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-void webkitWebViewWebProcessCrashed(WebKitWebView* webView)
</del><ins>+void webkitWebViewWebProcessTerminated(WebKitWebView* webView, WebKitWebProcessTerminationReason reason)
</ins><span class="cx"> {
</span><del>-    gboolean returnValue;
-    g_signal_emit(webView, signals[WEB_PROCESS_CRASHED], 0, &returnValue);
</del><ins>+    if (reason == WEBKIT_WEB_PROCESS_CRASHED) {
+        gboolean returnValue;
+        g_signal_emit(webView, signals[WEB_PROCESS_CRASHED], 0, &returnValue);
+    }
+    g_signal_emit(webView, signals[WEB_PROCESS_TERMINATED], 0, reason);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(GTK)
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessAPIglibWebKitWebViewPrivateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/API/glib/WebKitWebViewPrivate.h (226018 => 226019)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/API/glib/WebKitWebViewPrivate.h    2017-12-18 08:25:08 UTC (rev 226018)
+++ trunk/Source/WebKit/UIProcess/API/glib/WebKitWebViewPrivate.h       2017-12-18 08:55:12 UTC (rev 226019)
</span><span class="lines">@@ -81,7 +81,7 @@
</span><span class="cx"> void webkitWebViewHandleAuthenticationChallenge(WebKitWebView*, WebKit::AuthenticationChallengeProxy*);
</span><span class="cx"> void webkitWebViewInsecureContentDetected(WebKitWebView*, WebKitInsecureContentEvent);
</span><span class="cx"> bool webkitWebViewEmitShowNotification(WebKitWebView*, WebKitNotification*);
</span><del>-void webkitWebViewWebProcessCrashed(WebKitWebView*);
</del><ins>+void webkitWebViewWebProcessTerminated(WebKitWebView*, WebKitWebProcessTerminationReason);
</ins><span class="cx"> void webkitWebViewIsPlayingAudioChanged(WebKitWebView*);
</span><span class="cx"> void webkitWebViewSelectionDidChange(WebKitWebView*);
</span><span class="cx"> void webkitWebViewRequestInstallMissingMediaPlugins(WebKitWebView*, WebKit::InstallMissingMediaPluginsPermissionRequest&);
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessAPIgtkWebKitWebViewh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/API/gtk/WebKitWebView.h (226018 => 226019)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/API/gtk/WebKitWebView.h    2017-12-18 08:25:08 UTC (rev 226018)
+++ trunk/Source/WebKit/UIProcess/API/gtk/WebKitWebView.h       2017-12-18 08:55:12 UTC (rev 226019)
</span><span class="lines">@@ -186,6 +186,20 @@
</span><span class="cx">   WEBKIT_SNAPSHOT_REGION_FULL_DOCUMENT,
</span><span class="cx"> } WebKitSnapshotRegion;
</span><span class="cx"> 
</span><ins>+/**
+ * WebKitWebProcessTerminationReason:
+ * @WEBKIT_WEB_PROCESS_CRASHED: the web process crashed.
+ * @WEBKIT_WEB_PROCESS_EXCEEDED_MEMORY_LIMIT: the web process exceeded the memory limit.
+ *
+ * Enum values used to specify the reason why the web process terminated abnormally.
+ *
+ * Since: 2.20
+ */
+typedef enum {
+    WEBKIT_WEB_PROCESS_CRASHED,
+    WEBKIT_WEB_PROCESS_EXCEEDED_MEMORY_LIMIT
+} WebKitWebProcessTerminationReason;
+
</ins><span class="cx"> struct _WebKitWebView {
</span><span class="cx">     WebKitWebViewBase parent;
</span><span class="cx"> 
</span><span class="lines">@@ -253,10 +267,11 @@
</span><span class="cx">     gboolean   (* show_option_menu)            (WebKitWebView               *web_view,
</span><span class="cx">                                                 GdkRectangle                *rectangle,
</span><span class="cx">                                                 WebKitOptionMenu            *menu);
</span><ins>+    void       (* web_process_terminated)      (WebKitWebView               *web_view,
+                                                WebKitWebProcessTerminationReason reason);
</ins><span class="cx"> 
</span><span class="cx">     void (*_webkit_reserved0) (void);
</span><span class="cx">     void (*_webkit_reserved1) (void);
</span><del>-    void (*_webkit_reserved2) (void);
</del><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> WEBKIT_API GType
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessAPIgtkdocswebkit2gtk40sectionstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt (226018 => 226019)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt   2017-12-18 08:25:08 UTC (rev 226018)
+++ trunk/Source/WebKit/UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt      2017-12-18 08:55:12 UTC (rev 226019)
</span><span class="lines">@@ -145,6 +145,7 @@
</span><span class="cx"> WebKitInsecureContentEvent
</span><span class="cx"> WebKitSnapshotOptions
</span><span class="cx"> WebKitSnapshotRegion
</span><ins>+WebKitWebProcessTerminationReason
</ins><span class="cx"> 
</span><span class="cx"> <SUBSECTION Editing Commands>
</span><span class="cx"> WEBKIT_EDITING_COMMAND_CUT
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessAPIwpeWebKitWebViewh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/API/wpe/WebKitWebView.h (226018 => 226019)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/API/wpe/WebKitWebView.h    2017-12-18 08:25:08 UTC (rev 226018)
+++ trunk/Source/WebKit/UIProcess/API/wpe/WebKitWebView.h       2017-12-18 08:55:12 UTC (rev 226019)
</span><span class="lines">@@ -153,6 +153,20 @@
</span><span class="cx">     WEBKIT_INSECURE_CONTENT_DISPLAYED
</span><span class="cx"> } WebKitInsecureContentEvent;
</span><span class="cx"> 
</span><ins>+/**
+ * WebKitWebProcessTerminationReason:
+ * @WEBKIT_WEB_PROCESS_CRASHED: the web process crashed.
+ * @WEBKIT_WEB_PROCESS_EXCEEDED_MEMORY_LIMIT: the web process exceeded the memory limit.
+ *
+ * Enum values used to specify the reason why the web process terminated abnormally.
+ *
+ * Since: 2.20
+ */
+typedef enum {
+    WEBKIT_WEB_PROCESS_CRASHED,
+    WEBKIT_WEB_PROCESS_EXCEEDED_MEMORY_LIMIT
+} WebKitWebProcessTerminationReason;
+
</ins><span class="cx"> struct _WebKitWebView {
</span><span class="cx">     GObject parent;
</span><span class="cx"> 
</span><span class="lines">@@ -213,6 +227,8 @@
</span><span class="cx">                                                     GTlsCertificateFlags         errors);
</span><span class="cx">     gboolean       (* show_notification)           (WebKitWebView               *web_view,
</span><span class="cx">                                                     WebKitNotification          *notification);
</span><ins>+    void           (* web_process_terminated)      (WebKitWebView               *web_view,
+                                                    WebKitWebProcessTerminationReason reason);
</ins><span class="cx"> 
</span><span class="cx">     void (*_webkit_reserved0) (void);
</span><span class="cx">     void (*_webkit_reserved1) (void);
</span><span class="lines">@@ -222,7 +238,6 @@
</span><span class="cx">     void (*_webkit_reserved5) (void);
</span><span class="cx">     void (*_webkit_reserved6) (void);
</span><span class="cx">     void (*_webkit_reserved7) (void);
</span><del>-    void (*_webkit_reserved8) (void);
</del><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> WEBKIT_API GType
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (226018 => 226019)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog    2017-12-18 08:25:08 UTC (rev 226018)
+++ trunk/Tools/ChangeLog       2017-12-18 08:55:12 UTC (rev 226019)
</span><span class="lines">@@ -1,3 +1,24 @@
</span><ins>+2017-12-18  Carlos Garcia Campos  <cgarcia@igalia.com>
+
+        [GTK][WPE] Add WebKitWebView::web-process-terminated signal and deprecate web-process-crashed
+        https://bugs.webkit.org/show_bug.cgi?id=180862
+
+        Reviewed by Michael Catanzaro.
+
+        Use WebKitWebView::web-process-terminated instead of web-process-crashed in tests. I'm not adding a test for
+        WEBKIT_WEB_PROCESS_EXCEEDED_MEMORY_LIMIT because we would need to allocate more than 1GB in the test and wait
+        30 seconds, and we don't want to do either in unit tests.
+
+        * TestWebKitAPI/Tests/WebKitGLib/TestWebExtensions.cpp:
+        (webProcessTerminatedCallback):
+        (testWebKitWebViewProcessCrashed):
+        (webProcessCrashedCallback): Deleted.
+        * TestWebKitAPI/glib/WebKitGLib/WebViewTest.cpp:
+        (WebViewTest::initializeWebView):
+        (WebViewTest::webProcessTerminated):
+        (WebViewTest::webProcessCrashed): Deleted.
+        * TestWebKitAPI/glib/WebKitGLib/WebViewTest.h:
+
</ins><span class="cx"> 2017-12-17  Mark Lam  <mark.lam@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Enhance Ref and RefPtr to be able to work with smart pointers.
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebKitGLibTestWebExtensionscpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/Tests/WebKitGLib/TestWebExtensions.cpp (226018 => 226019)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebKitGLib/TestWebExtensions.cpp 2017-12-18 08:25:08 UTC (rev 226018)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitGLib/TestWebExtensions.cpp    2017-12-18 08:55:12 UTC (rev 226019)
</span><span class="lines">@@ -81,8 +81,9 @@
</span><span class="cx">     g_dbus_connection_signal_unsubscribe(connection, id);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static gboolean webProcessCrashedCallback(WebKitWebView*, WebViewTest* test)
</del><ins>+static gboolean webProcessTerminatedCallback(WebKitWebView*, WebKitWebProcessTerminationReason reason, WebViewTest* test)
</ins><span class="cx"> {
</span><ins>+    g_assert_cmpuint(reason, ==, WEBKIT_WEB_PROCESS_CRASHED);
</ins><span class="cx">     test->quitMainLoop();
</span><span class="cx"> 
</span><span class="cx">     return FALSE;
</span><span class="lines">@@ -93,8 +94,8 @@
</span><span class="cx">     test->loadHtml("<html></html>", 0);
</span><span class="cx">     test->waitUntilLoadFinished();
</span><span class="cx"> 
</span><del>-    g_signal_connect_after(test->m_webView, "web-process-crashed",
-        G_CALLBACK(webProcessCrashedCallback), test);
</del><ins>+    g_signal_connect_after(test->m_webView, "web-process-terminated",
+        G_CALLBACK(webProcessTerminatedCallback), test);
</ins><span class="cx"> 
</span><span class="cx">     test->m_expectedWebProcessCrash = true;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPIglibWebKitGLibWebViewTestcpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/glib/WebKitGLib/WebViewTest.cpp (226018 => 226019)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/glib/WebKitGLib/WebViewTest.cpp        2017-12-18 08:25:08 UTC (rev 226018)
+++ trunk/Tools/TestWebKitAPI/glib/WebKitGLib/WebViewTest.cpp   2017-12-18 08:55:12 UTC (rev 226019)
</span><span class="lines">@@ -58,10 +58,10 @@
</span><span class="cx">     platformInitializeWebView();
</span><span class="cx">     assertObjectIsDeletedWhenTestFinishes(G_OBJECT(m_webView));
</span><span class="cx"> 
</span><del>-    g_signal_connect(m_webView, "web-process-crashed", G_CALLBACK(WebViewTest::webProcessCrashed), this);
</del><ins>+    g_signal_connect(m_webView, "web-process-terminated", G_CALLBACK(WebViewTest::webProcessTerminated), this);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-gboolean WebViewTest::webProcessCrashed(WebKitWebView*, WebViewTest* test)
</del><ins>+gboolean WebViewTest::webProcessTerminated(WebKitWebView*, WebKitWebProcessTerminationReason, WebViewTest* test)
</ins><span class="cx"> {
</span><span class="cx">     if (test->m_expectedWebProcessCrash) {
</span><span class="cx">         test->m_expectedWebProcessCrash = false;
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPIglibWebKitGLibWebViewTesth"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/glib/WebKitGLib/WebViewTest.h (226018 => 226019)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/glib/WebKitGLib/WebViewTest.h  2017-12-18 08:25:08 UTC (rev 226018)
+++ trunk/Tools/TestWebKitAPI/glib/WebKitGLib/WebViewTest.h     2017-12-18 08:55:12 UTC (rev 226019)
</span><span class="lines">@@ -90,7 +90,7 @@
</span><span class="cx">     // in our constructor, before a derived class's vtable is ready.
</span><span class="cx">     void initializeWebExtensions() final { Test::initializeWebExtensions(); }
</span><span class="cx"> 
</span><del>-    static gboolean webProcessCrashed(WebKitWebView*, WebViewTest*);
</del><ins>+    static gboolean webProcessTerminated(WebKitWebView*, WebKitWebProcessTerminationReason, WebViewTest*);
</ins><span class="cx"> 
</span><span class="cx">     GRefPtr<WebKitUserContentManager> m_userContentManager;
</span><span class="cx">     WebKitWebView* m_webView { nullptr };
</span></span></pre>
</div>
</div>

</body>
</html>