Add a WebViewDidMoveToWindowObserver for WKWebView
[WebKit-https.git] / Source / WebKit / UIProcess / WebMemoryPressureHandler.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);