[SCM] WebKit Debian packaging branch, webkit-1.3, updated. upstream/1.3.7-4207-g178b198

jocelyn.turcotte at nokia.com jocelyn.turcotte at nokia.com
Sun Feb 20 22:47:09 UTC 2011


The following commit has been merged in the webkit-1.3 branch:
commit a04ba6c3438b01dbbbd38a7bf0ff46b3c1bde716
Author: jocelyn.turcotte at nokia.com <jocelyn.turcotte at nokia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Jan 11 16:19:05 2011 +0000

    2011-01-11  Jocelyn Turcotte  <jocelyn.turcotte at nokia.com>
    
            Reviewed by Kenneth Rohde Christiansen.
    
            [Qt] Remove uses of QFuture since it isn't supported on all platforms.
            https://bugs.webkit.org/show_bug.cgi?id=51204
    
            * platform/network/qt/QtNAMThreadSafeProxy.cpp:
            (WebCore::QtNAMThreadSafeProxy::QtNAMThreadSafeProxy):
            (WebCore::QtNAMThreadSafeProxy::localCookiesForUrl):
            (WebCore::QtNAMThreadSafeProxy::localWillLoadFromCache):
            * platform/network/qt/QtNAMThreadSafeProxy.h:
            (WebCore::QtNAMThreadSafeProxy::cookiesForUrl):
            (WebCore::QtNAMThreadSafeProxy::willLoadFromCache):
    2011-01-11  Jocelyn Turcotte  <jocelyn.turcotte at nokia.com>
    
            Reviewed by Kenneth Rohde Christiansen.
    
            [Qt] Remove uses of QFuture since it isn't supported on all platforms.
            https://bugs.webkit.org/show_bug.cgi?id=51204
    
            * QtTestBrowser/webpage.h:
            (QtNAMThread::QtNAMThread):
            (QtNAMThread::networkAccessManager):
            (QtNAMThread::run):
    2011-01-11  Jocelyn Turcotte  <jocelyn.turcotte at nokia.com>
    
            Reviewed by Kenneth Rohde Christiansen.
    
            [Qt] Remove uses of QFuture since it isn't supported on all platforms.
            https://bugs.webkit.org/show_bug.cgi?id=51204
    
            * tests/qwebpage/tst_qwebpage.cpp:
            (QtNAMThread::QtNAMThread):
            (QtNAMThread::networkAccessManager):
            (QtNAMThread::run):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@75502 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog
index 0441eb8..870268b 100644
--- a/Source/WebCore/ChangeLog
+++ b/Source/WebCore/ChangeLog
@@ -1,3 +1,18 @@
+2011-01-11  Jocelyn Turcotte  <jocelyn.turcotte at nokia.com>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [Qt] Remove uses of QFuture since it isn't supported on all platforms.
+        https://bugs.webkit.org/show_bug.cgi?id=51204
+
+        * platform/network/qt/QtNAMThreadSafeProxy.cpp:
+        (WebCore::QtNAMThreadSafeProxy::QtNAMThreadSafeProxy):
+        (WebCore::QtNAMThreadSafeProxy::localCookiesForUrl):
+        (WebCore::QtNAMThreadSafeProxy::localWillLoadFromCache):
+        * platform/network/qt/QtNAMThreadSafeProxy.h:
+        (WebCore::QtNAMThreadSafeProxy::cookiesForUrl):
+        (WebCore::QtNAMThreadSafeProxy::willLoadFromCache):
+
 2011-01-11  Pavel Podivilov  <podivilov at chromium.org>
 
         Reviewed by Pavel Feldman.
diff --git a/Source/WebCore/platform/network/qt/QtNAMThreadSafeProxy.cpp b/Source/WebCore/platform/network/qt/QtNAMThreadSafeProxy.cpp
index 0caeb05..e0d6e69 100644
--- a/Source/WebCore/platform/network/qt/QtNAMThreadSafeProxy.cpp
+++ b/Source/WebCore/platform/network/qt/QtNAMThreadSafeProxy.cpp
@@ -25,10 +25,6 @@
 #include <QNetworkCookieJar>
 #include <QStringList>
 
