[Qt][WK2] Keep the WebContext alive during the whole application's lifetime
authorjocelyn.turcotte@digia.com <jocelyn.turcotte@digia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 12 Mar 2013 11:12:28 +0000 (11:12 +0000)
committerjocelyn.turcotte@digia.com <jocelyn.turcotte@digia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 12 Mar 2013 11:12:28 +0000 (11:12 +0000)
commit0f1ffc49c276b3b365cddad6e8665a7a6d35c3ef
treeb53707838e75040df92ac8b1bc92f2d8af7e4ebb
parentfe9fdb4dffbe3b5dbcb4e2b171520261d471f48d
[Qt][WK2] Keep the WebContext alive during the whole application's lifetime
https://bugs.webkit.org/show_bug.cgi?id=109827

Reviewed by Simon Hausmann.
Signed off for WebKit2 by Benjamin Poulain.

The lifetime of the WebContext is difficult to manage because of a circular
reference kept with the WebProcessProxy until it shuts itself down, 60
seconds after the last page is closed. There was some notification
in place to handle this in the upper layer, but having to go through the
C API (done in a following patch) makes this quite awkward.

Keeping the WebContext alive also includes the icon database which is
quite heavy, in the future we should only enable it once the
QQuickWebView::icon property is read.

* UIProcess/API/qt/qquickwebview.cpp:
(QQuickWebViewPrivate::QQuickWebViewPrivate):
(QQuickWebViewPrivate::handleDownloadRequest):
(QQuickWebViewPrivate::updateIcon):
* UIProcess/API/qt/qquickwebview_p_p.h:
(QQuickWebViewPrivate):
* UIProcess/API/qt/qwebiconimageprovider.cpp:
(QWebIconImageProvider::requestImage):
* UIProcess/qt/QtWebContext.cpp:
(WebKit):
(WebKit::QtWebContext::QtWebContext):
(WebKit::QtWebContext::~QtWebContext):
(WebKit::QtWebContext::create):
(WebKit::QtWebContext::defaultContext):
* UIProcess/qt/QtWebContext.h:
(QtWebContext):
(WebKit::QtWebContext::downloadManager):
(WebKit::QtWebContext::iconDatabase):
* UIProcess/qt/WebContextQt.cpp:
(WebKit::WebContext::platformInvalidateContext):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@145513 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp
Source/WebKit2/UIProcess/API/qt/qquickwebview_p_p.h
Source/WebKit2/UIProcess/API/qt/qwebiconimageprovider.cpp
Source/WebKit2/UIProcess/qt/QtWebContext.cpp
Source/WebKit2/UIProcess/qt/QtWebContext.h
Source/WebKit2/UIProcess/qt/WebContextQt.cpp