[Qt] Move the QQuickWebViewExperimental pointer to QQuickWebViewPrivate
authorjocelyn.turcotte@digia.com <jocelyn.turcotte@digia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 24 Oct 2012 15:28:37 +0000 (15:28 +0000)
committerjocelyn.turcotte@digia.com <jocelyn.turcotte@digia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 24 Oct 2012 15:28:37 +0000 (15:28 +0000)
https://bugs.webkit.org/show_bug.cgi?id=100253

Reviewed by Kenneth Rohde Christiansen.

Source/WebKit2:

We'll need to avoid placing data in QQuickWebView to preserve
its binary compatibility once it's public.
Also make the QQuickWebViewExperimental constructor private.

* UIProcess/API/qt/qquickwebview.cpp:
(QQuickWebViewPrivate::QQuickWebViewPrivate):
(QQuickWebViewExperimental::QQuickWebViewExperimental):
(QQuickWebView::QQuickWebView):
(QQuickWebView::experimental):
* UIProcess/API/qt/qquickwebview_p.h:
* UIProcess/API/qt/qquickwebview_p_p.h:
(QQuickWebViewPrivate):

Tools:

* WebKitTestRunner/qt/PlatformWebViewQt.cpp:
(WTR::WrapperWindow::handleStatusChanged):
Use QQuickWebView::experimental rather than creating a new instance.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@132359 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp
Source/WebKit2/UIProcess/API/qt/qquickwebview_p.h
Source/WebKit2/UIProcess/API/qt/qquickwebview_p_p.h
Tools/ChangeLog
Tools/WebKitTestRunner/qt/PlatformWebViewQt.cpp

index 82d6ee1..112ef31 100644 (file)
@@ -1,3 +1,23 @@
+2012-10-24  Jocelyn Turcotte  <jocelyn.turcotte@digia.com>
+
+        [Qt] Move the QQuickWebViewExperimental pointer to QQuickWebViewPrivate
+        https://bugs.webkit.org/show_bug.cgi?id=100253
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        We'll need to avoid placing data in QQuickWebView to preserve
+        its binary compatibility once it's public.
+        Also make the QQuickWebViewExperimental constructor private.
+
+        * UIProcess/API/qt/qquickwebview.cpp:
+        (QQuickWebViewPrivate::QQuickWebViewPrivate):
+        (QQuickWebViewExperimental::QQuickWebViewExperimental):
+        (QQuickWebView::QQuickWebView):
+        (QQuickWebView::experimental):
+        * UIProcess/API/qt/qquickwebview_p.h:
+        * UIProcess/API/qt/qquickwebview_p_p.h:
+        (QQuickWebViewPrivate):
+
 2012-10-24  Mikhail Pozdnyakov  <mikhail.pozdnyakov@intel.com>
 
         [EFL][WK2] Ewk_Settings refactoring
index 9a0433b..d2c8754 100644 (file)
@@ -258,6 +258,7 @@ QPointF QQuickWebViewPrivate::FlickableAxisLocker::adjust(const QPointF& positio
 
 QQuickWebViewPrivate::QQuickWebViewPrivate(QQuickWebView* viewport)
     : q_ptr(viewport)
+    , experimental(new QQuickWebViewExperimental(viewport, this))
     , alertDialog(0)
     , confirmDialog(0)
     , promptDialog(0)
@@ -897,12 +898,12 @@ void QQuickWebViewFlickablePrivate::handleMouseEvent(QMouseEvent* event)
     pageView->eventHandler()->handleInputEvent(event);
 }
 
-QQuickWebViewExperimental::QQuickWebViewExperimental(QQuickWebView *webView)
+QQuickWebViewExperimental::QQuickWebViewExperimental(QQuickWebView *webView, QQuickWebViewPrivate* webViewPrivate)
     : QObject(webView)
     , q_ptr(webView)
-    , d_ptr(webView->d_ptr.data())
+    , d_ptr(webViewPrivate)
     , schemeParent(new QObject(this))
-    , m_test(new QWebKitTest(webView->d_ptr.data(), this))
+    , m_test(new QWebKitTest(webViewPrivate, this))
 {
 }
 
