Title: [245894] trunk/Source/WebKit
Revision
245894
Author
[email protected]
Date
2019-05-30 11:05:18 -0700 (Thu, 30 May 2019)

Log Message

Rare crash under `WebPage::shouldIgnoreMetaViewport const` when shrinking to fit content
https://bugs.webkit.org/show_bug.cgi?id=198374
<rdar://problem/51261348>

Reviewed by Tim Horton.

This is a speculative fix for the crash; what appears to be happening is that the shrink-to-fit-content timer
is somehow being scheduled after the page has already been closed. We can probably fix this by bailing when
scheduling shrink-to-fit-content if m_isClosed is true.

* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::scheduleShrinkToFitContent):
(WebKit::WebPage::immediatelyShrinkToFitContent):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (245893 => 245894)


--- trunk/Source/WebKit/ChangeLog	2019-05-30 17:19:24 UTC (rev 245893)
+++ trunk/Source/WebKit/ChangeLog	2019-05-30 18:05:18 UTC (rev 245894)
@@ -1,3 +1,19 @@
+2019-05-30  Wenson Hsieh  <[email protected]>
+
+        Rare crash under `WebPage::shouldIgnoreMetaViewport const` when shrinking to fit content
+        https://bugs.webkit.org/show_bug.cgi?id=198374
+        <rdar://problem/51261348>
+
+        Reviewed by Tim Horton.
+
+        This is a speculative fix for the crash; what appears to be happening is that the shrink-to-fit-content timer
+        is somehow being scheduled after the page has already been closed. We can probably fix this by bailing when
+        scheduling shrink-to-fit-content if m_isClosed is true.
+
+        * WebProcess/WebPage/ios/WebPageIOS.mm:
+        (WebKit::WebPage::scheduleShrinkToFitContent):
+        (WebKit::WebPage::immediatelyShrinkToFitContent):
+
 2019-05-30  Truitt Savell  <[email protected]>
 
         Unreviewed, rolling out r245881.

Modified: trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm (245893 => 245894)


--- trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm	2019-05-30 17:19:24 UTC (rev 245893)
+++ trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm	2019-05-30 18:05:18 UTC (rev 245894)
@@ -3292,6 +3292,9 @@
 
 void WebPage::scheduleShrinkToFitContent()
 {
+    if (m_isClosed)
+        return;
+
     m_shrinkToFitContentTimer.restart();
 }
 
@@ -3303,6 +3306,9 @@
 
 bool WebPage::immediatelyShrinkToFitContent()
 {
+    if (m_isClosed)
+        return false;
+
     if (!shouldIgnoreMetaViewport())
         return false;
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to