[iOS WebKit2] Stay in "memory pressure" mode until told otherwise.
authorakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 10 Jun 2014 16:02:03 +0000 (16:02 +0000)
committerakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 10 Jun 2014 16:02:03 +0000 (16:02 +0000)
commitedcb901baf0a35a5c45b609f38397d125877ec44
tree3bd1391322f89d380ec338f6eeeb7fb7f1887dca
parent995916b6a7e5f94d9194c7da38d51af4f2382aae
[iOS WebKit2] Stay in "memory pressure" mode until told otherwise.
<https://webkit.org/b/133671>

When we receive the first memory pressure signal, flip the flag in
MemoryPressureHandler so that isUnderMemoryPressure() returns true
from then on, until the system tells us pressure levels are back
to normal.

The hold-off mechanism is disabled for iOS, that wasn't actually
needed in the first place, since the system is not going to spam
you with tons of notifications.

Also propagate the "critical" flag all the way from the system
to the pressure handler. Note that we don't actually do anything
differently based on the flag yet.

Reviewed by Sam Weinig.

* platform/MemoryPressureHandler.cpp:
(WebCore::MemoryPressureHandler::respondToMemoryPressure):
* platform/MemoryPressureHandler.h:
(WebCore::MemoryPressureHandler::setUnderMemoryPressure):
* platform/cocoa/MemoryPressureHandlerCocoa.mm:
(WebCore::MemoryPressureHandler::install):
(WebCore::MemoryPressureHandler::respondToMemoryPressure):

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