Changeset 210688 in webkit


Ignore:
Timestamp:
Jan 12, 2017 4:47:37 PM (7 years ago)
Author:
akling@apple.com
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.
Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r210685 r210688  
     12017-01-12  Andreas Kling  <akling@apple.com>
     2
     3        [iOS] Purge GraphicsServices font cache on memory warning.
     4        <https://webkit.org/b/154343>
     5
     6        Reviewed by Antti Koivisto.
     7
     8        The GS font cache was retaining CSS fonts after we stopped using them.
     9        Call SPI to release them on memory pressure. This is one of multiple
     10        steps necessary to actually free the fonts.
     11
     12        * Configurations/WebCore.xcconfig:
     13        * page/cocoa/MemoryReleaseCocoa.mm:
     14        (WebCore::platformReleaseMemory):
     15        * platform/cocoa/MemoryPressureHandlerCocoa.mm:
     16        * platform/spi/ios/GraphicsServicesSPI.h:
     17
    1182017-01-12  Chris Dumez  <cdumez@apple.com>
    219
  • trunk/Source/WebCore/Configurations/WebCore.xcconfig

    r209288 r210688  
    7070OTHER_LDFLAGS_BASE = -lsqlite3 -lobjc -lANGLE;
    7171OTHER_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);
    72 OTHER_LDFLAGS_PLATFORM[sdk=iphoneos*] = $(OTHER_LDFLAGS_BASE_ios) -framework IOSurface;
     72OTHER_LDFLAGS_PLATFORM[sdk=iphoneos*] = $(OTHER_LDFLAGS_BASE_ios) -framework IOSurface -framework GraphicsServices;
    7373OTHER_LDFLAGS_PLATFORM[sdk=iphonesimulator*] = $(OTHER_LDFLAGS_BASE_ios);
    7474OTHER_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;
  • trunk/Source/WebCore/page/cocoa/MemoryReleaseCocoa.mm

    r209744 r210688  
    2828
    2929#import "GCController.h"
     30#import "GraphicsServicesSPI.h"
    3031#import "IOSurfacePool.h"
    3132#import "LayerPool.h"
     
    3839void platformReleaseMemory(Critical)
    3940{
     41#if PLATFORM(IOS) && !PLATFORM(IOS_SIMULATOR)
     42    GSFontPurgeFontCache();
     43#endif
     44
    4045    _sqlite3_purgeEligiblePagerCacheMemory();
    4146
  • trunk/Source/WebCore/platform/cocoa/MemoryPressureHandlerCocoa.mm

    r209744 r210688  
    3535
    3636#if PLATFORM(IOS)
     37#import "GraphicsServicesSPI.h"
    3738#import "SystemMemory.h"
    3839#import "WebCoreThread.h"
  • trunk/Source/WebCore/platform/spi/ios/GraphicsServicesSPI.h

    r196737 r210688  
    4242uint64_t GSCurrentEventTimestamp(void);
    4343CFStringRef GSSystemRootDirectory(void);
     44void GSFontPurgeFontCache(void);
    4445
    4546WTF_EXTERN_C_END
  • trunk/WebKitLibraries/ChangeLog

    r210221 r210688  
     12017-01-12  Andreas Kling  <akling@apple.com>
     2
     3        [iOS] Purge GraphicsServices font cache on memory warning.
     4        <https://webkit.org/b/154343>
     5
     6        Reviewed by Antti Koivisto.
     7
     8        * WebKitPrivateFrameworkStubs/iOS/10/GraphicsServices.framework/GraphicsServices.tbd: Add SPI.
     9
    1102017-01-01  Jeff Miller  <jeffm@apple.com>
    211
  • trunk/WebKitLibraries/WebKitPrivateFrameworkStubs/iOS/10/GraphicsServices.framework/GraphicsServices.tbd

    r204471 r210688  
    1212    symbols:
    1313      - _GSCurrentEventTimestamp
     14      - _GSFontPurgeFontCache
    1415      - _GSInitialize
    1516      - _GSSystemRootDirectory
Note: See TracChangeset for help on using the changeset viewer.