-// Use unused variables to be able to call qRegisterMetaType statically.
-static int dummyStaticVar1 = qRegisterMetaType<QFutureInterface<bool> >("QFutureInterface<bool>");
-static int dummyStaticVar2 = qRegisterMetaType<QFutureInterface<QList<QNetworkCookie> > >("QFutureInterface<QList<QNetworkCookie> >");
-
 namespace WebCore {
 
 QtNAMThreadSafeProxy::QtNAMThreadSafeProxy(QNetworkAccessManager *manager)
@@ -37,8 +33,8 @@ QtNAMThreadSafeProxy::QtNAMThreadSafeProxy(QNetworkAccessManager *manager)
     moveToThread(manager->thread());
 
     connect(this, SIGNAL(localSetCookiesRequested(const QUrl&, const QString&)), SLOT(localSetCookies(const QUrl&, const QString&)));
-    connect(this, SIGNAL(localCookiesForUrlRequested(QFutureInterface<QList<QNetworkCookie> >, const QUrl&)), SLOT(localCookiesForUrl(QFutureInterface<QList<QNetworkCookie> >, const QUrl&)));
-    connect(this, SIGNAL(localWillLoadFromCacheRequested(QFutureInterface<bool>, const QUrl&)), SLOT(localWillLoadFromCache(QFutureInterface<bool>, const QUrl&)));
+    connect(this, SIGNAL(localCookiesForUrlRequested(const QUrl&, bool*, QList<QNetworkCookie>*)), SLOT(localCookiesForUrl(const QUrl&, bool*, QList<QNetworkCookie>*)));
+    connect(this, SIGNAL(localWillLoadFromCacheRequested(const QUrl&, bool*, bool*)), SLOT(localWillLoadFromCache(const QUrl&, bool*, bool*)));
 }
 
 void QtNAMThreadSafeProxy::localSetCookies(const QUrl& url, const QString& cookies)
@@ -54,19 +50,23 @@ void QtNAMThreadSafeProxy::localSetCookies(const QUrl& url, const QString& cooki
     m_manager->cookieJar()->setCookiesFromUrl(cookieList, url);
 }
 
-void QtNAMThreadSafeProxy::localCookiesForUrl(QFutureInterface<QList<QNetworkCookie> > fi, const QUrl& url)
+void QtNAMThreadSafeProxy::localCookiesForUrl(const QUrl& url, bool* done, QList<QNetworkCookie>* result)
 {
-    fi.reportResult(m_manager->cookieJar()->cookiesForUrl(url));
-    fi.reportFinished();
+    QMutexLocker lock(&m_resultMutex);
+    *result = m_manager->cookieJar()->cookiesForUrl(url);
+    *done = true;
+    m_resultWaitCondition.wakeAll();
 }
 
-void QtNAMThreadSafeProxy::localWillLoadFromCache(QFutureInterface<bool> fi, const QUrl& url)
+void QtNAMThreadSafeProxy::localWillLoadFromCache(const QUrl& url, bool* done, bool* result)
 {
-    bool retVal = false;
+    QMutexLocker lock(&m_resultMutex);
     if (m_manager->cache())
-        retVal = m_manager->cache()->metaData(url).isValid();
-
-    fi.reportFinished(&retVal);
+        *result = m_manager->cache()->metaData(url).isValid();
+    else
+        *result = false;
+    *done = true;
+    m_resultWaitCondition.wakeAll();
 }
 
 QtNetworkReplyThreadSafeProxy::QtNetworkReplyThreadSafeProxy(QNetworkAccessManager *manager)
diff --git a/Source/WebCore/platform/network/qt/QtNAMThreadSafeProxy.h b/Source/WebCore/platform/network/qt/QtNAMThreadSafeProxy.h
index a2fa4ee..ae963cf 100644
--- a/Source/WebCore/platform/network/qt/QtNAMThreadSafeProxy.h
+++ b/Source/WebCore/platform/network/qt/QtNAMThreadSafeProxy.h
@@ -19,11 +19,11 @@
 #ifndef QtNAMThreadSafeProxy_h
 #define QtNAMThreadSafeProxy_h
 
