2011-05-24 Michael Saboff <msaboff@apple.com>
authormsaboff@apple.com <msaboff@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 24 May 2011 23:43:15 +0000 (23:43 +0000)
committermsaboff@apple.com <msaboff@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 24 May 2011 23:43:15 +0000 (23:43 +0000)
commitc0274f1f1a48b018cecbca108255cf84d4585777
tree6265e7304e0222fbf2fac42dc4e7777a34865598
parentb47ce33fb63e9f92f4b6ce1cc10870b3f9cdf46b
2011-05-24  Michael Saboff  <msaboff@apple.com>

        Reviewed by Geoffrey Garen.

        Improve handling in WebCore of low memory situations
        https://bugs.webkit.org/show_bug.cgi?id=61222

        Added call to enable memory pressure handling.

        * WebView/WebView.mm:
        (-[WebView _commonInitializationWithFrameName:groupName:usesDocumentViews:]):
        * WebView/WebViewInternal.h:
2011-05-24  Michael Saboff  <msaboff@apple.com>

        Reviewed by Geoffrey Garen.

        Improve handling in WebCore of low memory situations
        https://bugs.webkit.org/show_bug.cgi?id=61222

        Added new class, MemoryPressureHandler, to platform to respond to low
        system memory events. Added Mac specific implementation that reduces the
        page cache, NSURL cache, WebCore cache by half their current usage
        and then garbage collects.  This can allow Safari to continue operating
        in a low memory situation with minimal paging.
        Split up prune operations in MemoryCache to allow for pruning to a
        specific actual size to support this change.

        No tests added as the functionality of WebKit wasn't changed.

        * GNUmakefile.list.am:
        * WebCore.exp.in:
        * WebCore.gypi:
        * WebCore.pro:
        * WebCore.vcproj/WebCore.vcproj:
        * WebCore.xcodeproj/project.pbxproj:
        * loader/cache/MemoryCache.cpp:
        (WebCore::MemoryCache::pruneLiveResources):
        (WebCore::MemoryCache::forcePruneLiveResources):
        (WebCore::MemoryCache::pruneLiveResourcesToTarget):
        (WebCore::MemoryCache::pruneDeadResources):
        (WebCore::MemoryCache::forcePruneDeadResources):
        (WebCore::MemoryCache::pruneDeadResourcesToTarget):
        * loader/cache/MemoryCache.h:
        (WebCore::MemoryCache::forcePrune):
        * platform/MemoryPressureHandler.cpp: Added.
        (WebCore::memoryPressureHandler):
        (WebCore::MemoryPressureHandler::MemoryPressureHandler):
        (WebCore::MemoryPressureHandler::install):
        (WebCore::MemoryPressureHandler::respondToMemoryPressure):
        * platform/MemoryPressureHandler.h: Added.
        * platform/mac/MemoryPressureHandler.mm: Added.
        (WebCore::MemoryPressureHandler::install):
        (WebCore::MemoryPressureHandler::respondToMemoryPressure):
2011-05-24  Michael Saboff  <msaboff@apple.com>

        Reviewed by Geoffrey Garen.

        Improve handling in WebCore of low memory situations
        https://bugs.webkit.org/show_bug.cgi?id=61222

        Added call to enable memory pressure handling for Mac case.

        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::initializeWebProcess):
        * WebProcess/WebProcess.h:
        * WebProcess/mac/WebProcessMac.mm:
        (WebKit::WebProcess::platformInitializeWebProcess):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@87228 268f45cc-cd09-0410-ab3c-d52691b4dbfc
16 files changed:
Source/WebCore/ChangeLog
Source/WebCore/GNUmakefile.list.am
Source/WebCore/WebCore.exp.in
Source/WebCore/WebCore.gypi
Source/WebCore/WebCore.pro
Source/WebCore/WebCore.vcproj/WebCore.vcproj
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/loader/cache/MemoryCache.cpp
Source/WebCore/loader/cache/MemoryCache.h
Source/WebCore/platform/MemoryPressureHandler.cpp [new file with mode: 0644]
Source/WebCore/platform/MemoryPressureHandler.h [new file with mode: 0644]
Source/WebCore/platform/mac/MemoryPressureHandlerMac.mm [new file with mode: 0644]
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebView/WebView.mm
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/WebProcess.cpp