[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

eric at webkit.org eric at webkit.org
Thu Apr 8 00:40:31 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit bab55e80f79e42a89fd2cbae2d4160506d70d240
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Dec 17 18:39:42 2009 +0000

    2009-12-17  Yael Aharon  <yael.aharon at nokia.com>
    
            Reviewed by Kenneth Rohde Christiansen.
    
            [Qt] support navigator.onLine and ononline/onoffline events.
            https://bugs.webkit.org/show_bug.cgi?id=32555
    
            Hooked up Bearer Management to NetworkStateNotifier. This solution is available
            only if QtMobility's Bearer Management is installed.
    
            * WebCore.pro:
            * platform/network/NetworkStateNotifier.h:
            * platform/network/qt/NetworkStateNotifierPrivate.h: Added.
            * platform/network/qt/NetworkStateNotifierQt.cpp: Added.
            (WebCore::NetworkStateNotifierPrivate::NetworkStateNotifierPrivate):
            (WebCore::NetworkStateNotifierPrivate::onlineStateChanged):
            (WebCore::NetworkStateNotifierPrivate::~NetworkStateNotifierPrivate):
            (WebCore::NetworkStateNotifier::updateState):
            (WebCore::NetworkStateNotifier::NetworkStateNotifier):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@52261 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index e225d2e..c8b98df 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,23 @@
+2009-12-17  Yael Aharon  <yael.aharon at nokia.com>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [Qt] support navigator.onLine and ononline/onoffline events.
+        https://bugs.webkit.org/show_bug.cgi?id=32555
+
+        Hooked up Bearer Management to NetworkStateNotifier. This solution is available 
+        only if QtMobility's Bearer Management is installed.
+
+        * WebCore.pro:
+        * platform/network/NetworkStateNotifier.h:
+        * platform/network/qt/NetworkStateNotifierPrivate.h: Added.
+        * platform/network/qt/NetworkStateNotifierQt.cpp: Added.
+        (WebCore::NetworkStateNotifierPrivate::NetworkStateNotifierPrivate):
+        (WebCore::NetworkStateNotifierPrivate::onlineStateChanged):
+        (WebCore::NetworkStateNotifierPrivate::~NetworkStateNotifierPrivate):
+        (WebCore::NetworkStateNotifier::updateState):
+        (WebCore::NetworkStateNotifier::NetworkStateNotifier):
+
 2009-12-17  Pavel Feldman  <pfeldman at chromium.org>
 
         Reviewed by Timothy Hatcher.
diff --git a/WebCore/WebCore.pro b/WebCore/WebCore.pro
index 0c3fed1..4403dc6 100644
--- a/WebCore/WebCore.pro
+++ b/WebCore/WebCore.pro
@@ -179,6 +179,16 @@ contains(DEFINES, ENABLE_SINGLE_THREADED=1) {
     else:DEFINES += ENABLE_XSLT=0
 }
 
+
+!contains(DEFINES, ENABLE_QT_BEARER=.) {
+    symbian: {
+        exists($${EPOCROOT}epoc32/release/winscw/udeb/QtBearer.lib)| \
+        exists($${EPOCROOT}epoc32/release/armv5/lib/QtBearer.lib) {
+            DEFINES += ENABLE_QT_BEARER=1
+        }
+    }
+}
+
 DEFINES += WTF_CHANGES=1
 
 # Enable touch event support with Qt 4.6
@@ -2891,6 +2901,17 @@ contains(DEFINES, ENABLE_XHTMLMP=1) {
     FEATURE_DEFINES_JAVASCRIPT += ENABLE_XHTMLMP=1
 }
 
+contains(DEFINES, ENABLE_QT_BEARER=1) {
+    HEADERS += \
+        platform/network/qt/NetworkStateNotifierPrivate.h
+
+    SOURCES += \
+        platform/network/qt/NetworkStateNotifierQt.cpp
+
+    LIBS += -lQtBearer
+
+}
+
 contains(DEFINES, ENABLE_SVG=1) {
     FEATURE_DEFINES_JAVASCRIPT += ENABLE_SVG=1
 
diff --git a/WebCore/platform/network/NetworkStateNotifier.h b/WebCore/platform/network/NetworkStateNotifier.h
index 8bcf4b2..24a347d 100644
--- a/WebCore/platform/network/NetworkStateNotifier.h
+++ b/WebCore/platform/network/NetworkStateNotifier.h
@@ -48,6 +48,10 @@ typedef const struct __SCDynamicStore * SCDynamicStoreRef;
 
 namespace WebCore {
 
+#if (PLATFORM(QT) && ENABLE(QT_BEARER))
+class NetworkStateNotifierPrivate;
+#endif
+
 class NetworkStateNotifier : public Noncopyable {
 public:
     NetworkStateNotifier();
@@ -80,10 +84,14 @@ private:
 
 #elif PLATFORM(CHROMIUM)
     NetworkStateNotifierPrivate p;
+
+#elif PLATFORM(QT) && ENABLE(QT_BEARER)
+    friend class NetworkStateNotifierPrivate;
+    NetworkStateNotifierPrivate* p;
 #endif
 };
 
-#if !PLATFORM(MAC) && !PLATFORM(WIN) && !PLATFORM(CHROMIUM)
+#if !PLATFORM(MAC) && !PLATFORM(WIN) && !PLATFORM(CHROMIUM) && !(PLATFORM(QT) && ENABLE(QT_BEARER))
 
 inline NetworkStateNotifier::NetworkStateNotifier()
     : m_isOnLine(true)
diff --git a/WebCore/platform/network/qt/NetworkStateNotifierPrivate.h b/WebCore/platform/network/qt/NetworkStateNotifierPrivate.h
new file mode 100644
index 0000000..7af6392
--- /dev/null
+++ b/WebCore/platform/network/qt/NetworkStateNotifierPrivate.h
@@ -0,0 +1,49 @@
+/*
+    Copyright (C) 2009 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 NetworkStateNotifierPrivate_h
+#define NetworkStateNotifierPrivate_h
+
+#include <QObject>
+
+namespace QtMobility {
+class QNetworkConfigurationManager;
+}
+
+namespace WebCore {
+
+class NetworkStateNotifier;
+
+class NetworkStateNotifierPrivate : public QObject {
+    Q_OBJECT
+public:
+    NetworkStateNotifierPrivate(NetworkStateNotifier* notifier);
+    ~NetworkStateNotifierPrivate();
+public slots:
+    void onlineStateChanged(bool);
+
+public:
+    QtMobility::QNetworkConfigurationManager* m_configurationManager;
+    bool m_online;
+    NetworkStateNotifier* m_notifier;
+};
+
+} // namespace WebCore
+
+#endif
diff --git a/WebCore/platform/network/qt/NetworkStateNotifierQt.cpp b/WebCore/platform/network/qt/NetworkStateNotifierQt.cpp
new file mode 100644
index 0000000..f74398b
--- /dev/null
+++ b/WebCore/platform/network/qt/NetworkStateNotifierQt.cpp
@@ -0,0 +1,73 @@
+/*
+    Copyright (C) 2009 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.
+*/
+
+#include "config.h"
+#include "NetworkStateNotifier.h"
+
+#include "NetworkStateNotifierPrivate.h"
+#include "qnetworkconfigmanager.h"
+
+using namespace QtMobility;
+
+namespace WebCore {
+
+NetworkStateNotifierPrivate::NetworkStateNotifierPrivate(NetworkStateNotifier* notifier)
+    : m_configurationManager(new QNetworkConfigurationManager())
+    , m_online(m_configurationManager->isOnline())
+    , m_notifier(notifier)
+{
+    Q_ASSERT(notifier);
+    connect(m_configurationManager, SIGNAL(onlineStateChanged(bool)), this, SLOT(onlineStateChanged(bool)));
+}
+
+void NetworkStateNotifierPrivate::onlineStateChanged(bool isOnline)
+{
+    if (m_online == isOnline)
+        return;
+
+    m_online = isOnline;
+    m_notifier->updateState();
+}
+
+NetworkStateNotifierPrivate::~NetworkStateNotifierPrivate()
+{
+    delete m_configurationManager;
+}
+
+void NetworkStateNotifier::updateState()
+{
+    if (m_isOnLine == p->m_online)
+        return;
+
+    m_isOnLine = p->m_online;
+    if (m_networkStateChangedFunction)
+        m_networkStateChangedFunction();
+}
+
+NetworkStateNotifier::NetworkStateNotifier()
+    : m_isOnLine(true)
+    , m_networkStateChangedFunction(0)
+{
+    p = new NetworkStateNotifierPrivate(this);
+    m_isOnLine = p->m_online;
+}
+
+} // namespace WebCore
+
+#include "moc_NetworkStateNotifierPrivate.cpp"

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list