Title: [90820] trunk/Source/WebKit2
Revision
90820
Author
andreas.kl...@nokia.com
Date
2011-07-12 09:15:58 -0700 (Tue, 12 Jul 2011)

Log Message

[Qt][WK2] Add informative loadFailed() signal to web views.
https://bugs.webkit.org/show_bug.cgi?id=64362

Reviewed by Benjamin Poulain.

The web views will now emit loadFailed(QWebError) when a load failure occurs.

The QWebError object currently contains:
- Type of failure (whether it's an engine, network or protocol error.)
- The failing URL.
- Any error code associated with the failure.

* UIProcess/API/qt/qdesktopwebview.cpp:
(QDesktopWebViewPrivate::loadDidFail):
* UIProcess/API/qt/qdesktopwebview.h:
* UIProcess/API/qt/qdesktopwebview_p.h:
* UIProcess/API/qt/qtouchwebpage.h:
* UIProcess/API/qt/qweberror.cpp: Added.
(QWebError::QWebError):
(QWebErrorPrivate::createQWebError):
(QWebErrorPrivate::QWebErrorPrivate):
(QWebErrorPrivate::~QWebErrorPrivate):
(QWebError::type):
(QWebError::errorCode):
(QWebError::url):
* UIProcess/API/qt/qweberror.h: Added.
* UIProcess/API/qt/qweberror_p.h: Added.
* UIProcess/API/qt/tests/commonviewtests/tst_commonviewtests.cpp:
(tst_CommonViewTests::loadNonexistentFileUrl):
* UIProcess/API/qt/tests/commonviewtests/webviewabstraction.cpp:
(WebViewAbstraction::WebViewAbstraction):
(WebViewAbstraction::touchViewLoadFailed):
(WebViewAbstraction::desktopViewLoadFailed):
* UIProcess/API/qt/tests/commonviewtests/webviewabstraction.h:
* UIProcess/qt/ClientImpl.cpp:
(dispatchLoadSucceeded):
(dispatchLoadFailed):
(qt_wk_didFailProvisionalLoadWithErrorForFrame):
(qt_wk_didFinishLoadForFrame):
(qt_wk_didFailLoadWithErrorForFrame):
* UIProcess/qt/QtWebPageProxy.cpp:
(QtWebPageProxy::loadDidFail):
* UIProcess/qt/QtWebPageProxy.h:
* UIProcess/qt/TouchViewInterface.cpp:
(WebKit::TouchViewInterface::loadDidFail):
* UIProcess/qt/TouchViewInterface.h:
* UIProcess/qt/ViewInterface.h:
* WebKit2API.pri:

Modified Paths

Added Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (90819 => 90820)


--- trunk/Source/WebKit2/ChangeLog	2011-07-12 14:53:20 UTC (rev 90819)
+++ trunk/Source/WebKit2/ChangeLog	2011-07-12 16:15:58 UTC (rev 90820)
@@ -1,3 +1,54 @@
+2011-07-12  Andreas Kling  <kl...@webkit.org>
+
+        [Qt][WK2] Add informative loadFailed() signal to web views.
+        https://bugs.webkit.org/show_bug.cgi?id=64362
+
+        Reviewed by Benjamin Poulain.
+
+        The web views will now emit loadFailed(QWebError) when a load failure occurs.
+
+        The QWebError object currently contains:
+        - Type of failure (whether it's an engine, network or protocol error.)
+        - The failing URL.
+        - Any error code associated with the failure.
+
+        * UIProcess/API/qt/qdesktopwebview.cpp:
+        (QDesktopWebViewPrivate::loadDidFail):
+        * UIProcess/API/qt/qdesktopwebview.h:
+        * UIProcess/API/qt/qdesktopwebview_p.h:
+        * UIProcess/API/qt/qtouchwebpage.h:
+        * UIProcess/API/qt/qweberror.cpp: Added.
+        (QWebError::QWebError):
+        (QWebErrorPrivate::createQWebError):
+        (QWebErrorPrivate::QWebErrorPrivate):
+        (QWebErrorPrivate::~QWebErrorPrivate):
+        (QWebError::type):
+        (QWebError::errorCode):
+        (QWebError::url):
+        * UIProcess/API/qt/qweberror.h: Added.
+        * UIProcess/API/qt/qweberror_p.h: Added.
+        * UIProcess/API/qt/tests/commonviewtests/tst_commonviewtests.cpp:
+        (tst_CommonViewTests::loadNonexistentFileUrl):
+        * UIProcess/API/qt/tests/commonviewtests/webviewabstraction.cpp:
+        (WebViewAbstraction::WebViewAbstraction):
+        (WebViewAbstraction::touchViewLoadFailed):
+        (WebViewAbstraction::desktopViewLoadFailed):
+        * UIProcess/API/qt/tests/commonviewtests/webviewabstraction.h:
+        * UIProcess/qt/ClientImpl.cpp:
+        (dispatchLoadSucceeded):
+        (dispatchLoadFailed):
+        (qt_wk_didFailProvisionalLoadWithErrorForFrame):
+        (qt_wk_didFinishLoadForFrame):
+        (qt_wk_didFailLoadWithErrorForFrame):
+        * UIProcess/qt/QtWebPageProxy.cpp:
+        (QtWebPageProxy::loadDidFail):
+        * UIProcess/qt/QtWebPageProxy.h:
+        * UIProcess/qt/TouchViewInterface.cpp:
+        (WebKit::TouchViewInterface::loadDidFail):
+        * UIProcess/qt/TouchViewInterface.h:
+        * UIProcess/qt/ViewInterface.h:
+        * WebKit2API.pri:
+
 2011-07-12  Jocelyn Turcotte  <jocelyn.turco...@nokia.com>
 
         [Qt] Forward the touch view scale changes to the tiled drawing area.

Modified: trunk/Source/WebKit2/UIProcess/API/qt/qdesktopwebview.cpp (90819 => 90820)


--- trunk/Source/WebKit2/UIProcess/API/qt/qdesktopwebview.cpp	2011-07-12 14:53:20 UTC (rev 90819)
+++ trunk/Source/WebKit2/UIProcess/API/qt/qdesktopwebview.cpp	2011-07-12 16:15:58 UTC (rev 90820)
@@ -112,6 +112,11 @@
     emit q->loadSucceeded();
 }
 
+void QDesktopWebViewPrivate::loadDidFail(const QWebError& error)
+{
+    emit q->loadFailed(error);
+}
+
 void QDesktopWebViewPrivate::didChangeLoadProgress(int percentageLoaded)
 {
     emit q->loadProgress(percentageLoaded);

Modified: trunk/Source/WebKit2/UIProcess/API/qt/qdesktopwebview.h (90819 => 90820)


--- trunk/Source/WebKit2/UIProcess/API/qt/qdesktopwebview.h	2011-07-12 14:53:20 UTC (rev 90819)
+++ trunk/Source/WebKit2/UIProcess/API/qt/qdesktopwebview.h	2011-07-12 16:15:58 UTC (rev 90820)
@@ -29,6 +29,7 @@
 #include <QUrl>
 
 class QDesktopWebViewPrivate;
+class QWebError;
 
 namespace WTR {
     class WebView;
@@ -56,6 +57,7 @@
     void statusBarMessageChanged(const QString&);
     void loadStarted();
     void loadSucceeded();
+    void loadFailed(const QWebError&);
     void loadProgress(int progress);
     void urlChanged(const QUrl&);
 

Modified: trunk/Source/WebKit2/UIProcess/API/qt/qdesktopwebview_p.h (90819 => 90820)


--- trunk/Source/WebKit2/UIProcess/API/qt/qdesktopwebview_p.h	2011-07-12 14:53:20 UTC (rev 90819)
+++ trunk/Source/WebKit2/UIProcess/API/qt/qdesktopwebview_p.h	2011-07-12 16:15:58 UTC (rev 90820)
@@ -58,6 +58,7 @@
     virtual void didChangeCursor(const QCursor&);
     virtual void loadDidBegin();
     virtual void loadDidSucceed();
+    virtual void loadDidFail(const QWebError&);
     virtual void didChangeLoadProgress(int);
 
     virtual void showContextMenu(QSharedPointer<QMenu>);

Modified: trunk/Source/WebKit2/UIProcess/API/qt/qtouchwebpage.h (90819 => 90820)


--- trunk/Source/WebKit2/UIProcess/API/qt/qtouchwebpage.h	2011-07-12 14:53:20 UTC (rev 90819)
+++ trunk/Source/WebKit2/UIProcess/API/qt/qtouchwebpage.h	2011-07-12 16:15:58 UTC (rev 90820)
@@ -29,6 +29,7 @@
 
 class QTouchWebPagePrivate;
 class QTouchWebPageProxy;
+class QWebError;
 
 namespace WebKit {
     class TouchViewInterface;
@@ -59,6 +60,7 @@
     void titleChanged(const QString&);
     void loadStarted();
     void loadSucceeded();
+    void loadFailed(const QWebError&);
     void loadProgress(int progress);
 
 protected:

Added: trunk/Source/WebKit2/UIProcess/API/qt/qweberror.cpp (0 => 90820)


--- trunk/Source/WebKit2/UIProcess/API/qt/qweberror.cpp	                        (rev 0)
+++ trunk/Source/WebKit2/UIProcess/API/qt/qweberror.cpp	2011-07-12 16:15:58 UTC (rev 90820)
@@ -0,0 +1,82 @@
+/*
+ * Copyright (C) 2011 Andreas Kling <kl...@webkit.org>
+ *
+ * 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 "config.h"
+#include "qweberror.h"
+
+#include "qweberror_p.h"
+#include <QtCore/QUrl>
+#include <WKSharedAPICast.h>
+#include <WKString.h>
+#include <WKStringQt.h>
+#include <WKType.h>
+#include <WKURL.h>
+#include <WKURLQt.h>
+
+using namespace WebKit;
+
+QWebError::QWebError(QWebErrorPrivate* priv)
+    : d(priv)
+{
+}
+
+QWebError::QWebError(const QWebError& other)
+    : d(other.d)
+{
+}
+
+QWebError QWebErrorPrivate::createQWebError(WKErrorRef errorRef)
+{
+    return QWebError(new QWebErrorPrivate(errorRef));
+}
+
+QWebErrorPrivate::QWebErrorPrivate(WKErrorRef errorRef)
+    : error(errorRef)
+{
+}
+
+QWebErrorPrivate::~QWebErrorPrivate()
+{
+}
+
+QWebError::Type QWebError::type() const
+{
+    WKRetainPtr<WKStringRef> errorDomainPtr = adoptWK(WKErrorCopyDomain(d->error.get()));
+    WTF::String errorDomain = toWTFString(errorDomainPtr.get());
+
+    if (errorDomain == "QtNetwork")
+        return QWebError::NetworkError;
+    if (errorDomain == "HTTP")
+        return QWebError::HttpError;
+    // FIXME: Redirection overflow currently puts the URL hostname in the errorDomain field.
+    //        We should expose that error somehow. Source is QNetworkReplyHandler::redirect().
+    return QWebError::EngineError;
+}
+
+int QWebError::errorCode() const
+{
+    return WKErrorGetErrorCode(d->error.get());
+}
+
+QUrl QWebError::url() const
+{
+    WKRetainPtr<WKURLRef> failingURL = adoptWK(WKErrorCopyFailingURL(d->error.get()));
+    return WKURLCopyQUrl(failingURL.get());
+}

Added: trunk/Source/WebKit2/UIProcess/API/qt/qweberror.h (0 => 90820)


--- trunk/Source/WebKit2/UIProcess/API/qt/qweberror.h	                        (rev 0)
+++ trunk/Source/WebKit2/UIProcess/API/qt/qweberror.h	2011-07-12 16:15:58 UTC (rev 90820)
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 2011 Andreas Kling <kl...@webkit.org>
+ *
+ * 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.
+ *
+ */
+
+#ifndef qweberror_h
+#define qweberror_h
+
+#include "qwebkitglobal.h"
+#include <QSharedDataPointer>
+#include <QtNetwork/QNetworkReply>
+
+class QWebErrorPrivate;
+
+QT_BEGIN_NAMESPACE
+class QUrl;
+QT_END_NAMESPACE
+
+class QWEBKIT_EXPORT QWebError {
+public:
+    enum Type {
+        EngineError,
+        NetworkError,
+        HttpError,
+    };
+
+    Type type() const;
+    QUrl url() const;
+    int errorCode() const;
+
+    int errorCodeAsHttpStatusCode() const { return errorCode(); }
+    QNetworkReply::NetworkError errorCodeAsNetworkError() const { return static_cast<QNetworkReply::NetworkError>(errorCode()); }
+
+    QWebError(const QWebError&);
+
+private:
+    QWebError(QWebErrorPrivate*);
+
+    QSharedDataPointer<QWebErrorPrivate> d;
+    friend class QWebErrorPrivate;
+};
+
+#endif /* qweberror_h */

Added: trunk/Source/WebKit2/UIProcess/API/qt/qweberror_p.h (0 => 90820)


--- trunk/Source/WebKit2/UIProcess/API/qt/qweberror_p.h	                        (rev 0)
+++ trunk/Source/WebKit2/UIProcess/API/qt/qweberror_p.h	2011-07-12 16:15:58 UTC (rev 90820)
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2011 Andreas Kling <kl...@webkit.org>
+ *
+ * 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.
+ *
+ */
+
+#ifndef qweberror_p_h
+#define qweberror_p_h
+
+#include "qweberror.h"
+#include <QtCore/QSharedData>
+#include <WKError.h>
+#include <WKRetainPtr.h>
+
+class QWebErrorPrivate : public QSharedData {
+public:
+    static QWebError createQWebError(WKErrorRef);
+    QWebErrorPrivate(WKErrorRef);
+    ~QWebErrorPrivate();
+
+    WKRetainPtr<WKErrorRef> error;
+};
+
+#endif /* qweberror_p_h */

Modified: trunk/Source/WebKit2/UIProcess/API/qt/tests/commonviewtests/tst_commonviewtests.cpp (90819 => 90820)


--- trunk/Source/WebKit2/UIProcess/API/qt/tests/commonviewtests/tst_commonviewtests.cpp	2011-07-12 14:53:20 UTC (rev 90819)
+++ trunk/Source/WebKit2/UIProcess/API/qt/tests/commonviewtests/tst_commonviewtests.cpp	2011-07-12 16:15:58 UTC (rev 90820)
@@ -33,6 +33,7 @@
     void loadEmptyUrl();
     void loadEmptyPageViewVisible();
     void loadEmptyPageViewHidden();
+    void loadNonexistentFileUrl();
     void backAndForward();
     void reload();
     void stop();
@@ -82,6 +83,16 @@
     QCOMPARE(loadStartedSpy.size(), 1);
 }
 
+void tst_CommonViewTests::loadNonexistentFileUrl()
+{
+    QSignalSpy loadFailedSpy(viewAbstraction.data(), SIGNAL(loadStarted()));
+
+    viewAbstraction->load(QUrl::fromLocalFile(QLatin1String(TESTS_SOURCE_DIR "/html/file_that_does_not_exist.html")));
+    QVERIFY(waitForSignal(viewAbstraction.data(), SIGNAL(loadFailed(QWebError))));
+
+    QCOMPARE(loadFailedSpy.size(), 1);
+}
+
 void tst_CommonViewTests::backAndForward()
 {
     viewAbstraction->load(QUrl::fromLocalFile(QLatin1String(TESTS_SOURCE_DIR "/html/basic_page.html")));

Modified: trunk/Source/WebKit2/UIProcess/API/qt/tests/commonviewtests/webviewabstraction.cpp (90819 => 90820)


--- trunk/Source/WebKit2/UIProcess/API/qt/tests/commonviewtests/webviewabstraction.cpp	2011-07-12 14:53:20 UTC (rev 90819)
+++ trunk/Source/WebKit2/UIProcess/API/qt/tests/commonviewtests/webviewabstraction.cpp	2011-07-12 16:15:58 UTC (rev 90820)
@@ -34,12 +34,14 @@
     m_touchWebViewWindow.setWindowTitle(QLatin1String("TouchWebView"));
     connect(touchWebView()->page(), SIGNAL(loadStarted()), this, SLOT(touchViewLoadStarted()));
     connect(touchWebView()->page(), SIGNAL(loadSucceeded()), this, SLOT(touchViewLoadSucceeded()));
+    connect(touchWebView()->page(), SIGNAL(loadFailed(QWebError)), this, SLOT(touchViewLoadFailed(QWebError)));
 
     screenHalf.moveLeft(screenHalf.right());
     m_desktopWebViewWindow.setGeometry(screenHalf);
     m_desktopWebViewWindow.setWindowTitle(QLatin1String("DesktopWebView"));
     connect(desktopWebView(), SIGNAL(loadStarted()), this, SLOT(desktopViewLoadStarted()));
     connect(desktopWebView(), SIGNAL(loadSucceeded()), this, SLOT(desktopViewLoadSucceeded()));
+    connect(desktopWebView(), SIGNAL(loadFailed(QWebError)), this, SLOT(desktopViewLoadFailed(QWebError)));
 }
 
 void WebViewAbstraction::show()
@@ -113,6 +115,20 @@
         emit loadSucceeded();
 }
 
+void WebViewAbstraction::touchViewLoadFailed(const QWebError& error)
+{
+    m_touchViewSignalsCounter[SIGNAL(loadFailed(QWebError))]++;
+    if (m_touchViewSignalsCounter[SIGNAL(loadFailed(QWebError))] == m_desktopViewSignalsCounter[SIGNAL(loadFailed(QWebError))])
+        emit loadFailed(error);
+}
+
+void WebViewAbstraction::desktopViewLoadFailed(const QWebError& error)
+{
+    m_desktopViewSignalsCounter[SIGNAL(loadFailed(QWebError))]++;
+    if (m_touchViewSignalsCounter[SIGNAL(loadFailed(QWebError))] == m_desktopViewSignalsCounter[SIGNAL(loadFailed(QWebError))])
+        emit loadFailed(error);
+}
+
 QTouchWebView* WebViewAbstraction::touchWebView() const
 {
     return static_cast<QTouchWebView*>(m_touchWebViewWindow.webView.data());

Modified: trunk/Source/WebKit2/UIProcess/API/qt/tests/commonviewtests/webviewabstraction.h (90819 => 90820)


--- trunk/Source/WebKit2/UIProcess/API/qt/tests/commonviewtests/webviewabstraction.h	2011-07-12 14:53:20 UTC (rev 90819)
+++ trunk/Source/WebKit2/UIProcess/API/qt/tests/commonviewtests/webviewabstraction.h	2011-07-12 16:15:58 UTC (rev 90820)
@@ -45,12 +45,15 @@
 Q_SIGNALS:
     void loadStarted();
     void loadSucceeded();
+    void loadFailed(const QWebError&);
 
 private Q_SLOTS:
     void touchViewLoadStarted();
     void desktopViewLoadStarted();
     void touchViewLoadSucceeded();
     void desktopViewLoadSucceeded();
+    void touchViewLoadFailed(const QWebError&);
+    void desktopViewLoadFailed(const QWebError&);
 
 private:
     QTouchWebView* touchWebView() const;

Modified: trunk/Source/WebKit2/UIProcess/qt/ClientImpl.cpp (90819 => 90820)


--- trunk/Source/WebKit2/UIProcess/qt/ClientImpl.cpp	2011-07-12 14:53:20 UTC (rev 90819)
+++ trunk/Source/WebKit2/UIProcess/qt/ClientImpl.cpp	2011-07-12 16:15:58 UTC (rev 90820)
@@ -24,6 +24,8 @@
 #include "WKAPICast.h"
 #include "WKStringQt.h"
 #include "WKURLQt.h"
+#include "qweberror.h"
+#include "qweberror_p.h"
 #include <qwkcontext.h>
 #include <QtWebPageProxy.h>
 #include <WKFrame.h>
@@ -45,18 +47,24 @@
     return 0;
 }
 
-static void loadFinished(WKFrameRef frame, const void* clientInfo, bool ok)
+static void dispatchLoadSucceeded(WKFrameRef frame, const void* clientInfo)
 {
     if (!WKFrameIsMainFrame(frame))
         return;
-    if (ok)
-        toQtWebPageProxy(clientInfo)->loadDidSucceed();
-    else {
-        // FIXME: loadDidFail().
-    }
+
     toQtWebPageProxy(clientInfo)->updateNavigationActions();
+    toQtWebPageProxy(clientInfo)->loadDidSucceed();
 }
 
+static void dispatchLoadFailed(WKFrameRef frame, const void* clientInfo, WKErrorRef error)
+{
+    if (!WKFrameIsMainFrame(frame))
+        return;
+
+    toQtWebPageProxy(clientInfo)->updateNavigationActions();
+    toQtWebPageProxy(clientInfo)->loadDidFail(QWebErrorPrivate::createQWebError(error));
+}
+
 void qt_wk_didStartProvisionalLoadForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void* clientInfo)
 {
     if (!WKFrameIsMainFrame(frame))
@@ -71,7 +79,7 @@
 
 void qt_wk_didFailProvisionalLoadWithErrorForFrame(WKPageRef page, WKFrameRef frame, WKErrorRef error, WKTypeRef userData, const void* clientInfo)
 {
-    loadFinished(frame, clientInfo, false);
+    dispatchLoadFailed(frame, clientInfo, error);
 }
 
 void qt_wk_didCommitLoadForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void* clientInfo)
@@ -92,12 +100,12 @@
 
 void qt_wk_didFinishLoadForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void* clientInfo)
 {
-    loadFinished(frame, clientInfo, true);
+    dispatchLoadSucceeded(frame, clientInfo);
 }
 
 void qt_wk_didFailLoadWithErrorForFrame(WKPageRef page, WKFrameRef frame, WKErrorRef error, WKTypeRef userData, const void* clientInfo)
 {
-    loadFinished(frame, clientInfo, false);
+    dispatchLoadFailed(frame, clientInfo, error);
 }
 
 void qt_wk_didReceiveTitleForFrame(WKPageRef page, WKStringRef title, WKFrameRef frame, WKTypeRef userData, const void* clientInfo)

