Title: [238878] tags/Safari-607.1.16/Source

Diff

Modified: tags/Safari-607.1.16/Source/WebCore/ChangeLog (238877 => 238878)


--- tags/Safari-607.1.16/Source/WebCore/ChangeLog	2018-12-04 23:01:29 UTC (rev 238877)
+++ tags/Safari-607.1.16/Source/WebCore/ChangeLog	2018-12-04 23:48:07 UTC (rev 238878)
@@ -1,5 +1,9 @@
 2018-12-04  Alan Coon  <alanc...@apple.com>
 
+        Revert r238870. rdar://problem/46456681
+
+2018-12-04  Alan Coon  <alanc...@apple.com>
+
         Cherry-pick r238867. rdar://problem/46456681
 
     Regression(r238817) PSON Page Cache API tests are failing

Modified: tags/Safari-607.1.16/Source/WebCore/page/MemoryRelease.cpp (238877 => 238878)


--- tags/Safari-607.1.16/Source/WebCore/page/MemoryRelease.cpp	2018-12-04 23:01:29 UTC (rev 238877)
+++ tags/Safari-607.1.16/Source/WebCore/page/MemoryRelease.cpp	2018-12-04 23:48:07 UTC (rev 238878)
@@ -75,13 +75,11 @@
     InlineStyleSheetOwner::clearCache();
 }
 
-static void releaseCriticalMemory(Synchronous synchronous, MaintainPageCache maintainPageCache)
+static void releaseCriticalMemory(Synchronous synchronous)
 {
     // Right now, the only reason we call release critical memory while not under memory pressure is if the process is about to be suspended.
-    if (maintainPageCache == MaintainPageCache::No) {
-        PruningReason pruningReason = MemoryPressureHandler::singleton().isUnderMemoryPressure() ? PruningReason::MemoryPressure : PruningReason::ProcessSuspended;
-        PageCache::singleton().pruneToSizeNow(0, pruningReason);
-    }
+    PruningReason pruningReason = MemoryPressureHandler::singleton().isUnderMemoryPressure() ? PruningReason::MemoryPressure : PruningReason::ProcessSuspended;
+    PageCache::singleton().pruneToSizeNow(0, pruningReason);
 
     MemoryCache::singleton().pruneLiveResourcesToSize(0, /*shouldDestroyDecodedDataForAllLiveResources*/ true);
 
@@ -113,7 +111,7 @@
     }
 }
 
-void releaseMemory(Critical critical, Synchronous synchronous, MaintainPageCache maintainPageCache)
+void releaseMemory(Critical critical, Synchronous synchronous)
 {
     TraceScope scope(MemoryPressureHandlerStart, MemoryPressureHandlerEnd, static_cast<uint64_t>(critical), static_cast<uint64_t>(synchronous));
 
@@ -120,7 +118,7 @@
     if (critical == Critical::Yes) {
         // Return unused pages back to the OS now as this will likely give us a little memory to work with.
         WTF::releaseFastMallocFreeMemory();
-        releaseCriticalMemory(synchronous, maintainPageCache);
+        releaseCriticalMemory(synchronous);
     }
 
     releaseNoncriticalMemory();

Modified: tags/Safari-607.1.16/Source/WebCore/page/MemoryRelease.h (238877 => 238878)


--- tags/Safari-607.1.16/Source/WebCore/page/MemoryRelease.h	2018-12-04 23:01:29 UTC (rev 238877)
+++ tags/Safari-607.1.16/Source/WebCore/page/MemoryRelease.h	2018-12-04 23:48:07 UTC (rev 238878)
@@ -29,9 +29,7 @@
 
 namespace WebCore {
 
-enum class MaintainPageCache : bool { No, Yes };
-
-WEBCORE_EXPORT void releaseMemory(Critical, Synchronous, MaintainPageCache = MaintainPageCache::No);
+WEBCORE_EXPORT void releaseMemory(Critical, Synchronous);
 void platformReleaseMemory(Critical);
 void jettisonExpensiveObjectsOnTopLevelNavigation();
 WEBCORE_EXPORT void registerMemoryReleaseNotifyCallbacks();

Modified: tags/Safari-607.1.16/Source/WebKit/ChangeLog (238877 => 238878)


--- tags/Safari-607.1.16/Source/WebKit/ChangeLog	2018-12-04 23:01:29 UTC (rev 238877)
+++ tags/Safari-607.1.16/Source/WebKit/ChangeLog	2018-12-04 23:48:07 UTC (rev 238878)
@@ -1,5 +1,9 @@
 2018-12-04  Alan Coon  <alanc...@apple.com>
 
+        Revert r238870. rdar://problem/46456681
+
+2018-12-04  Alan Coon  <alanc...@apple.com>
+
         Cherry-pick r238867. rdar://problem/46456681
 
     Regression(r238817) PSON Page Cache API tests are failing

Modified: tags/Safari-607.1.16/Source/WebKit/UIProcess/SuspendedPageProxy.cpp (238877 => 238878)


--- tags/Safari-607.1.16/Source/WebKit/UIProcess/SuspendedPageProxy.cpp	2018-12-04 23:01:29 UTC (rev 238877)
+++ tags/Safari-607.1.16/Source/WebKit/UIProcess/SuspendedPageProxy.cpp	2018-12-04 23:48:07 UTC (rev 238878)
@@ -79,9 +79,6 @@
     , m_process(WTFMove(process))
     , m_mainFrameID(mainFrameID)
     , m_registrableDomain(toRegistrableDomain(URL(URL(), item.url())))
-#if PLATFORM(IOS_FAMILY)
-    , m_suspensionToken(m_process->throttler().backgroundActivityToken())
-#endif
 {
     item.setSuspendedPage(this);
     m_process->addMessageReceiver(Messages::WebPageProxy::messageReceiverName(), m_page.pageID(), *this);
@@ -132,10 +129,6 @@
 
     m_process->send(Messages::WebProcess::UpdateActivePages(), 0);
 
-#if PLATFORM(IOS_FAMILY)
-    m_suspensionToken = nullptr;
-#endif
-
     if (auto finishedSuspendingHandler = WTFMove(m_finishedSuspendingHandler))
         finishedSuspendingHandler();
 }

Modified: tags/Safari-607.1.16/Source/WebKit/UIProcess/SuspendedPageProxy.h (238877 => 238878)


--- tags/Safari-607.1.16/Source/WebKit/UIProcess/SuspendedPageProxy.h	2018-12-04 23:01:29 UTC (rev 238877)
+++ tags/Safari-607.1.16/Source/WebKit/UIProcess/SuspendedPageProxy.h	2018-12-04 23:48:07 UTC (rev 238878)
@@ -26,7 +26,6 @@
 #pragma once
 
 #include "Connection.h"
-#include "ProcessThrottler.h"
 #include "WebBackForwardListItem.h"
 #include <WebCore/SecurityOriginData.h>
 #include <wtf/RefCounted.h>
@@ -69,9 +68,6 @@
 
     bool m_finishedSuspending { false };
     CompletionHandler<void()> m_finishedSuspendingHandler;
-#if PLATFORM(IOS_FAMILY)
-    ProcessThrottler::BackgroundActivityToken m_suspensionToken;
-#endif
 };
 
 } // namespace WebKit

