[iOS] WebKit should listen to critical memory warnings.
authorakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 8 May 2014 21:29:47 +0000 (21:29 +0000)
committerakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 8 May 2014 21:29:47 +0000 (21:29 +0000)
<https://webkit.org/b/132704>
<rdar://problem/16857112>

Listen for DISPATCH_MEMORYSTATUS_PRESSURE_CRITICAL in addition to
DISPATCH_MEMORYSTATUS_PRESSURE_WARN, since we may only get the critical
notification on some systems.

Reviewed by Gavin Barraclough.

* platform/cocoa/MemoryPressureHandlerCocoa.mm:
(WebCore::MemoryPressureHandler::install):

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

Source/WebCore/ChangeLog
Source/WebCore/platform/cocoa/MemoryPressureHandlerCocoa.mm

index ac1609a..a5a6d3c 100644 (file)
@@ -1,3 +1,18 @@
+2014-05-08  Andreas Kling  <akling@apple.com>
+
+        [iOS] WebKit should listen to critical memory warnings.
+        <https://webkit.org/b/132704>
+        <rdar://problem/16857112>
+
+        Listen for DISPATCH_MEMORYSTATUS_PRESSURE_CRITICAL in addition to
+        DISPATCH_MEMORYSTATUS_PRESSURE_WARN, since we may only get the critical
+        notification on some systems.
+
+        Reviewed by Gavin Barraclough.
+
+        * platform/cocoa/MemoryPressureHandlerCocoa.mm:
+        (WebCore::MemoryPressureHandler::install):
+
 2014-05-08  Joseph Pecoraro  <pecoraro@apple.com>
 
         Web Inspector: InspectorDOMAgent::getAccessibilityPropertiesForNode should gracefully handle bad node
index 8de287f..c17f0d6 100644 (file)
@@ -81,7 +81,7 @@ void MemoryPressureHandler::install()
 
     dispatch_async(dispatch_get_main_queue(), ^{
 #if PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 80000
-        _cache_event_source = dispatch_source_create(DISPATCH_SOURCE_TYPE_MEMORYSTATUS, 0, DISPATCH_MEMORYSTATUS_PRESSURE_WARN, dispatch_get_main_queue());
+        _cache_event_source = dispatch_source_create(DISPATCH_SOURCE_TYPE_MEMORYSTATUS, 0, DISPATCH_MEMORYSTATUS_PRESSURE_WARN | DISPATCH_MEMORYSTATUS_PRESSURE_CRITICAL, dispatch_get_main_queue());
 #elif PLATFORM(MAC) && MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
         _cache_event_source = wkCreateMemoryStatusPressureCriticalDispatchOnMainQueue();
 #else