Title: [92916] branches/safari-534.51-branch/Source/WebCore

Diff

Modified: branches/safari-534.51-branch/Source/WebCore/ChangeLog (92915 => 92916)


--- branches/safari-534.51-branch/Source/WebCore/ChangeLog	2011-08-12 04:32:15 UTC (rev 92915)
+++ branches/safari-534.51-branch/Source/WebCore/ChangeLog	2011-08-12 04:39:37 UTC (rev 92916)
@@ -1,5 +1,24 @@
 2011-08-11  Lucas Forschler  <[email protected]>
 
+    Merged 89214
+
+    2011-06-19  Michael Saboff  <[email protected]>
+
+            Reviewed by Darin Adler.
+
+            Add notify handler to trigger MemoryPressureHandler in all builds
+            https://bugs.webkit.org/show_bug.cgi?id=62679
+
+            Removed SIGUSR2 trigger and added a notify trigger for the
+            MemoryPressureHandler.  The notify trigger is enabled for all builds.
+
+            No test added as only added new memory pressure trigger.
+
+            * platform/mac/MemoryPressureHandlerMac.mm:
+            (WebCore::MemoryPressureHandler::install):
+
+2011-08-11  Lucas Forschler  <[email protected]>
+
     Merged 88434
 
     2011-06-09  Adam Barth  <[email protected]>

Modified: branches/safari-534.51-branch/Source/WebCore/platform/mac/MemoryPressureHandlerMac.mm (92915 => 92916)


--- branches/safari-534.51-branch/Source/WebCore/platform/mac/MemoryPressureHandlerMac.mm	2011-08-12 04:32:15 UTC (rev 92915)
+++ branches/safari-534.51-branch/Source/WebCore/platform/mac/MemoryPressureHandlerMac.mm	2011-08-12 04:39:37 UTC (rev 92916)
@@ -34,6 +34,7 @@
 
 #if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
 #import <dispatch/dispatch.h>
+#import <notify.h>
 
 #ifndef DISPATCH_SOURCE_TYPE_VM
 #define DISPATCH_SOURCE_TYPE_VM (&_dispatch_source_type_vm)
@@ -53,12 +54,11 @@
 #if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
 
 static dispatch_source_t _cache_event_source = 0;
-#ifndef NDEBUG
-static dispatch_source_t _cache_event_source2 = 0;
-#endif
 
 void MemoryPressureHandler::install()
 {
+    static int notifyToken;
+
     if (m_installed)
         return;
 
@@ -71,17 +71,8 @@
         }
     });
 
-#ifndef NDEBUG
-    dispatch_async(dispatch_get_main_queue(), ^{
-        _cache_event_source2 = dispatch_source_create(DISPATCH_SOURCE_TYPE_SIGNAL, SIGUSR2, 0, dispatch_get_main_queue());
-        if (_cache_event_source2) {
-            dispatch_set_context(_cache_event_source2, this);
-            dispatch_source_set_event_handler(_cache_event_source2, ^{ memoryPressureHandler().respondToMemoryPressure();});
-            dispatch_resume(_cache_event_source2);
-            signal((int)SIGUSR2, SIG_IGN);
-        }
-    });
-#endif
+    notify_register_dispatch("org.WebKit.lowMemory", &notifyToken,
+         dispatch_get_main_queue(), ^(int) { memoryPressureHandler().respondToMemoryPressure();});
 
     m_installed = true;
 }
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to