Title: [210688] trunk
Revision
210688
Author
[email protected]
Date
2017-01-12 16:47:37 -0800 (Thu, 12 Jan 2017)

Log Message

[iOS] Purge GraphicsServices font cache on memory warning.
<https://webkit.org/b/154343>

Reviewed by Antti Koivisto.

Source/WebCore:

The GS font cache was retaining CSS fonts after we stopped using them.
Call SPI to release them on memory pressure. This is one of multiple
steps necessary to actually free the fonts.

* Configurations/WebCore.xcconfig:
* page/cocoa/MemoryReleaseCocoa.mm:
(WebCore::platformReleaseMemory):
* platform/cocoa/MemoryPressureHandlerCocoa.mm:
* platform/spi/ios/GraphicsServicesSPI.h:

WebKitLibraries:

* WebKitPrivateFrameworkStubs/iOS/10/GraphicsServices.framework/GraphicsServices.tbd: Add SPI.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (210687 => 210688)


--- trunk/Source/WebCore/ChangeLog	2017-01-13 00:36:58 UTC (rev 210687)
+++ trunk/Source/WebCore/ChangeLog	2017-01-13 00:47:37 UTC (rev 210688)
@@ -1,3 +1,20 @@
+2017-01-12  Andreas Kling  <[email protected]>
+
+        [iOS] Purge GraphicsServices font cache on memory warning.
+        <https://webkit.org/b/154343>
+
+        Reviewed by Antti Koivisto.
+
+        The GS font cache was retaining CSS fonts after we stopped using them.
+        Call SPI to release them on memory pressure. This is one of multiple
+        steps necessary to actually free the fonts.
+
+        * Configurations/WebCore.xcconfig:
+        * page/cocoa/MemoryReleaseCocoa.mm:
+        (WebCore::platformReleaseMemory):
+        * platform/cocoa/MemoryPressureHandlerCocoa.mm:
+        * platform/spi/ios/GraphicsServicesSPI.h:
+
 2017-01-12  Chris Dumez  <[email protected]>
 
         Unreviewed EFL/GTK build fix after r210684.

Modified: trunk/Source/WebCore/Configurations/WebCore.xcconfig (210687 => 210688)


--- trunk/Source/WebCore/Configurations/WebCore.xcconfig	2017-01-13 00:36:58 UTC (rev 210687)
+++ trunk/Source/WebCore/Configurations/WebCore.xcconfig	2017-01-13 00:47:37 UTC (rev 210688)
@@ -69,7 +69,7 @@
 OTHER_LDFLAGS = $(inherited) $(OTHER_LDFLAGS_PLATFORM)
 OTHER_LDFLAGS_BASE = -lsqlite3 -lobjc -lANGLE;
 OTHER_LDFLAGS_BASE_ios = $(OTHER_LDFLAGS_BASE) -framework CFNetwork -framework CoreGraphics -framework CoreText -framework Foundation -framework ImageIO -framework MobileCoreServices -framework OpenGLES -lMobileGestalt $(WK_IOS_BINCOMPAT_LDFLAGS);
-OTHER_LDFLAGS_PLATFORM[sdk=iphoneos*] = $(OTHER_LDFLAGS_BASE_ios) -framework IOSurface;
+OTHER_LDFLAGS_PLATFORM[sdk=iphoneos*] = $(OTHER_LDFLAGS_BASE_ios) -framework IOSurface -framework GraphicsServices;
 OTHER_LDFLAGS_PLATFORM[sdk=iphonesimulator*] = $(OTHER_LDFLAGS_BASE_ios);
 OTHER_LDFLAGS_PLATFORM[sdk=macosx*] = $(OTHER_LDFLAGS_BASE) -sub_library libobjc -umbrella WebKit -allowable_client WebCoreTestSupport -allowable_client WebKit2 -allowable_client WebKitLegacy -framework ApplicationServices -framework AudioUnit -framework Carbon -framework Cocoa -framework CoreAudio -framework DataDetectorsCore -framework IOSurface -framework OpenGL -framework SystemConfiguration;
 

Modified: trunk/Source/WebCore/page/cocoa/MemoryReleaseCocoa.mm (210687 => 210688)


