Changeset 167338 in webkit
- Timestamp:
- Apr 15, 2014 5:01:33 PM (10 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r167335 r167338 1 2014-04-15 Andreas Kling <akling@apple.com> 2 3 [iOS WebKit2] Listen for system memory pressure notifications. 4 <https://webkit.org/b/131653> 5 <rdar://problem/16208123> 6 7 Reviewed by Antti Koivisto. 8 9 * platform/cocoa/MemoryPressureHandlerCocoa.mm: 10 (WebCore::MemoryPressureHandler::install): 11 12 Use the right invocation to summon the memory pressure handler. 13 14 (WebCore::MemoryPressureHandler::install): 15 (WebCore::MemoryPressureHandler::uninstall): 16 (WebCore::MemoryPressureHandler::holdOff): 17 (WebCore::MemoryPressureHandler::respondToMemoryPressure): 18 19 Make stubbed out functions !PLATFORM(COCOA) 20 1 21 2014-04-14 Morten Stenshorne <mstensho@opera.com> 2 22 -
trunk/Source/WebCore/platform/MemoryPressureHandler.cpp
r167277 r167338 96 96 } 97 97 98 #if !PLATFORM( MAC)98 #if !PLATFORM(COCOA) 99 99 void MemoryPressureHandler::install() { } 100 100 void MemoryPressureHandler::uninstall() { } 101 101 void MemoryPressureHandler::holdOff(unsigned) { } 102 102 void MemoryPressureHandler::respondToMemoryPressure() { } 103 #endif104 105 #if !PLATFORM(COCOA)106 103 void MemoryPressureHandler::platformReleaseMemory(bool) { } 107 104 #endif -
trunk/Source/WebCore/platform/cocoa/MemoryPressureHandlerCocoa.mm
r167277 r167338 39 39 #import "SystemMemory.h" 40 40 #import "WebCoreThread.h" 41 #import <dispatch/private.h> 41 42 #endif 42 43 … … 52 53 #endif 53 54 } 54 55 #if PLATFORM(MAC)56 55 57 56 static dispatch_source_t _cache_event_source = 0; … … 74 73 75 74 dispatch_async(dispatch_get_main_queue(), ^{ 76 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1090 75 #if PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 80000 76 _cache_event_source = dispatch_source_create(DISPATCH_SOURCE_TYPE_MEMORYSTATUS, 0, DISPATCH_MEMORYSTATUS_PRESSURE_WARN, dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0)); 77 #elif PLATFORM(MAC) && MAC_OS_X_VERSION_MIN_REQUIRED >= 1090 77 78 _cache_event_source = wkCreateMemoryStatusPressureCriticalDispatchOnMainQueue(); 78 79 #else … … 81 82 if (_cache_event_source) { 82 83 dispatch_set_context(_cache_event_source, this); 83 dispatch_source_set_event_handler(_cache_event_source, ^{ memoryPressureHandler().respondToMemoryPressure();}); 84 dispatch_source_set_event_handler(_cache_event_source, ^{ 85 memoryPressureHandler().respondToMemoryPressure(); 86 }); 84 87 dispatch_resume(_cache_event_source); 85 88 } … … 157 160 } 158 161 159 #else // !PLATFORM(MAC) 160 162 #if PLATFORM(IOS) 161 163 static void respondToMemoryPressureCallback(CFRunLoopObserverRef observer, CFRunLoopActivity /*activity*/, void* /*info*/) 162 164 {
Note: See TracChangeset
for help on using the changeset viewer.