Modified: trunk/Source/WebKit2/UIProcess/qt/QtWebPageProxy.cpp (90819 => 90820)


--- trunk/Source/WebKit2/UIProcess/qt/QtWebPageProxy.cpp	2011-07-12 14:53:20 UTC (rev 90819)
+++ trunk/Source/WebKit2/UIProcess/qt/QtWebPageProxy.cpp	2011-07-12 16:15:58 UTC (rev 90820)
@@ -455,6 +455,11 @@
     m_viewInterface->loadDidSucceed();
 }
 
+void QtWebPageProxy::loadDidFail(const QWebError& error)
+{
+    m_viewInterface->loadDidFail(error);
+}
+
 void QtWebPageProxy::didChangeLoadProgress(int newLoadProgress)
 {
     m_viewInterface->didChangeLoadProgress(newLoadProgress);

Modified: trunk/Source/WebKit2/UIProcess/qt/QtWebPageProxy.h (90819 => 90820)


--- trunk/Source/WebKit2/UIProcess/qt/QtWebPageProxy.h	2011-07-12 14:53:20 UTC (rev 90819)
+++ trunk/Source/WebKit2/UIProcess/qt/QtWebPageProxy.h	2011-07-12 16:15:58 UTC (rev 90820)
@@ -147,6 +147,7 @@
 
     void loadDidBegin();
     void loadDidSucceed();
+    void loadDidFail(const QWebError&);
     void didChangeLoadProgress(int);
 
     void paint(QPainter* painter, QRect);

Modified: trunk/Source/WebKit2/UIProcess/qt/TouchViewInterface.cpp (90819 => 90820)


--- trunk/Source/WebKit2/UIProcess/qt/TouchViewInterface.cpp	2011-07-12 14:53:20 UTC (rev 90819)
+++ trunk/Source/WebKit2/UIProcess/qt/TouchViewInterface.cpp	2011-07-12 16:15:58 UTC (rev 90820)
@@ -134,6 +134,11 @@
     emit m_pageView->loadSucceeded();
 }
 