-#include <QFuture>
 #include <QMutex>
 #include <QNetworkCookie>
 #include <QNetworkReply>
 #include <QObject>
+#include <QWaitCondition>
 
 QT_BEGIN_NAMESPACE
 class QNetworkAccessManager;
@@ -43,34 +43,44 @@ public:
         emit localSetCookiesRequested(url, cookies);
     }
 
-    QFuture<QList<QNetworkCookie> > cookiesForUrl(const QUrl& url)
+    QList<QNetworkCookie> cookiesForUrl(const QUrl& url)
     {
-        QFutureInterface<QList<QNetworkCookie> > fi;
-        fi.reportStarted();
-        emit localCookiesForUrlRequested(fi, url);
-        return fi.future();
+        bool done = false;
+        QList<QNetworkCookie> result;
+        emit localCookiesForUrlRequested(url, &done, &result);
+
+        QMutexLocker lock(&m_resultMutex);
+        while (!done)
+            m_resultWaitCondition.wait(&m_resultMutex);
+        return result;
     }
 
-    QFuture<bool> willLoadFromCache(const QUrl& url)
+    bool willLoadFromCache(const QUrl& url)
     {
-        QFutureInterface<bool> fi;
-        fi.reportStarted();
-        emit localWillLoadFromCacheRequested(fi, url);
-        return fi.future();
+        bool done = false;
+        bool result;
+        emit localWillLoadFromCacheRequested(url, &done, &result);
+
+        QMutexLocker lock(&m_resultMutex);
+        while (!done)
+            m_resultWaitCondition.wait(&m_resultMutex);
+        return result;
     }
 
 signals:
-    void localSetCookiesRequested(const QUrl& url, const QString& cookies);
-    void localCookiesForUrlRequested(QFutureInterface<QList<QNetworkCookie> > fi, const QUrl& url);
-    void localWillLoadFromCacheRequested(QFutureInterface<bool> fi, const QUrl& url);
+    void localSetCookiesRequested(const QUrl&, const QString& cookies);
+    void localCookiesForUrlRequested(const QUrl&, bool* done, QList<QNetworkCookie>* result);
+    void localWillLoadFromCacheRequested(const QUrl&, bool* done, bool* result);
 
 private slots:
-    void localSetCookies(const QUrl& url, const QString& cookies);
-    void localCookiesForUrl(QFutureInterface<QList<QNetworkCookie> > fi, const QUrl& url);
-    void localWillLoadFromCache(QFutureInterface<bool> fi, const QUrl& url);
+    void localSetCookies(const QUrl&, const QString& cookies);
+    void localCookiesForUrl(const QUrl&, bool* done, QList<QNetworkCookie>* result);
+    void localWillLoadFromCache(const QUrl&, bool* done, bool* result);
 
 private:
     QNetworkAccessManager* m_manager;
+    QMutex m_resultMutex;
+    QWaitCondition m_resultWaitCondition;
 };
 
 
diff --git a/Tools/ChangeLog b/Tools/ChangeLog
index 8da67f9..c8451e5 100644
--- a/Tools/ChangeLog
+++ b/Tools/ChangeLog
@@ -1,3 +1,15 @@
+2011-01-11  Jocelyn Turcotte  <jocelyn.turcotte at nokia.com>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [Qt] Remove uses of QFuture since it isn't supported on all platforms.
+        https://bugs.webkit.org/show_bug.cgi?id=51204
+
+        * QtTestBrowser/webpage.h:
+        (QtNAMThread::QtNAMThread):
+        (QtNAMThread::networkAccessManager):
+        (QtNAMThread::run):
+
 2011-01-11  Peter Varga  <pvarga at webkit.org>
 
         Unreviewed.
diff --git a/Tools/QtTestBrowser/webpage.h b/Tools/QtTestBrowser/webpage.h
index fa93bab..3b856c9 100644
--- a/Tools/QtTestBrowser/webpage.h
+++ b/Tools/QtTestBrowser/webpage.h
@@ -33,9 +33,10 @@
 #ifndef webpage_h
 #define webpage_h
 
