Title: [242012] trunk/Source/WebKit
Revision
242012
Author
[email protected]
Date
2019-02-24 14:37:38 -0800 (Sun, 24 Feb 2019)

Log Message

[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):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (242011 => 242012)


--- trunk/Source/WebKit/ChangeLog	2019-02-24 03:18:33 UTC (rev 242011)
+++ trunk/Source/WebKit/ChangeLog	2019-02-24 22:37:38 UTC (rev 242012)
@@ -1,3 +1,22 @@
+2019-02-24  Michael Catanzaro  <[email protected]>
+
+        [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  <[email protected]>
 
         Give DrawingAreas their own identifiers

Modified: trunk/Source/WebKit/SourcesWPE.txt (242011 => 242012)


--- trunk/Source/WebKit/SourcesWPE.txt	2019-02-24 03:18:33 UTC (rev 242011)
+++ trunk/Source/WebKit/SourcesWPE.txt	2019-02-24 22:37:38 UTC (rev 242012)
@@ -102,6 +102,7 @@
 UIProcess/DefaultUndoController.cpp
 UIProcess/LegacySessionStateCodingNone.cpp
 UIProcess/WebGrammarDetail.cpp
+UIProcess/WebMemoryPressureHandler.cpp @no-unify
 UIProcess/WebViewportAttributes.cpp
 
 UIProcess/API/C/WKGrammarDetail.cpp

Modified: trunk/Source/WebKit/UIProcess/WebMemoryPressureHandler.cpp (242011 => 242012)


--- trunk/Source/WebKit/UIProcess/WebMemoryPressureHandler.cpp	2019-02-24 03:18:33 UTC (rev 242011)
+++ trunk/Source/WebKit/UIProcess/WebMemoryPressureHandler.cpp	2019-02-24 22:37:38 UTC (rev 242012)
@@ -26,10 +26,13 @@
 #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()
@@ -36,7 +39,9 @@
 {
     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);

Modified: trunk/Source/WebKit/UIProcess/glib/WebProcessPoolGLib.cpp (242011 => 242012)


--- trunk/Source/WebKit/UIProcess/glib/WebProcessPoolGLib.cpp	2019-02-24 03:18:33 UTC (rev 242011)
+++ trunk/Source/WebKit/UIProcess/glib/WebProcessPoolGLib.cpp	2019-02-24 22:37:38 UTC (rev 242012)
@@ -78,12 +78,8 @@
         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)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to