[iOS] Ensure that GraphicsServices is initialized before calling GSFontPurgeFontCache().
authorakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 21 Jun 2017 19:49:11 +0000 (19:49 +0000)
committerakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 21 Jun 2017 19:49:11 +0000 (19:49 +0000)
https://bugs.webkit.org/show_bug.cgi?id=173616
<rdar://problem/30780050>

Reviewed by Chris Dumez.

Source/WebCore:

Fix for crash in GSFontPurgeFontCache() seen in apps embedding WebKit.
Ensure GSFontInitialize() has been called first, since the former depends on state
set up by this function.

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

WebKitLibraries:

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

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

Source/WebCore/ChangeLog
Source/WebCore/page/cocoa/MemoryReleaseCocoa.mm
Source/WebCore/platform/spi/ios/GraphicsServicesSPI.h
WebKitLibraries/ChangeLog
WebKitLibraries/WebKitPrivateFrameworkStubs/iOS/10/GraphicsServices.framework/GraphicsServices.tbd

index ba8590e..acfe693 100644 (file)
@@ -1,3 +1,19 @@
+2017-06-21  Andreas Kling  <akling@apple.com>
+
+        [iOS] Ensure that GraphicsServices is initialized before calling GSFontPurgeFontCache().
+        https://bugs.webkit.org/show_bug.cgi?id=173616
+        <rdar://problem/30780050>
+
+        Reviewed by Chris Dumez.
+
+        Fix for crash in GSFontPurgeFontCache() seen in apps embedding WebKit.
+        Ensure GSFontInitialize() has been called first, since the former depends on state
+        set up by this function.
+
+        * page/cocoa/MemoryReleaseCocoa.mm:
+        (WebCore::platformReleaseMemory):
+        * platform/spi/ios/GraphicsServicesSPI.h:
+
 2017-06-21  Antoine Quint  <graouts@apple.com>
 
         Add logging to identify when the Page suspends scripted animations
index 5bf0f19..21b204f 100644 (file)
@@ -43,6 +43,8 @@ namespace WebCore {
 void platformReleaseMemory(Critical)
 {
 #if PLATFORM(IOS) && !PLATFORM(IOS_SIMULATOR)
+    // FIXME: Remove this call to GSFontInitialize() once <rdar://problem/32886715> is fixed.
+    GSFontInitialize();
     GSFontPurgeFontCache();
 #endif
 
index 3453ddf..192f879 100644 (file)
@@ -41,6 +41,7 @@ WTF_EXTERN_C_BEGIN
 void GSInitialize(void);
 uint64_t GSCurrentEventTimestamp(void);
 CFStringRef GSSystemRootDirectory(void);
+void GSFontInitialize(void);
 void GSFontPurgeFontCache(void);
 
 WTF_EXTERN_C_END
index 20b4168..6eefebd 100644 (file)
@@ -1,3 +1,13 @@
+2017-06-21  Andreas Kling  <akling@apple.com>
+
+        [iOS] Ensure that GraphicsServices is initialized before calling GSFontPurgeFontCache().
+        https://bugs.webkit.org/show_bug.cgi?id=173616
+        <rdar://problem/30780050>
+
+        Reviewed by Chris Dumez.
+
+        * WebKitPrivateFrameworkStubs/iOS/10/GraphicsServices.framework/GraphicsServices.tbd:
+
 2017-06-09  Lucas Forschler  <lforschler@apple.com>
 
         <rdar://problem/32683422>
index 56d36af..ddc2656 100644 (file)
@@ -11,6 +11,7 @@ exports:
       - arm64
     symbols:
       - _GSCurrentEventTimestamp
+      - _GSFontInitialize
       - _GSFontPurgeFontCache
       - _GSInitialize
       - _GSSystemRootDirectory