+void TouchViewInterface::loadDidFail(const QWebError& error)
+{
+    emit m_pageView->loadFailed(error);
+}
+
 void TouchViewInterface::didChangeLoadProgress(int percentageLoaded)
 {
     emit m_pageView->loadProgress(percentageLoaded);

Modified: trunk/Source/WebKit2/UIProcess/qt/TouchViewInterface.h (90819 => 90820)


--- trunk/Source/WebKit2/UIProcess/qt/TouchViewInterface.h	2011-07-12 14:53:20 UTC (rev 90819)
+++ trunk/Source/WebKit2/UIProcess/qt/TouchViewInterface.h	2011-07-12 16:15:58 UTC (rev 90820)
@@ -58,6 +58,7 @@
     virtual void didChangeCursor(const QCursor&);
     virtual void loadDidBegin();
     virtual void loadDidSucceed();
+    virtual void loadDidFail(const QWebError&);
     virtual void didChangeLoadProgress(int);
 
     virtual void showContextMenu(QSharedPointer<QMenu>);

Modified: trunk/Source/WebKit2/UIProcess/qt/ViewInterface.h (90819 => 90820)


--- trunk/Source/WebKit2/UIProcess/qt/ViewInterface.h	2011-07-12 14:53:20 UTC (rev 90819)
+++ trunk/Source/WebKit2/UIProcess/qt/ViewInterface.h	2011-07-12 16:15:58 UTC (rev 90820)
@@ -25,6 +25,8 @@
 #include <QtCore/QSize>
 #include <QtGui/QMenu>
 
+class QWebError;
+
 QT_BEGIN_NAMESPACE
 class QCursor;
 class QGraphicsWidget;
@@ -59,6 +61,7 @@
     virtual void didChangeCursor(const QCursor&) = 0;
     virtual void loadDidBegin() = 0;
     virtual void loadDidSucceed() = 0;
+    virtual void loadDidFail(const QWebError&) = 0;
     virtual void didChangeLoadProgress(int) = 0;
 
     virtual void showContextMenu(QSharedPointer<QMenu>) = 0;

Modified: trunk/Source/WebKit2/WebKit2API.pri (90819 => 90820)


--- trunk/Source/WebKit2/WebKit2API.pri	2011-07-12 14:53:20 UTC (rev 90819)
+++ trunk/Source/WebKit2/WebKit2API.pri	2011-07-12 16:15:58 UTC (rev 90820)
@@ -6,6 +6,7 @@
     $$SOURCE_DIR/WebKit2/Shared/API/c/WKCertificateInfo.cpp \
     $$SOURCE_DIR/WebKit2/Shared/API/c/WKContextMenuItem.cpp \
     $$SOURCE_DIR/WebKit2/Shared/API/c/WKDictionary.cpp \
+    $$SOURCE_DIR/WebKit2/Shared/API/c/WKError.cpp \
     $$SOURCE_DIR/WebKit2/Shared/API/c/WKGraphicsContext.cpp \
     $$SOURCE_DIR/WebKit2/Shared/API/c/WKImage.cpp \
     $$SOURCE_DIR/WebKit2/Shared/API/c/WKMutableDictionary.cpp \
@@ -47,6 +48,7 @@
     $$SOURCE_DIR/WebKit2/UIProcess/API/qt/qdesktopwebview.cpp \
     $$SOURCE_DIR/WebKit2/UIProcess/API/qt/qtouchwebpage.cpp \
     $$SOURCE_DIR/WebKit2/UIProcess/API/qt/qtouchwebview.cpp \
+    $$SOURCE_DIR/WebKit2/UIProcess/API/qt/qweberror.cpp \
     $$SOURCE_DIR/WebKit2/WebProcess/InjectedBundle/API/c/WKBundle.cpp \
     $$SOURCE_DIR/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleBackForwardList.cpp \
     $$SOURCE_DIR/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleBackForwardListItem.cpp \
@@ -69,6 +71,7 @@
     $$SOURCE_DIR/WebKit2/Shared/API/c/WKContextMenuItem.h \
     $$SOURCE_DIR/WebKit2/Shared/API/c/WKContextMenuItemTypes.h \
     $$SOURCE_DIR/WebKit2/Shared/API/c/WKDictionary.h \
+    $$SOURCE_DIR/WebKit2/Shared/API/c/WKError.h \
     $$SOURCE_DIR/WebKit2/Shared/API/c/WKGeometry.h \
     $$SOURCE_DIR/WebKit2/Shared/API/c/WKGraphicsContext.h \
     $$SOURCE_DIR/WebKit2/Shared/API/c/WKImage.h \
@@ -125,6 +128,8 @@
     $$SOURCE_DIR/WebKit2/UIProcess/API/qt/qtouchwebpage_p.h \
     $$SOURCE_DIR/WebKit2/UIProcess/API/qt/qtouchwebview.h \
     $$SOURCE_DIR/WebKit2/UIProcess/API/qt/qtouchwebview_p.h \
+    $$SOURCE_DIR/WebKit2/UIProcess/API/qt/qweberror.h \
+    $$SOURCE_DIR/WebKit2/UIProcess/API/qt/qweberror_p.h \
     $$SOURCE_DIR/WebKit2/UIProcess/API/qt/qwebkittypes.h \
     $$SOURCE_DIR/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleBackForwardList.h \
     $$SOURCE_DIR/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleBackForwardListItem.h \
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to