[iOS WebKit2] Some memory pressure relief tweaks.
authorakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 10 Jul 2014 20:24:12 +0000 (20:24 +0000)
committerakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 10 Jul 2014 20:24:12 +0000 (20:24 +0000)
commit4e7c2c3d38ba327f71f6ccd0d3e8fcf32a271329
tree6e2b25a78f3dac73825471b96f72f974cff170a2
parentaedc237fddd540dde80956f8ac1510e1401add00
[iOS WebKit2] Some memory pressure relief tweaks.
<https://webkit.org/b/134811>

Split memory pressure relief into critical and non-critical sections.
Non-critical relief is for clearing out things that are really not
essential, e.g unused font data, text measurement caches, etc.

On iOS, only flip the "WebKit is under memory pressure" flag when we
are under *critical* memroy pressure, rather than doing it early on
and gimping ourselves because other processes are too big.

Also added logging for when we transition in/out of system pressure.

Reviewed by Geoffrey Garen.

* platform/MemoryPressureHandler.cpp:
(WebCore::MemoryPressureHandler::releaseNoncriticalMemory):
(WebCore::MemoryPressureHandler::releaseCriticalMemory):
(WebCore::MemoryPressureHandler::releaseMemory):
* platform/MemoryPressureHandler.h:
(WebCore::MemoryPressureHandler::ReliefLogger::loggingEnabled):
* platform/cocoa/MemoryPressureHandlerCocoa.mm:
(WebCore::MemoryPressureHandler::install):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@170973 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/platform/MemoryPressureHandler.cpp
Source/WebCore/platform/MemoryPressureHandler.h
Source/WebCore/platform/cocoa/MemoryPressureHandlerCocoa.mm