Modified: tags/Safari-607.1.16/Source/WebKit/WebProcess/WebProcess.cpp (238877 => 238878)


--- tags/Safari-607.1.16/Source/WebKit/WebProcess/WebProcess.cpp	2018-12-04 23:01:29 UTC (rev 238877)
+++ tags/Safari-607.1.16/Source/WebKit/WebProcess/WebProcess.cpp	2018-12-04 23:48:07 UTC (rev 238878)
@@ -280,9 +280,8 @@
     m_suppressMemoryPressureHandler = parameters.shouldSuppressMemoryPressureHandler;
     if (!m_suppressMemoryPressureHandler) {
         auto& memoryPressureHandler = MemoryPressureHandler::singleton();
-        memoryPressureHandler.setLowMemoryHandler([this] (Critical critical, Synchronous synchronous) {
-            auto maintainPageCache = m_isSuspending && hasPageRequiringPageCacheWhileSuspended() ? WebCore::MaintainPageCache::Yes : WebCore::MaintainPageCache::No;
-            WebCore::releaseMemory(critical, synchronous, maintainPageCache);
+        memoryPressureHandler.setLowMemoryHandler([] (Critical critical, Synchronous synchronous) {
+            WebCore::releaseMemory(critical, synchronous);
         });
 #if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MAX_ALLOWED >= 101200) || PLATFORM(GTK) || PLATFORM(WPE)
         memoryPressureHandler.setShouldUsePeriodicMemoryMonitor(true);
@@ -430,15 +429,6 @@
     RELEASE_LOG(Process, "%p - WebProcess::initializeWebProcess: Presenting process = %d", this, WebCore::presentingApplicationPID());
 }
 
-bool WebProcess::hasPageRequiringPageCacheWhileSuspended() const
-{
-    for (auto& page : m_pageMap.values()) {
-        if (page->isSuspended())
-            return true;
-    }
-    return false;
-}
-
 void WebProcess::markIsNoLongerPrewarmed()
 {
 #if PLATFORM(MAC)
@@ -1386,8 +1376,6 @@
 
 void WebProcess::actualPrepareToSuspend(ShouldAcknowledgeWhenReadyToSuspend shouldAcknowledgeWhenReadyToSuspend)
 {
-    SetForScope<bool> suspensionScope(m_isSuspending, true);
-
     if (!m_suppressMemoryPressureHandler)
         MemoryPressureHandler::singleton().releaseMemory(Critical::Yes, Synchronous::Yes);
 

Modified: tags/Safari-607.1.16/Source/WebKit/WebProcess/WebProcess.h (238877 => 238878)


--- tags/Safari-607.1.16/Source/WebKit/WebProcess/WebProcess.h	2018-12-04 23:01:29 UTC (rev 238877)
+++ tags/Safari-607.1.16/Source/WebKit/WebProcess/WebProcess.h	2018-12-04 23:48:07 UTC (rev 238878)
@@ -348,8 +348,6 @@
     enum class ShouldAcknowledgeWhenReadyToSuspend { No, Yes };
     void actualPrepareToSuspend(ShouldAcknowledgeWhenReadyToSuspend);
 
-    bool hasPageRequiringPageCacheWhileSuspended() const;
-
     void ensureAutomationSessionProxy(const String& sessionIdentifier);
     void destroyAutomationSessionProxy();
 
@@ -478,7 +476,6 @@
 #if PLATFORM(WAYLAND)
     std::unique_ptr<WaylandCompositorDisplay> m_waylandCompositorDisplay;
 #endif
-    bool m_isSuspending { false };
 };
 
 } // namespace WebKit
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to