[ca] Tell CA to clean up unused resources if a given WebProcess won't be drawing
authortimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 27 Mar 2013 01:20:42 +0000 (01:20 +0000)
committertimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 27 Mar 2013 01:20:42 +0000 (01:20 +0000)
commit6254f1fe9bd5b2b835a8288f7485280294de8443
treed4ec34695bf3306bb2766d354b408faa01881b35
parentae189f19bd49bd853f31c8548d99de79b47b7f75
[ca] Tell CA to clean up unused resources if a given WebProcess won't be drawing
https://bugs.webkit.org/show_bug.cgi?id=107539
<rdar://problem/13032692>

Reviewed by Simon Fraser.

* WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
(InitWebCoreSystemInterface): Update WebCoreSystemInterface.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::WebPage): Initially move the Page out of the window if necessary;
Page defaults to in-window, which is wrong in many cases - we depend on
Page::isInWindow being accurate to decide whether WebPage::setIsInWindow is actually
a state change or not.
(WebKit::WebPage::setIsInWindow):
* WebProcess/WebProcess.cpp: Inform WebProcess when we go on/off screen.
(WebKit::WebProcess::WebProcess):
(WebKit::WebProcess::pageDidMoveOnscreen): Keep track of the number of on-screen pages in this process.
(WebKit::WebProcess::pageWillMoveOffscreen): If the number of on-screen pages drops to zero,  clean up unused rendering resources.
* WebProcess/WebProcess.h:

Update WebSystemInterface.

* WebCoreSupport/WebSystemInterface.mm:
(InitWebCoreSystemInterface):

* platform/mac/WebCoreSystemInterface.h:
* platform/mac/WebCoreSystemInterface.mm:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@146956 268f45cc-cd09-0410-ab3c-d52691b4dbfc
14 files changed:
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/platform/mac/WebCoreSystemInterface.h
Source/WebCore/platform/mac/WebCoreSystemInterface.mm
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebCoreSupport/WebSystemInterface.mm
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/WebCoreSupport/mac/WebSystemInterface.mm
Source/WebKit2/WebProcess/WebPage/WebPage.cpp
Source/WebKit2/WebProcess/WebProcess.cpp
Source/WebKit2/WebProcess/WebProcess.h
WebKitLibraries/WebKitSystemInterface.h
WebKitLibraries/libWebKitSystemInterfaceLion.a
WebKitLibraries/libWebKitSystemInterfaceMountainLion.a