[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-10851-g50815da

jocelyn.turcotte at nokia.com jocelyn.turcotte at nokia.com
Wed Dec 22 18:23:37 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 0a742e70a78469c8accd3322ab279ec4643715d2
Author: jocelyn.turcotte at nokia.com <jocelyn.turcotte at nokia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Dec 10 12:03:13 2010 +0000

    2010-12-10  Jocelyn Turcotte  <jocelyn.turcotte at nokia.com>
    
            Reviewed by Kenneth Rohde Christiansen.
    
            [Qt][WK2] Add the QWKContext API class to wrap the WebContext.
            https://bugs.webkit.org/show_bug.cgi?id=50750
    
            * UIProcess/API/qt/WKView.h:
            * UIProcess/API/qt/qgraphicswkview.cpp:
            (QGraphicsWKView::QGraphicsWKView):
            Change the WKPageNamespaceRef argument to QWKContext*
            * UIProcess/API/qt/qgraphicswkview.h:
            * UIProcess/API/qt/qwkcontext.cpp: Added.
            * UIProcess/API/qt/qwkcontext.h: Added.
            * UIProcess/API/qt/qwkcontext_p.h: Added.
            * UIProcess/API/qt/qwkpage.cpp:
            (QWKPagePrivate::QWKPagePrivate):
            (QWKPage::QWKPage):
            Change the WKPageNamespaceRef argument to QWKContext*
            * UIProcess/API/qt/qwkpage.h:
            * UIProcess/API/qt/qwkpage_p.h:
            * WebKit2.pro:
    2010-12-10  Jocelyn Turcotte  <jocelyn.turcotte at nokia.com>
    
            Reviewed by Kenneth Rohde Christiansen.
    
            [Qt][WK2] Add the QWKContext API class to wrap the WebContext.
            https://bugs.webkit.org/show_bug.cgi?id=50750
    
            * MiniBrowser/qt/BrowserView.cpp:
            (BrowserView::BrowserView):
            * MiniBrowser/qt/BrowserView.h:
            * WebKitTestRunner/qt/PlatformWebViewQt.cpp:
            (WTR::WebView::WebView):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@73716 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index b38dd2e..6c09962 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -1,3 +1,26 @@
+2010-12-10  Jocelyn Turcotte  <jocelyn.turcotte at nokia.com>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [Qt][WK2] Add the QWKContext API class to wrap the WebContext.
+        https://bugs.webkit.org/show_bug.cgi?id=50750
+
+        * UIProcess/API/qt/WKView.h:
+        * UIProcess/API/qt/qgraphicswkview.cpp:
+        (QGraphicsWKView::QGraphicsWKView):
+        Change the WKPageNamespaceRef argument to QWKContext*
+        * UIProcess/API/qt/qgraphicswkview.h:
+        * UIProcess/API/qt/qwkcontext.cpp: Added.
+        * UIProcess/API/qt/qwkcontext.h: Added.
+        * UIProcess/API/qt/qwkcontext_p.h: Added.
+        * UIProcess/API/qt/qwkpage.cpp:
+        (QWKPagePrivate::QWKPagePrivate):
+        (QWKPage::QWKPage):
+        Change the WKPageNamespaceRef argument to QWKContext*
+        * UIProcess/API/qt/qwkpage.h:
+        * UIProcess/API/qt/qwkpage_p.h:
+        * WebKit2.pro:
+
 2010-12-10  Kimmo Kinnunen  <kimmo.t.kinnunen at nokia.com>
 
         Reviewed by Kenneth Rohde Christiansen.
diff --git a/WebKit2/UIProcess/API/qt/WKView.h b/WebKit2/UIProcess/API/qt/WKView.h
index 221628e..5bb95e8 100644
--- a/WebKit2/UIProcess/API/qt/WKView.h
+++ b/WebKit2/UIProcess/API/qt/WKView.h
@@ -21,6 +21,7 @@
 #define WKView_h
 
 #include <WebKit2/qgraphicswkview.h>
+#include <WebKit2/qwkcontext.h>
 #include <WebKit2/qwkpage.h>
 #include <WebKit2/qwkpreferences.h>
 
diff --git a/WebKit2/UIProcess/API/qt/qgraphicswkview.cpp b/WebKit2/UIProcess/API/qt/qgraphicswkview.cpp
index d6efd93..8e818fa 100644
--- a/WebKit2/UIProcess/API/qt/qgraphicswkview.cpp
+++ b/WebKit2/UIProcess/API/qt/qgraphicswkview.cpp
@@ -57,7 +57,7 @@ struct QGraphicsWKViewPrivate {
     bool m_isChangingScale;
 };
 
-QGraphicsWKView::QGraphicsWKView(WKPageNamespaceRef pageNamespaceRef, BackingStoreType backingStoreType, QGraphicsItem* parent)
+QGraphicsWKView::QGraphicsWKView(QWKContext* context, BackingStoreType backingStoreType, QGraphicsItem* parent)
     : QGraphicsWidget(parent)
     , d(new QGraphicsWKViewPrivate(this))
 {
@@ -79,7 +79,7 @@ QGraphicsWKView::QGraphicsWKView(WKPageNamespaceRef pageNamespaceRef, BackingSto
         break;
     }
 
-    d->page = new QWKPage(pageNamespaceRef);
+    d->page = new QWKPage(context);
     d->page->d->init(size().toSize(), drawingAreaProxy);
     connect(d->page, SIGNAL(titleChanged(QString)), this, SIGNAL(titleChanged(QString)));
     connect(d->page, SIGNAL(loadStarted()), this, SIGNAL(loadStarted()));
diff --git a/WebKit2/UIProcess/API/qt/qgraphicswkview.h b/WebKit2/UIProcess/API/qt/qgraphicswkview.h
index 6c3c157..6f4081e 100644
--- a/WebKit2/UIProcess/API/qt/qgraphicswkview.h
+++ b/WebKit2/UIProcess/API/qt/qgraphicswkview.h
@@ -11,6 +11,7 @@ QT_BEGIN_NAMESPACE
 class QCursor;
 QT_END_NAMESPACE
 
+class QWKContext;
 class QGraphicsWKViewPrivate;
 
 WKStringRef WKStringCreateWithQString(const QString& qString);
@@ -23,7 +24,7 @@ class QWEBKIT_EXPORT QGraphicsWKView : public QGraphicsWidget {
 
 public:
     enum BackingStoreType { Simple, Tiled };
-    QGraphicsWKView(WKPageNamespaceRef namespaceRef, BackingStoreType backingStoreType = Simple, QGraphicsItem* parent = 0);
+    QGraphicsWKView(QWKContext* context, BackingStoreType backingStoreType = Simple, QGraphicsItem* parent = 0);
 
     virtual ~QGraphicsWKView();
 
diff --git a/WebKit2/UIProcess/API/qt/qwkcontext.cpp b/WebKit2/UIProcess/API/qt/qwkcontext.cpp
new file mode 100644
index 0000000..5334183
--- /dev/null
+++ b/WebKit2/UIProcess/API/qt/qwkcontext.cpp
@@ -0,0 +1,69 @@
+/*
+ * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this program; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "qwkcontext.h"
+#include "qwkcontext_p.h"
+
+#include "WebPlatformStrategies.h"
+
+using namespace WebKit;
+
+static inline void initializePlatformStrategiesIfNeeded()
+{
+    static bool initialized = false;
+    if (initialized)
+        return;
+
+    WebPlatformStrategies::initialize();
+    initialized = true;
+}
+
+QWKContextPrivate::QWKContextPrivate(QWKContext* qq)
+    : q(qq)
+{
+    initializePlatformStrategiesIfNeeded();
+}
+
+QWKContextPrivate::~QWKContextPrivate()
+{
+}
+
+QWKContext::QWKContext(QObject* parent)
+    : QObject(parent)
+    , d(new QWKContextPrivate(this))
+{
+    d->context = WebContext::create(String());
+    d->pageNamespace = d->context->createPageNamespace();
+}
+
+QWKContext::QWKContext(WKPageNamespaceRef pageNamespaceRef, QObject* parent)
+    : QObject(parent)
+    , d(new QWKContextPrivate(this))
+{
+    d->pageNamespace = toImpl(pageNamespaceRef);
+    d->context = d->pageNamespace->context();
+}
+
+QWKContext::~QWKContext()
+{
+    delete d;
+}
+
+#include "moc_qwkcontext.cpp"
diff --git a/WebKit2/UIProcess/API/qt/qwkcontext.h b/WebKit2/UIProcess/API/qt/qwkcontext.h
new file mode 100644
index 0000000..8dff815
--- /dev/null
+++ b/WebKit2/UIProcess/API/qt/qwkcontext.h
@@ -0,0 +1,44 @@
+/*
+    Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Library General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Library General Public License for more details.
+
+    You should have received a copy of the GNU Library General Public License
+    along with this library; see the file COPYING.LIB.  If not, write to
+    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+    Boston, MA 02110-1301, USA.
+*/
+
+#ifndef qwkcontext_h
+#define qwkcontext_h
+
+#include "qwebkitglobal.h"
+#include <QObject>
+#include <WebKit2/WKPageNamespace.h>
+
+class QWKContextPrivate;
+
+class QWEBKIT_EXPORT QWKContext : public QObject {
+    Q_OBJECT
+public:
+    QWKContext(QObject* parent = 0);
+    virtual ~QWKContext();
+
+    // Bridge from the C API
+    QWKContext(WKPageNamespaceRef pageNamespaceRef, QObject* parent = 0);
+
+private:
+    QWKContextPrivate* d;
+
+    friend class QWKPagePrivate;
+};
+
+#endif /* qwkcontext_h */
diff --git a/WebKit2/UIProcess/API/qt/qwkcontext_p.h b/WebKit2/UIProcess/API/qt/qwkcontext_p.h
new file mode 100644
index 0000000..23be438
--- /dev/null
+++ b/WebKit2/UIProcess/API/qt/qwkcontext_p.h
@@ -0,0 +1,39 @@
+/*
+    Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Library General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Library General Public License for more details.
+
+    You should have received a copy of the GNU Library General Public License
+    along with this library; see the file COPYING.LIB.  If not, write to
+    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+    Boston, MA 02110-1301, USA.
+*/
+
+
+#ifndef qwkcontext_p_h
+#define qwkcontext_p_h
+
+#include "WebContext.h"
+#include "WebPageNamespace.h"
+#include <wtf/RefPtr.h>
+
+class QWKContextPrivate {
+public:
+    QWKContextPrivate(QWKContext*);
+    ~QWKContextPrivate();
+
+    QWKContext* q;
+
+    RefPtr<WebKit::WebContext> context;
+    RefPtr<WebKit::WebPageNamespace> pageNamespace;
+};
+
+#endif /* qkcontext_p_h */
diff --git a/WebKit2/UIProcess/API/qt/qwkpage.cpp b/WebKit2/UIProcess/API/qt/qwkpage.cpp
index 2a5e018..d6a7c83 100644
--- a/WebKit2/UIProcess/API/qt/qwkpage.cpp
+++ b/WebKit2/UIProcess/API/qt/qwkpage.cpp
@@ -24,6 +24,8 @@
 #include "qwkpreferences_p.h"
 
 #include "ClientImpl.h"
+#include "qwkcontext.h"
+#include "qwkcontext_p.h"
 #include "qwkhistory.h"
 #include "qwkhistory_p.h"
 #include "FindIndicator.h"
@@ -32,7 +34,6 @@
 #include "WebContext.h"
 #include "WebContextMenuProxyQt.h"
 #include "WebEventFactoryQt.h"
-#include "WebPlatformStrategies.h"
 #include "WebPopupMenuProxyQt.h"
 #include "WKStringQt.h"
 #include "WKURLQt.h"
@@ -52,24 +53,14 @@
 using namespace WebKit;
 using namespace WebCore;
 
-static inline void initializePlatformStrategiesIfNeeded()
-{
-    static bool initialized = false;
-    if (initialized)
-        return;
-
-    WebPlatformStrategies::initialize();
-    initialized = true;
-}
-
-QWKPagePrivate::QWKPagePrivate(QWKPage* qq, WKPageNamespaceRef namespaceRef)
+QWKPagePrivate::QWKPagePrivate(QWKPage* qq, QWKContext* c)
     : q(qq)
+    , context(c)
     , preferences(0)
     , createNewPageFn(0)
 {
-    initializePlatformStrategiesIfNeeded();
     memset(actions, 0, sizeof(actions));
-    page = toImpl(namespaceRef)->createWebPage(0); // Page gets a ref to namespace.
+    page = context->d->pageNamespace->createWebPage(0);
     page->setPageClient(this);
     history = QWKHistoryPrivate::createHistory(page->backForwardList());
 }
@@ -312,8 +303,8 @@ void QWKPagePrivate::touchEvent(QTouchEvent* event)
 #endif
 }
 
-QWKPage::QWKPage(WKPageNamespaceRef namespaceRef)
-    : d(new QWKPagePrivate(this, namespaceRef))
+QWKPage::QWKPage(QWKContext* context)
+    : d(new QWKPagePrivate(this, context))
 {
     WKPageLoaderClient loadClient = {
         0,      /* version */
diff --git a/WebKit2/UIProcess/API/qt/qwkpage.h b/WebKit2/UIProcess/API/qt/qwkpage.h
index 866f84f..645c845 100644
--- a/WebKit2/UIProcess/API/qt/qwkpage.h
+++ b/WebKit2/UIProcess/API/qt/qwkpage.h
@@ -10,9 +10,9 @@
 #include <QUrl>
 #include <WebKit2/WKBase.h>
 #include <WebKit2/WKPage.h>
-#include <WebKit2/WKPageNamespace.h>
 
 class QCursor;
+class QWKContext;
 class QWKGraphicsWidget;
 class QWKPreferences;
 class QWKPagePrivate;
@@ -66,7 +66,7 @@ public:
         friend class QWKPage;
     };
 
-    QWKPage(WKPageNamespaceRef);
+    QWKPage(QWKContext*);
     virtual ~QWKPage();
 
     WKPageRef pageRef() const;
@@ -102,6 +102,7 @@ public:
     void setPageAndTextZoomFactors(qreal pageZoomFactor, qreal textZoomFactor);
 
     QWKHistory* history() const;
+    QWKContext* context() const;
 
     void findZoomableAreaForPoint(const QPoint&);
 
diff --git a/WebKit2/UIProcess/API/qt/qwkpage_p.h b/WebKit2/UIProcess/API/qt/qwkpage_p.h
index 1d8cb5b..ea854c8 100644
--- a/WebKit2/UIProcess/API/qt/qwkpage_p.h
+++ b/WebKit2/UIProcess/API/qt/qwkpage_p.h
@@ -36,7 +36,7 @@ class QWKPreferences;
 
 class QWKPagePrivate : WebKit::PageClient {
 public:
-    QWKPagePrivate(QWKPage*, WKPageNamespaceRef);
+    QWKPagePrivate(QWKPage*, QWKContext*);
     ~QWKPagePrivate();
 
     static QWKPagePrivate* get(QWKPage* page) { return page->d; }
@@ -92,6 +92,7 @@ public:
 
     QWKPage* q;
 
+    QWKContext* context;
     QWKHistory* history;
 
     QAction* actions[QWKPage::WebActionCount];
diff --git a/WebKit2/WebKit2.pro b/WebKit2/WebKit2.pro
index 0fe2b3c..e207a26 100644
--- a/WebKit2/WebKit2.pro
+++ b/WebKit2/WebKit2.pro
@@ -147,6 +147,7 @@ INCLUDEPATH = \
     WebProcess/WebCoreSupport \
     WebProcess/WebCoreSupport/qt \
     WebProcess/WebPage \
+    WebProcess/qt \
     $$INCLUDEPATH
 
 INCLUDEPATH += \
@@ -296,6 +297,8 @@ HEADERS += \
     UIProcess/API/cpp/qt/WKURLQt.h \
     UIProcess/API/qt/ClientImpl.h \
     UIProcess/API/qt/qgraphicswkview.h \
+    UIProcess/API/qt/qwkcontext.h \
+    UIProcess/API/qt/qwkcontext_p.h \
     UIProcess/API/qt/qwkhistory.h \
     UIProcess/API/qt/qwkhistory_p.h \
     UIProcess/API/qt/qwkpage.h \
@@ -486,6 +489,7 @@ SOURCES += \
     UIProcess/API/cpp/qt/WKURLQt.cpp \
     UIProcess/API/qt/ClientImpl.cpp \
     UIProcess/API/qt/qgraphicswkview.cpp \
+    UIProcess/API/qt/qwkcontext.cpp \
     UIProcess/API/qt/qwkhistory.cpp \
     UIProcess/API/qt/qwkpage.cpp \
     UIProcess/API/qt/qwkpreferences.cpp \
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 976a769..e4fa143 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,16 @@
+2010-12-10  Jocelyn Turcotte  <jocelyn.turcotte at nokia.com>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [Qt][WK2] Add the QWKContext API class to wrap the WebContext.
+        https://bugs.webkit.org/show_bug.cgi?id=50750
+
+        * MiniBrowser/qt/BrowserView.cpp:
+        (BrowserView::BrowserView):
+        * MiniBrowser/qt/BrowserView.h:
+        * WebKitTestRunner/qt/PlatformWebViewQt.cpp:
+        (WTR::WebView::WebView):
+
 2010-12-10  Joone Hur  <joone at kldp.org>
 
         Reviewed by Eric Seidel.
diff --git a/WebKitTools/MiniBrowser/qt/BrowserView.cpp b/WebKitTools/MiniBrowser/qt/BrowserView.cpp
index c885a39..e6548ab 100644
--- a/WebKitTools/MiniBrowser/qt/BrowserView.cpp
+++ b/WebKitTools/MiniBrowser/qt/BrowserView.cpp
@@ -29,7 +29,6 @@
 #include "BrowserView.h"
 
 #include <QGraphicsScene>
-#include "WKContext.h"
 
 static QWKPage* createNewPage(QWKPage* page)
 {
@@ -39,11 +38,9 @@ static QWKPage* createNewPage(QWKPage* page)
 BrowserView::BrowserView(QGraphicsWKView::BackingStoreType backingStoreType, QWidget* parent)
     : QGraphicsView(parent)
     , m_item(0)
-    , m_context(WKContextGetSharedProcessContext())
+    , m_context(new QWKContext(this))
 {
-    WKRetainPtr<WKPageNamespaceRef> pageNamespace(AdoptWK, WKPageNamespaceCreate(m_context.get()));
-
-    m_item = new QGraphicsWKView(pageNamespace.get(), backingStoreType, 0);
+    m_item = new QGraphicsWKView(m_context, backingStoreType, 0);
     setScene(new QGraphicsScene(this));
     scene()->addItem(m_item);
 
diff --git a/WebKitTools/MiniBrowser/qt/BrowserView.h b/WebKitTools/MiniBrowser/qt/BrowserView.h
index 7e8288e..7680aa7 100644
--- a/WebKitTools/MiniBrowser/qt/BrowserView.h
+++ b/WebKitTools/MiniBrowser/qt/BrowserView.h
@@ -31,7 +31,7 @@
 
 #include <QGraphicsView>
 #include "qgraphicswkview.h"
-#include "WKRetainPtr.h"
+#include "qwkcontext.h"
 
 class BrowserView : public QGraphicsView {
     Q_OBJECT
@@ -48,7 +48,7 @@ protected:
 
 private:
     QGraphicsWKView* m_item;
-    WKRetainPtr<WKContextRef> m_context;
+    QWKContext* m_context;
 };
 
 #endif
diff --git a/WebKitTools/WebKitTestRunner/qt/PlatformWebViewQt.cpp b/WebKitTools/WebKitTestRunner/qt/PlatformWebViewQt.cpp
index d8497a6..bd991ad 100644
--- a/WebKitTools/WebKitTestRunner/qt/PlatformWebViewQt.cpp
+++ b/WebKitTools/WebKitTestRunner/qt/PlatformWebViewQt.cpp
@@ -26,6 +26,7 @@
 
 #include "PlatformWebView.h"
 #include "qgraphicswkview.h"
+#include "qwkcontext.h"
 #include <QtGui>
 
 namespace WTR {
@@ -44,7 +45,7 @@ private:
 
 WebView::WebView(WKPageNamespaceRef namespaceRef)
     : QGraphicsView()
-    , m_item(new QGraphicsWKView(namespaceRef))
+    , m_item(new QGraphicsWKView(new QWKContext(namespaceRef, this)))
 {
     setScene(new QGraphicsScene(this));
     scene()->addItem(m_item);

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list