12013-02-12 Jocelyn Turcotte <jocelyn.turcotte@digia.com>
2
3 [Qt] Properly layer QtWebContext on top of the C API
4 https://bugs.webkit.org/show_bug.cgi?id=108475
5
6 Reviewed by NOBODY (OOPS!).
7
8 The lifetime of the WebContext is difficult to manage since a circular
9 reference is kept with the WebProcessProxy until it shuts itself down, 60
10 seconds after the last page is closed. There was some notification
11 in place to handle this in the upper layer, but having to go through the
12 C API makes this quite awkward.
13
14 The biggest behavior change that this introduces is that the WebContext
15 isn't automatically destroyed anymore and will be kept alive until the
16 application is shut down.
17 This includes the icon database, ideally we should only enable it once the
18 QQuickWebView::icon property is read.
19
20 Also, instead of going through WebPageProxy and PageClient to forward
21 injected bundle messages received by the context, maintain a static map
22 of QQuickWebViewPrivate and fetch it using the WKPageRef.
23
24 * UIProcess/API/qt/qquickwebview.cpp:
25 (QQuickWebViewPrivate::get):
26 (QQuickWebViewPrivate::QQuickWebViewPrivate):
27 (QQuickWebViewPrivate::~QQuickWebViewPrivate):
28 (QQuickWebViewPrivate::initialize):
29 (QQuickWebViewPrivate::handleDownloadRequest):
30 (QQuickWebViewPrivate::updateIcon):
31 (QQuickWebViewPrivate::didReceiveMessageFromNavigatorQtObject):
32 * UIProcess/API/qt/qquickwebview_p_p.h:
33 (QQuickWebViewPrivate):
34 * UIProcess/API/qt/qwebiconimageprovider.cpp:
35 (QWebIconImageProvider::requestImage):
36 * UIProcess/API/qt/raw/qrawwebview.cpp:
37 * UIProcess/API/qt/raw/qrawwebview_p_p.h:
38 * UIProcess/PageClient.h:
39 (PageClient):
40 * UIProcess/WebPageProxy.h:
41 (WebPageProxy):
42 * UIProcess/qt/QtPageClient.cpp:
43 * UIProcess/qt/QtPageClient.h:
44 (QtPageClient):
45 * UIProcess/qt/QtWebContext.cpp:
46 (WebKit):
47 (WebKit::didReceiveMessageFromInjectedBundle):
48 (WebKit::initializeContextInjectedBundleClient):
49 (WebKit::QtWebContext::QtWebContext):
50 (WebKit::QtWebContext::~QtWebContext):
51 (WebKit::QtWebContext::create):
52 (WebKit::QtWebContext::defaultContext):
53 * UIProcess/qt/QtWebContext.h:
54 (WebKit):
55 (QtWebContext):
56 (WebKit::QtWebContext::context):
57 (WebKit::QtWebContext::downloadManager):
58 (WebKit::QtWebContext::iconDatabase):
59 * UIProcess/qt/WebContextQt.cpp:
60 (WebKit::WebContext::platformInvalidateContext):
61 * UIProcess/qt/WebPageProxyQt.cpp:
62