[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 ba8590e1f16edce5b8e93223584aa3a1d772f3f0..acfe693679c9019326d522f19bed0e60952034f1 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 5bf0f19c713887112564460d8168e03326a56297..21b204f59ddb296b7f8d9fa2816aeeec98aa0499 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 3453ddf5b74ffbfc75d22c3009dc99e54c12375b..192f879defcd5e54331768be3460f51fce823dd9 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 20b41685fca818c2bd6f801aeeee6d817473e55c..6eefebd25497036d983fefe5d8a67db2be5ea639 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 56d36afe21b2b7958c2ebb375f29f2833613e8d0..ddc26569a2367cdc636a886cfaed18f4b91f6e1e 100644 (file)
@@ -11,6 +11,7 @@ exports:
       - arm64
     symbols:
       - _GSCurrentEventTimestamp
+      - _GSFontInitialize
       - _GSFontPurgeFontCache
       - _GSInitialize
       - _GSSystemRootDirectory