@@ -1473,7 +1474,6 @@ QQuickWebPage* QQuickWebViewExperimental::page()
 QQuickWebView::QQuickWebView(QQuickItem* parent)
     : QQuickFlickable(parent)
     , d_ptr(createPrivateObject(this))
-    , m_experimental(new QQuickWebViewExperimental(this))
 {
     Q_D(QQuickWebView);
     d->initialize();
@@ -1482,7 +1482,6 @@ QQuickWebView::QQuickWebView(QQuickItem* parent)
 QQuickWebView::QQuickWebView(WKContextRef contextRef, WKPageGroupRef pageGroupRef, QQuickItem* parent)
     : QQuickFlickable(parent)
     , d_ptr(createPrivateObject(this))
-    , m_experimental(new QQuickWebViewExperimental(this))
 {
     Q_D(QQuickWebView);
     d->initialize(contextRef, pageGroupRef);
@@ -1762,7 +1761,8 @@ QVariant QQuickWebView::inputMethodQuery(Qt::InputMethodQuery property) const
 */
 QQuickWebViewExperimental* QQuickWebView::experimental() const
 {
-    return m_experimental;
+    Q_D(const QQuickWebView);
+    return d->experimental;
 }
 
 /*!
index 89e7fbc..dfe7ad8 100644 (file)
@@ -213,9 +213,9 @@ private:
     Q_PRIVATE_SLOT(d_func(), void _q_onUrlChanged());
     Q_PRIVATE_SLOT(d_func(), void _q_onReceivedResponseFromDownload(QWebDownloadItem*));
     Q_PRIVATE_SLOT(d_func(), void _q_onIconChangedForPageURL(const QString&));
+
     // Hides QObject::d_ptr allowing us to use the convenience macros.
     QScopedPointer<QQuickWebViewPrivate> d_ptr;
-    QQuickWebViewExperimental* m_experimental;
 
     friend class QWebKitTest;
     friend class WebKit::PageViewportControllerClientQt;
@@ -284,7 +284,6 @@ public:
         DownloadRequest = QQuickWebView::IgnoreRequest - 1
     };
 
-    QQuickWebViewExperimental(QQuickWebView* webView);
     virtual ~QQuickWebViewExperimental();
 
     QQmlComponent* alertDialog() const;
@@ -380,6 +379,7 @@ Q_SIGNALS:
     void remoteInspectorUrlChanged();
 
 private:
+    QQuickWebViewExperimental(QQuickWebView* webView, QQuickWebViewPrivate* webViewPrivate);
     QQuickWebView* q_ptr;
     QQuickWebViewPrivate* d_ptr;
     QObject* schemeParent;
index 15bf818..adedb6a 100644 (file)
@@ -171,6 +171,7 @@ protected:
 
     QScopedPointer<QQuickWebPage> pageView;
     QQuickWebView* q_ptr;
+    QQuickWebViewExperimental* experimental;
 
     FlickableAxisLocker axisLocker;
 
index e8420bb..f2c031e 100644 (file)
@@ -1,3 +1,14 @@
+2012-10-24  Jocelyn Turcotte  <jocelyn.turcotte@digia.com>
+
+        [Qt] Move the QQuickWebViewExperimental pointer to QQuickWebViewPrivate
+        https://bugs.webkit.org/show_bug.cgi?id=100253
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        * WebKitTestRunner/qt/PlatformWebViewQt.cpp:
+        (WTR::WrapperWindow::handleStatusChanged):
+        Use QQuickWebView::experimental rather than creating a new instance.
+
 2012-10-24  Thiago Marcos P. Santos  <thiago.santos@intel.com>
 
         [EFL] run-webkit-tests writes garbage on stderr when running on Xvfb
index 58c06cc..e1cce48 100644 (file)
@@ -66,10 +66,8 @@ private Q_SLOTS:
             setSurfaceType(OpenGLSurface);
             create();
             QQuickWindowPrivate::get(this)->setRenderWithoutShowing(true);
-        } else {
-            QQuickWebViewExperimental experimental(m_view);
-            experimental.setRenderToOffscreenBuffer(true);
-        }
+        } else
+            m_view->experimental()->setRenderToOffscreenBuffer(true);
 
         QWindowSystemInterface::handleWindowActivated(this);
         m_view->page()->setFocus(true);