-#include <QFuture>
+#include <QMutex>
 #include <QScopedPointer>
 #include <QThread>
+#include <QWaitCondition>
 #include <qwebframe.h>
 #include <qwebpage.h>
 
@@ -78,8 +79,8 @@ class QtNAMThread : public QThread {
 public:
     QtNAMThread(QObject *parent = 0)
         : QThread(parent)
+        , m_qnam(0)
     {
-        m_qnamFuture.reportStarted();
     }
     ~QtNAMThread()
     {
@@ -87,20 +88,29 @@ public:
         wait();
     }
 
-    QFuture<QNetworkAccessManager*> networkAccessManager()
+    QNetworkAccessManager* networkAccessManager()
     {
-        return m_qnamFuture.future();
+        QMutexLocker lock(&m_mutex);
+        while (!m_qnam)
+            m_waitCondition.wait(&m_mutex);
+        return m_qnam;
     }
 protected:
     void run()
     {
-        QNetworkAccessManager qnam;
-        m_qnamFuture.reportResult(&qnam);
-        m_qnamFuture.reportFinished();
+        Q_ASSERT(!m_qnam);
+        {
+            QMutexLocker lock(&m_mutex);
+            m_qnam = new QNetworkAccessManager;
+            m_waitCondition.wakeAll();
+        }
         exec();
+        delete m_qnam;
     }
 private:
-    QFutureInterface<QNetworkAccessManager*> m_qnamFuture;
+    QNetworkAccessManager* m_qnam;
+    QMutex m_mutex;
+    QWaitCondition m_waitCondition;
 };
 
 #endif
diff --git a/WebKit/qt/ChangeLog b/WebKit/qt/ChangeLog
index d55d7ac..9b295e7 100644
--- a/WebKit/qt/ChangeLog
+++ b/WebKit/qt/ChangeLog
@@ -1,3 +1,15 @@
+2011-01-11  Jocelyn Turcotte  <jocelyn.turcotte at nokia.com>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [Qt] Remove uses of QFuture since it isn't supported on all platforms.
+        https://bugs.webkit.org/show_bug.cgi?id=51204
+
+        * tests/qwebpage/tst_qwebpage.cpp:
+        (QtNAMThread::QtNAMThread):
+        (QtNAMThread::networkAccessManager):
+        (QtNAMThread::run):
+
 2011-01-11  Benjamin Poulain  <benjamin.poulain at nokia.com>
 
         Reviewed by Kenneth Rohde Christiansen.
diff --git a/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp b/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
index cdc6e55..ec1f336 100644
--- a/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
+++ b/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
@@ -2683,8 +2683,8 @@ void tst_QWebPage::supportedContentType()
 class QtNAMThread : public QThread {
 public:
     QtNAMThread()
+        : m_qnam(0)
     {
-        m_qnamFuture.reportStarted();
     }
     ~QtNAMThread()
     {
@@ -2692,20 +2692,29 @@ public:
         wait();
     }
 
-    QFuture<QNetworkAccessManager*> networkAccessManager()
+    QNetworkAccessManager* networkAccessManager()
     {
-        return m_qnamFuture.future();
+        QMutexLocker lock(&m_mutex);
+        while (!m_qnam)
+            m_waitCondition.wait(&m_mutex);
+        return m_qnam;
     }
 protected:
     void run()
     {
-        QNetworkAccessManager* qnam = new QNetworkAccessManager;
-        m_qnamFuture.reportFinished(&qnam);
+        Q_ASSERT(!m_qnam);
+        {
+            QMutexLocker lock(&m_mutex);
+            m_qnam = new QNetworkAccessManager;
+            m_waitCondition.wakeAll();
+        }
         exec();
-        delete qnam;
+        delete m_qnam;
     }
 private:
-    QFutureInterface<QNetworkAccessManager*> m_qnamFuture;
+    QNetworkAccessManager* m_qnam;
+    QMutex m_mutex;
+    QWaitCondition m_waitCondition;
 };
 
 void tst_QWebPage::networkAccessManagerOnDifferentThread()

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list