Skip to content
Permalink
Browse files
[Qt] Initialize QtWebContext as much as we can in its constructor.
https://bugs.webkit.org/show_bug.cgi?id=79809

Reviewed by Tor Arne Vestbø.

The icon database wouldn't be initialized on the QtWebContext while in WebKitTestRunner
since it doesn't call the initialize method on it after creating it.
Remove the initialize method, move the download manager and icon database initialization
in the constructor and call initializeContextInjectedBundleClient directly in
defaultContext to prevent overriding WKTR's injected bundle client.

* UIProcess/qt/QtWebContext.cpp:
(WebKit::QtWebContext::QtWebContext):
(WebKit::QtWebContext::defaultContext):
* UIProcess/qt/QtWebContext.h:
(QtWebContext):

Canonical link: https://commits.webkit.org/96882@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@109121 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
jturcotte committed Feb 28, 2012
1 parent 6980275 commit 545fe8419c6c4f01f4dbdf76f6d64c99ff88f16e
Showing with 25 additions and 11 deletions.
  1. +19 −0 Source/WebKit2/ChangeLog
  2. +6 −10 Source/WebKit2/UIProcess/qt/QtWebContext.cpp
  3. +0 −1 Source/WebKit2/UIProcess/qt/QtWebContext.h
@@ -1,3 +1,22 @@
2012-02-28 Jocelyn Turcotte <jocelyn.turcotte@nokia.com>

[Qt] Initialize QtWebContext as much as we can in its constructor.
https://bugs.webkit.org/show_bug.cgi?id=79809

Reviewed by Tor Arne Vestbø.

The icon database wouldn't be initialized on the QtWebContext while in WebKitTestRunner
since it doesn't call the initialize method on it after creating it.
Remove the initialize method, move the download manager and icon database initialization
in the constructor and call initializeContextInjectedBundleClient directly in
defaultContext to prevent overriding WKTR's injected bundle client.

* UIProcess/qt/QtWebContext.cpp:
(WebKit::QtWebContext::QtWebContext):
(WebKit::QtWebContext::defaultContext):
* UIProcess/qt/QtWebContext.h:
(QtWebContext):

2012-02-28 Carlos Garcia Campos <cgarcia@igalia.com>

[GTK] Inconsistent state of WebKitWebView when replacing content in WebKit2
@@ -45,9 +45,11 @@ static HashMap<uint64_t, QtWebContext*> contextMap;
QtWebContext* QtWebContext::s_defaultContext = 0;

QtWebContext::QtWebContext(WebContext* context)
: m_context(context)
: m_contextID(generateContextID())
, m_context(context)
, m_downloadManager(adoptPtr(new QtDownloadManager(context)))
, m_iconDatabase(adoptPtr(new QtWebIconDatabaseClient(this)))
{
m_contextID = generateContextID();
contextMap.set(m_contextID, this);
}

@@ -72,7 +74,8 @@ PassRefPtr<QtWebContext> QtWebContext::defaultContext()
RefPtr<WebContext> context = WebContext::sharedProcessContext();
RefPtr<QtWebContext> defaultContext = QtWebContext::create(context.get());
s_defaultContext = defaultContext.get();
defaultContext->initialize();
// Make sure that this doesn't get called in WebKitTestRunner (defaultContext isn't used there).
defaultContext->initializeContextInjectedBundleClient();

return defaultContext.release();
}
@@ -107,13 +110,6 @@ QtWebContext* QtWebContext::contextByID(uint64_t id)
return contextMap.get(id);
}

void QtWebContext::initialize()
{
m_downloadManager = adoptPtr(new QtDownloadManager(m_context.get()));
m_iconDatabase = adoptPtr(new QtWebIconDatabaseClient(this));
initializeContextInjectedBundleClient();
}

void QtWebContext::initializeContextInjectedBundleClient()
{
WKContextInjectedBundleClient injectedBundleClient;
@@ -63,7 +63,6 @@ class QtWebContext : public RefCounted<QtWebContext> {
private:
explicit QtWebContext(WebContext*);

void initialize();
void initializeContextInjectedBundleClient();

static void didReceiveMessageFromInjectedBundle(WKContextRef, WKStringRef messageName, WKTypeRef messageBody, const void*);

0 comments on commit 545fe84

Please sign in to comment.