Source/WebCore: Update low memory handler to use new memory pressure notifications...
authorslewis@apple.com <slewis@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 31 May 2013 21:44:26 +0000 (21:44 +0000)
committerslewis@apple.com <slewis@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 31 May 2013 21:44:26 +0000 (21:44 +0000)
<rdar://problem/14027095>

Reviewed by Mark Rowe.

No change in functionality.

* WebCore.exp.in:
* platform/mac/MemoryPressureHandlerMac.mm:
(WebCore::MemoryPressureHandler::install): Call new API
* platform/mac/WebCoreSystemInterface.h:
* platform/mac/WebCoreSystemInterface.mm:

Source/WebKit/mac: Update low memory handler to use new memory pressure notifications on new OS versions.
<rdar://problem/14027095>

Reviewed by Mark Rowe.

* WebCoreSupport/WebSystemInterface.mm:
(InitWebCoreSystemInterface):

Source/WebKit2: Update low memory handler to use new memory pressure notifications on new OS versions.
<rdar://problem/14027095>

Reviewed by Mark Rowe.

* WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
(InitWebCoreSystemInterface):

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

Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/platform/mac/MemoryPressureHandlerMac.mm
Source/WebCore/platform/mac/WebCoreSystemInterface.h
Source/WebCore/platform/mac/WebCoreSystemInterface.mm
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebCoreSupport/WebSystemInterface.mm
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/WebCoreSupport/mac/WebSystemInterface.mm

index 8b9ac14..ab3e1df 100644 (file)
         * rendering/RenderTableSection.cpp:
         (WebCore::RenderTableSection::paintObject):
 
+2013-05-31  Stephanie Lewis  <slewis@apple.com>
+
+        Update low memory handler to use new memory pressure notifications on new OS versions.
+        <rdar://problem/14027095>
+
+        Reviewed by Mark Rowe.
+
+        No change in functionality.
+
+        * WebCore.exp.in:
+        * platform/mac/MemoryPressureHandlerMac.mm:
+        (WebCore::MemoryPressureHandler::install): Call new API
+        * platform/mac/WebCoreSystemInterface.h: 
+        * platform/mac/WebCoreSystemInterface.mm:
+
 2013-05-30  Rafael Brandao  <rafael.lobo@openbossa.org>
 
         Fix double hash lookup in WebSocket::connect loop
index 3d7392e..172c37d 100644 (file)
@@ -2312,6 +2312,10 @@ _wkExecutableWasLinkedOnOrBeforeSnowLeopard
 _wkRecommendedScrollerStyle
 #endif
 
+#if !PLATFORM(IOS) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
+_wkCreateMemoryStatusPressureCriticalDispatchOnMainQueue
+#endif
+
 #if USE(CONTENT_FILTERING)
 _wkFilterAddData
 _wkFilterCreateInstance
index 3848f6c..2f099eb 100644 (file)
@@ -70,7 +70,11 @@ void MemoryPressureHandler::install()
         return;
 
     dispatch_async(dispatch_get_main_queue(), ^{
+#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
+        _cache_event_source = wkCreateMemoryStatusPressureCriticalDispatchOnMainQueue();
+#else
         _cache_event_source = wkCreateVMPressureDispatchOnMainQueue();
+#endif
         if (_cache_event_source) {
             dispatch_set_context(_cache_event_source, this);
             dispatch_source_set_event_handler(_cache_event_source, ^{ memoryPressureHandler().respondToMemoryPressure();});
index fbc3a55..ec8c681 100644 (file)
@@ -334,6 +334,10 @@ extern dispatch_source_t (*wkCreateVMPressureDispatchOnMainQueue)(void);
 
 #endif
 
+#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
+extern dispatch_source_t (*wkCreateMemoryStatusPressureCriticalDispatchOnMainQueue)(void);
+#endif
+    
 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
 extern bool (*wkExecutableWasLinkedOnOrBeforeLion)(void);
 #endif
index 92bbe8b..a9e6151 100644 (file)
@@ -204,6 +204,10 @@ void(*wkDestroyRenderingResources)(void);
 dispatch_source_t (*wkCreateVMPressureDispatchOnMainQueue)(void);
 #endif
 
+#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
+dispatch_source_t (*wkCreateMemoryStatusPressureCriticalDispatchOnMainQueue)(void);
+#endif
+
 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
 bool (*wkExecutableWasLinkedOnOrBeforeLion)(void);
 #endif
index 17d410d..1d21613 100644 (file)
@@ -1,3 +1,13 @@
+2013-05-31  Stephanie Lewis  <slewis@apple.com>
+
+        Update low memory handler to use new memory pressure notifications on new OS versions.
+        <rdar://problem/14027095> 
+
+        Reviewed by Mark Rowe.
+
+        * WebCoreSupport/WebSystemInterface.mm:
+        (InitWebCoreSystemInterface):
+
 2013-05-29  Jeffrey Pfau  <jpfau@apple.com>
 
         [Mac] Enable cache partitioning and the public suffix list on 10.8
index d475c6f..7c8db65 100644 (file)
@@ -198,6 +198,10 @@ void InitWebCoreSystemInterface(void)
 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
     INIT(CreateVMPressureDispatchOnMainQueue);
 #endif
+    
+#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
+    INIT(CreateMemoryStatusPressureCriticalDispatchOnMainQueue);
+#endif
 
 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
     INIT(ExecutableWasLinkedOnOrBeforeLion);
index 3e39b35..030342a 100644 (file)
         * WebProcess/InjectedBundle/API/mac/WKDOMInternals.mm:
         (WebKit::WKDOMNodeClass):
 
+2013-05-31  Stephanie Lewis  <slewis@apple.com>
+
+        Update low memory handler to use new memory pressure notifications on new OS versions.
+        <rdar://problem/14027095>
+
+        Reviewed by Mark Rowe.
+
+        * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
+        (InitWebCoreSystemInterface):
+
 2013-05-30  Tim Horton  <timothy_horton@apple.com>
 
         Remove ASSERT_NOT_REACHED from WKDOMNodeClass
index 0d18674..ed5cbba 100644 (file)
@@ -170,6 +170,10 @@ void InitWebCoreSystemInterface(void)
 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
         INIT(ExecutableWasLinkedOnOrBeforeLion);
 #endif
+        
+#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
+        INIT(CreateMemoryStatusPressureCriticalDispatchOnMainQueue);
+#endif
 
         INIT(CGPathAddRoundedRect);
         INIT(CFURLRequestAllowAllPostCaching);