--- trunk/Source/WebCore/page/cocoa/MemoryReleaseCocoa.mm	2017-01-13 00:36:58 UTC (rev 210687)
+++ trunk/Source/WebCore/page/cocoa/MemoryReleaseCocoa.mm	2017-01-13 00:47:37 UTC (rev 210688)
@@ -27,6 +27,7 @@
 #include "MemoryRelease.h"
 
 #import "GCController.h"
+#import "GraphicsServicesSPI.h"
 #import "IOSurfacePool.h"
 #import "LayerPool.h"
 #import <notify.h>
@@ -37,6 +38,10 @@
 
 void platformReleaseMemory(Critical)
 {
+#if PLATFORM(IOS) && !PLATFORM(IOS_SIMULATOR)
+    GSFontPurgeFontCache();
+#endif
+
     _sqlite3_purgeEligiblePagerCacheMemory();
 
     for (auto& pool : LayerPool::allLayerPools())

Modified: trunk/Source/WebCore/platform/cocoa/MemoryPressureHandlerCocoa.mm (210687 => 210688)


--- trunk/Source/WebCore/platform/cocoa/MemoryPressureHandlerCocoa.mm	2017-01-13 00:36:58 UTC (rev 210687)
+++ trunk/Source/WebCore/platform/cocoa/MemoryPressureHandlerCocoa.mm	2017-01-13 00:47:37 UTC (rev 210688)
@@ -34,6 +34,7 @@
 #import <wtf/CurrentTime.h>
 
 #if PLATFORM(IOS)
+#import "GraphicsServicesSPI.h"
 #import "SystemMemory.h"
 #import "WebCoreThread.h"
 #endif

Modified: trunk/Source/WebCore/platform/spi/ios/GraphicsServicesSPI.h (210687 => 210688)


--- trunk/Source/WebCore/platform/spi/ios/GraphicsServicesSPI.h	2017-01-13 00:36:58 UTC (rev 210687)
+++ trunk/Source/WebCore/platform/spi/ios/GraphicsServicesSPI.h	2017-01-13 00:47:37 UTC (rev 210688)
@@ -41,6 +41,7 @@
 void GSInitialize(void);
 uint64_t GSCurrentEventTimestamp(void);
 CFStringRef GSSystemRootDirectory(void);
+void GSFontPurgeFontCache(void);
 
 WTF_EXTERN_C_END
 

Modified: trunk/WebKitLibraries/ChangeLog (210687 => 210688)


--- trunk/WebKitLibraries/ChangeLog	2017-01-13 00:36:58 UTC (rev 210687)
+++ trunk/WebKitLibraries/ChangeLog	2017-01-13 00:47:37 UTC (rev 210688)
@@ -1,3 +1,12 @@
+2017-01-12  Andreas Kling  <[email protected]>
+
+        [iOS] Purge GraphicsServices font cache on memory warning.
+        <https://webkit.org/b/154343>
+
+        Reviewed by Antti Koivisto.
+
+        * WebKitPrivateFrameworkStubs/iOS/10/GraphicsServices.framework/GraphicsServices.tbd: Add SPI.
+
 2017-01-01  Jeff Miller  <[email protected]>
 
         Update user-visible copyright strings to include 2017

Modified: trunk/WebKitLibraries/WebKitPrivateFrameworkStubs/iOS/10/GraphicsServices.framework/GraphicsServices.tbd (210687 => 210688)


--- trunk/WebKitLibraries/WebKitPrivateFrameworkStubs/iOS/10/GraphicsServices.framework/GraphicsServices.tbd	2017-01-13 00:36:58 UTC (rev 210687)
+++ trunk/WebKitLibraries/WebKitPrivateFrameworkStubs/iOS/10/GraphicsServices.framework/GraphicsServices.tbd	2017-01-13 00:47:37 UTC (rev 210688)
@@ -11,6 +11,7 @@
       - arm64
     symbols:
       - _GSCurrentEventTimestamp
+      - _GSFontPurgeFontCache
       - _GSInitialize
       - _GSSystemRootDirectory
 install-name: /System/Library/PrivateFrameworks/GraphicsServices.framework/GraphicsServices
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to