Title: [184692] trunk/Source/WebKit2
Revision
184692
Author
[email protected]
Date
2015-05-20 19:36:28 -0700 (Wed, 20 May 2015)

Log Message

dispatchViewStateChange should not wait for sync reply if the page isn't visible
https://bugs.webkit.org/show_bug.cgi?id=145242
<rdar://problem/20967937>

Reviewed by Ben Poulain.

This is particularly problematic on iOS, since if the page isn't visible the process is likely suspended.


* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::dispatchViewStateChange):
(WebKit::WebPageProxy::waitForDidUpdateViewState):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (184691 => 184692)


--- trunk/Source/WebKit2/ChangeLog	2015-05-21 02:33:15 UTC (rev 184691)
+++ trunk/Source/WebKit2/ChangeLog	2015-05-21 02:36:28 UTC (rev 184692)
@@ -1,3 +1,18 @@
+2015-05-20  Gavin Barraclough  <[email protected]>
+
+        dispatchViewStateChange should not wait for sync reply if the page isn't visible
+        https://bugs.webkit.org/show_bug.cgi?id=145242
+        <rdar://problem/20967937>
+
+        Reviewed by Ben Poulain.
+
+        This is particularly problematic on iOS, since if the page isn't visible the process is likely suspended.
+
+
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::dispatchViewStateChange):
+        (WebKit::WebPageProxy::waitForDidUpdateViewState):
+
 2015-05-20  Marcos Chavarría Teijeiro  <[email protected]>
 
         Enable disk cache for range requests

Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp (184691 => 184692)


--- trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp	2015-05-21 02:33:15 UTC (rev 184691)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp	2015-05-21 02:36:28 UTC (rev 184692)
@@ -1372,6 +1372,10 @@
     if (m_viewWasEverInWindow && (changed & ViewState::IsInWindow) && isInWindow())
         m_viewStateChangeWantsSynchronousReply = true;
 
+    // Don't wait synchronously if the view state is not visible. (This matters in particular on iOS, where a hidden page may be suspended.)
+    if (!(m_viewState & ViewState::IsVisible))
+        m_viewStateChangeWantsSynchronousReply = false;
+
     if (changed || m_viewStateChangeWantsSynchronousReply || !m_nextViewStateChangeCallbacks.isEmpty())
         m_process->send(Messages::WebPage::SetViewState(m_viewState, m_viewStateChangeWantsSynchronousReply, m_nextViewStateChangeCallbacks), m_pageID);
 
@@ -1450,6 +1454,15 @@
     if (m_waitingForDidUpdateViewState)
         return;
 
+#if PLATFORM(IOS)
+    // Hail Mary check. Should not be possible (dispatchViewStateChange should force async if not visible,
+    // and if visible we should be holding an assertion) - but we should never block on a suspended process.
+    if (!m_activityToken) {
+        ASSERT_NOT_REACHED();
+        return;
+    }
+#endif
+
     m_waitingForDidUpdateViewState = true;
 
     m_drawingArea->waitForDidUpdateViewState();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to