[WPE] Install MemoryPressureHandler in UIProcess
authormcatanzaro@igalia.com <mcatanzaro@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 24 Feb 2019 22:37:38 +0000 (22:37 +0000)
committermcatanzaro@igalia.com <mcatanzaro@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 24 Feb 2019 22:37:38 +0000 (22:37 +0000)
https://bugs.webkit.org/show_bug.cgi?id=194617

Reviewed by Žan Doberšek.

Currently only GTK and Cocoa ports run MemoryPressureHandler in the UI process. WPE should
too.

We need @no-unify to avoid changing the unified source bundles under API/, which are
notoriously fragile. (WebMemoryPressureHandler.cpp sorts just above API/.)

* SourcesWPE.txt:
* UIProcess/WebMemoryPressureHandler.cpp:
(WebKit::installMemoryPressureHandler):
* UIProcess/glib/WebProcessPoolGLib.cpp:
(WebKit::WebProcessPool::platformInitialize):

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

Source/WebKit/ChangeLog
Source/WebKit/SourcesWPE.txt
Source/WebKit/UIProcess/WebMemoryPressureHandler.cpp
Source/WebKit/UIProcess/glib/WebProcessPoolGLib.cpp

index 891b09c..f56836b 100644 (file)
@@ -1,3 +1,22 @@
+2019-02-24  Michael Catanzaro  <mcatanzaro@igalia.com>
+
+        [WPE] Install MemoryPressureHandler in UIProcess
+        https://bugs.webkit.org/show_bug.cgi?id=194617
+
+        Reviewed by Žan Doberšek.
+
+        Currently only GTK and Cocoa ports run MemoryPressureHandler in the UI process. WPE should
+        too.
+
+        We need @no-unify to avoid changing the unified source bundles under API/, which are
+        notoriously fragile. (WebMemoryPressureHandler.cpp sorts just above API/.)
+
+        * SourcesWPE.txt:
+        * UIProcess/WebMemoryPressureHandler.cpp:
+        (WebKit::installMemoryPressureHandler):
+        * UIProcess/glib/WebProcessPoolGLib.cpp:
+        (WebKit::WebProcessPool::platformInitialize):
+
 2019-02-23  Chris Dumez  <cdumez@apple.com>
 
         Give DrawingAreas their own identifiers
index d39d553..91333e4 100644 (file)
@@ -102,6 +102,7 @@ UIProcess/AcceleratedDrawingAreaProxy.cpp
 UIProcess/DefaultUndoController.cpp
 UIProcess/LegacySessionStateCodingNone.cpp
 UIProcess/WebGrammarDetail.cpp
+UIProcess/WebMemoryPressureHandler.cpp @no-unify
 UIProcess/WebViewportAttributes.cpp
 
 UIProcess/API/C/WKGrammarDetail.cpp
index 7067773..e5cc6ee 100644 (file)
 #include "config.h"
 #include "WebMemoryPressureHandler.h"
 
-#include "ViewSnapshotStore.h"
 #include "WebProcessPool.h"
 #include <wtf/MemoryPressureHandler.h>
 
+#if PLATFORM(COCOA) || PLATFORM(GTK)
+#include "ViewSnapshotStore.h"
+#endif
+
 namespace WebKit {
 
 void installMemoryPressureHandler()
 {
     auto& memoryPressureHandler = MemoryPressureHandler::singleton();
     memoryPressureHandler.setLowMemoryHandler([] (Critical critical, Synchronous) {
+#if PLATFORM(COCOA) || PLATFORM(GTK)
         ViewSnapshotStore::singleton().discardSnapshotImages();
+#endif
 
         for (auto* processPool : WebProcessPool::allProcessPools())
             processPool->handleMemoryPressureWarning(critical);
index 67fe3db..1c65b3c 100644 (file)
@@ -78,12 +78,8 @@ void WebProcessPool::platformInitialize()
         initializeRemoteInspectorServer(address);
 #endif
 
-#if PLATFORM(GTK)
-    // To enable this for WPE, we need WebMemoryPressureHandler to lose the
-    // hard dependency on ViewSnapshotStore.
     if (!memoryPressureMonitorDisabled())
         installMemoryPressureHandler();
-#endif
 }
 
 void WebProcessPool::platformInitializeWebProcess(WebProcessCreationParameters& parameters)