Title: [192528] trunk/Source/WebKit2
Revision
192528
Author
gga...@apple.com
Date
2015-11-17 13:31:57 -0800 (Tue, 17 Nov 2015)

Log Message

A window with a hung tab waits 5s before closing
https://bugs.webkit.org/show_bug.cgi?id=151319

Reviewed by Anders Carlsson.

I manually tested that I did not break unload events upon window close
by running run-webkit-httpd and invoking a 1x1 image load of
http://127.0.0.1:8000/navigation/resources/save-Ping.php from an unload
handler.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::tryClose): Use the sudden termination bit to
close without waiting for a response.

* UIProcess/WebProcessProxy.h:
(WebKit::WebProcessProxy::isSuddenTerminationEnabled): Expose the bit.

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (192527 => 192528)


--- trunk/Source/WebKit2/ChangeLog	2015-11-17 21:30:01 UTC (rev 192527)
+++ trunk/Source/WebKit2/ChangeLog	2015-11-17 21:31:57 UTC (rev 192528)
@@ -1,3 +1,22 @@
+2015-11-17  Geoffrey Garen  <gga...@apple.com>
+
+        A window with a hung tab waits 5s before closing
+        https://bugs.webkit.org/show_bug.cgi?id=151319
+
+        Reviewed by Anders Carlsson.
+
+        I manually tested that I did not break unload events upon window close
+        by running run-webkit-httpd and invoking a 1x1 image load of
+        http://127.0.0.1:8000/navigation/resources/save-Ping.php from an unload
+        handler.
+
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::tryClose): Use the sudden termination bit to
+        close without waiting for a response.
+
+        * UIProcess/WebProcessProxy.h:
+        (WebKit::WebProcessProxy::isSuddenTerminationEnabled): Expose the bit.
+
 2015-11-17  Carlos Garcia Campos  <cgar...@igalia.com>
 
         [GTK] Web Process crashes on reparenting a WebView with AC mode on

Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp (192527 => 192528)


--- trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp	2015-11-17 21:30:01 UTC (rev 192527)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp	2015-11-17 21:31:57 UTC (rev 192528)
@@ -861,6 +861,11 @@
     if (!isValid())
         return true;
 
+    // Close without delay if the process allows it. Our goal is to terminate
+    // the process, so we check a per-process status bit.
+    if (m_process->isSuddenTerminationEnabled())
+        return true;
+
     m_process->send(Messages::WebPage::TryClose(), m_pageID);
     m_process->responsivenessTimer().start();
     return false;

Modified: trunk/Source/WebKit2/UIProcess/WebProcessProxy.h (192527 => 192528)


--- trunk/Source/WebKit2/UIProcess/WebProcessProxy.h	2015-11-17 21:30:01 UTC (rev 192527)
+++ trunk/Source/WebKit2/UIProcess/WebProcessProxy.h	2015-11-17 21:31:57 UTC (rev 192528)
@@ -131,6 +131,7 @@
 
     void enableSuddenTermination();
     void disableSuddenTermination();
+    bool isSuddenTerminationEnabled() { return !m_numberOfTimesSuddenTerminationWasDisabled; }
 
     void requestTermination();
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to