Unreviewed, rolling out r240343.
authorryanhaddad@apple.com <ryanhaddad@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 24 Jan 2019 00:23:52 +0000 (00:23 +0000)
committerryanhaddad@apple.com <ryanhaddad@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 24 Jan 2019 00:23:52 +0000 (00:23 +0000)
Caused 4 PSON API test failures.

Reverted changeset:

"[PSON] Flash on back navigation on Mac"
https://bugs.webkit.org/show_bug.cgi?id=193716
https://trac.webkit.org/changeset/240343

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@240365 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit/ChangeLog
Source/WebKit/UIProcess/SuspendedPageProxy.cpp
Source/WebKit/UIProcess/WebPageProxy.cpp
Source/WebKit/UIProcess/WebProcessPool.cpp
Source/WebKit/UIProcess/WebProcessPool.h
Source/WebKit/WebProcess/WebPage/WebPage.cpp

index 1207e60..5502dc1 100644 (file)
@@ -1,3 +1,15 @@
+2019-01-23  Ryan Haddad  <ryanhaddad@apple.com>
+
+        Unreviewed, rolling out r240343.
+
+        Caused 4 PSON API test failures.
+
+        Reverted changeset:
+
+        "[PSON] Flash on back navigation on Mac"
+        https://bugs.webkit.org/show_bug.cgi?id=193716
+        https://trac.webkit.org/changeset/240343
+
 2019-01-23  Chris Dumez  <cdumez@apple.com>
 
         Deprecate API to limit the maximum number of WebProcesses
index ce3109e..ff76d9f 100644 (file)
@@ -26,7 +26,6 @@
 #include "config.h"
 #include "SuspendedPageProxy.h"
 
-#include "DrawingAreaProxy.h"
 #include "Logging.h"
 #include "WebPageMessages.h"
 #include "WebPageProxy.h"
@@ -155,19 +154,6 @@ void SuspendedPageProxy::didProcessRequestToSuspend(SuspensionState newSuspensio
 
     m_process->removeMessageReceiver(Messages::WebPageProxy::messageReceiverName(), m_page.pageID());
 
-    bool shouldKeepOnFailure = false;
-#if PLATFORM(MAC)
-    // With web process side tiles, we need to keep the suspended page around on failure to avoid flashing.
-    // It is removed by WebPageProxy::enterAcceleratedCompositingMode when the target page is ready.
-    shouldKeepOnFailure = m_page.drawingArea() && m_page.drawingArea()->type() == DrawingAreaTypeTiledCoreAnimation;
-#endif
-    if (newSuspensionState == SuspensionState::FailedToSuspend && !shouldKeepOnFailure) {
-        RunLoop::main().dispatch([weakProcessPool = makeWeakPtr(m_process->processPool()), weakThis = makeWeakPtr(*this)] {
-            if (weakProcessPool && weakThis)
-                weakProcessPool->removeSuspendedPage(*weakThis);
-        });
-    }
-
     if (m_readyToUnsuspendHandler)
         m_readyToUnsuspendHandler(this);
 }
index cd15f88..e4449f8 100644 (file)
@@ -6847,12 +6847,7 @@ void WebPageProxy::isJITEnabled(CompletionHandler<void(bool)>&& completionHandle
 
 void WebPageProxy::enterAcceleratedCompositingMode(const LayerTreeContext& layerTreeContext)
 {
-#if PLATFORM(MAC)
-    ASSERT(m_drawingArea->type() == DrawingAreaTypeTiledCoreAnimation);
-#endif
     pageClient().enterAcceleratedCompositingMode(layerTreeContext);
-    // We needed the failed suspended page to stay alive to avoid flashing. Now we can get rid of it.
-    m_process->processPool().removeFailedSuspendedPagesForPage(*this);
 }
 
 void WebPageProxy::exitAcceleratedCompositingMode()
index a3581c3..be8479b 100644 (file)
@@ -2262,13 +2262,6 @@ void WebProcessPool::removeAllSuspendedPagesForPage(WebPageProxy& page)
     });
 }
 
-void WebProcessPool::removeFailedSuspendedPagesForPage(WebPageProxy& page)
-{
-    m_suspendedPages.removeAllMatching([&page](auto& suspendedPage) {
-        return &suspendedPage->page() == &page && suspendedPage->failedToSuspend();
-    });
-}
-
 std::unique_ptr<SuspendedPageProxy> WebProcessPool::takeSuspendedPage(SuspendedPageProxy& suspendedPage)
 {
     return m_suspendedPages.takeFirst([&suspendedPage](auto& item) {
index d8f002f..34f5d80 100644 (file)
@@ -447,7 +447,6 @@ public:
     // SuspendedPageProxy management.
     void addSuspendedPage(std::unique_ptr<SuspendedPageProxy>&&);
     void removeAllSuspendedPagesForPage(WebPageProxy&);
-    void removeFailedSuspendedPagesForPage(WebPageProxy&);
     std::unique_ptr<SuspendedPageProxy> takeSuspendedPage(SuspendedPageProxy&);
     void removeSuspendedPage(SuspendedPageProxy&);
     bool hasSuspendedPageFor(WebProcessProxy&) const;
index 3b0b509..9f8bb91 100644 (file)
@@ -1340,6 +1340,7 @@ void WebPage::sendClose()
 void WebPage::suspendForProcessSwap()
 {
     auto failedToSuspend = [this, protectedThis = makeRef(*this)] {
+        close();
         send(Messages::WebPageProxy::DidFailToSuspendAfterProcessSwap());
     };