[Qt][WK2] qweberror* should follow the new file and class naming rules
authorjesus@webkit.org <jesus@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 20 Oct 2011 22:40:34 +0000 (22:40 +0000)
committerjesus@webkit.org <jesus@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 20 Oct 2011 22:40:34 +0000 (22:40 +0000)
https://bugs.webkit.org/show_bug.cgi?id=70550

Reviewed by Noam Rosenthal.

Renaming qweberror* files and class to QtWebError*.
QWebErrorPrivate is now merged into QtWebError.

* UIProcess/API/qt/qdesktopwebview.cpp:
(QDesktopWebViewPrivate::loadDidFail):
* UIProcess/API/qt/qdesktopwebview_p.h:
* UIProcess/qt/ClientImpl.cpp:
(dispatchLoadFailed):
* UIProcess/qt/QtTouchViewInterface.cpp:
(WebKit::QtTouchViewInterface::loadDidFail):
* UIProcess/qt/QtTouchViewInterface.h:
* UIProcess/qt/QtViewInterface.h:
* UIProcess/qt/QtWebError.cpp: Renamed from Source/WebKit2/UIProcess/qt/qweberror.cpp.
(QtWebError::QtWebError):
(QtWebError::type):
(QtWebError::errorCode):
(QtWebError::url):
* UIProcess/qt/QtWebError.h: Renamed from Source/WebKit2/UIProcess/qt/qweberror.h.
(QtWebError::errorCodeAsHttpStatusCode):
(QtWebError::errorCodeAsNetworkError):
* UIProcess/qt/QtWebPageProxy.cpp:
(QtWebPageProxy::loadDidFail):
* UIProcess/qt/QtWebPageProxy.h:
* UIProcess/qt/qweberror_p.h: Removed.
* WebKit2.pro:

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

13 files changed:
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/qt/qdesktopwebview.cpp
Source/WebKit2/UIProcess/API/qt/qdesktopwebview_p.h
Source/WebKit2/UIProcess/qt/ClientImpl.cpp
Source/WebKit2/UIProcess/qt/QtTouchViewInterface.cpp
Source/WebKit2/UIProcess/qt/QtTouchViewInterface.h
Source/WebKit2/UIProcess/qt/QtViewInterface.h
Source/WebKit2/UIProcess/qt/QtWebError.cpp [moved from Source/WebKit2/UIProcess/qt/qweberror.cpp with 65% similarity]
Source/WebKit2/UIProcess/qt/QtWebError.h [moved from Source/WebKit2/UIProcess/qt/qweberror.h with 82% similarity]
Source/WebKit2/UIProcess/qt/QtWebPageProxy.cpp
Source/WebKit2/UIProcess/qt/QtWebPageProxy.h
Source/WebKit2/UIProcess/qt/qweberror_p.h [deleted file]
Source/WebKit2/WebKit2.pro

index 2bbbe80..770aa9e 100644 (file)
@@ -1,3 +1,36 @@
+2011-10-20  Jesus Sanchez-Palencia  <jesus.palencia@openbossa.org>
+
+        [Qt][WK2] qweberror* should follow the new file and class naming rules
+        https://bugs.webkit.org/show_bug.cgi?id=70550
+
+        Reviewed by Noam Rosenthal.
+
+        Renaming qweberror* files and class to QtWebError*.
+        QWebErrorPrivate is now merged into QtWebError.
+
+        * UIProcess/API/qt/qdesktopwebview.cpp:
+        (QDesktopWebViewPrivate::loadDidFail):
+        * UIProcess/API/qt/qdesktopwebview_p.h:
+        * UIProcess/qt/ClientImpl.cpp:
+        (dispatchLoadFailed):
+        * UIProcess/qt/QtTouchViewInterface.cpp:
+        (WebKit::QtTouchViewInterface::loadDidFail):
+        * UIProcess/qt/QtTouchViewInterface.h:
+        * UIProcess/qt/QtViewInterface.h:
+        * UIProcess/qt/QtWebError.cpp: Renamed from Source/WebKit2/UIProcess/qt/qweberror.cpp.
+        (QtWebError::QtWebError):
+        (QtWebError::type):
+        (QtWebError::errorCode):
+        (QtWebError::url):
+        * UIProcess/qt/QtWebError.h: Renamed from Source/WebKit2/UIProcess/qt/qweberror.h.
+        (QtWebError::errorCodeAsHttpStatusCode):
+        (QtWebError::errorCodeAsNetworkError):
+        * UIProcess/qt/QtWebPageProxy.cpp:
+        (QtWebPageProxy::loadDidFail):
+        * UIProcess/qt/QtWebPageProxy.h:
+        * UIProcess/qt/qweberror_p.h: Removed.
+        * WebKit2.pro:
+
 2011-10-20  Alexey Proskuryakov  <ap@apple.com>
 
         REGRESSION (r96823): Contextual menu closes immediately when control-clicking in Flash plug-in
index 186b9d7..f456dc0 100644 (file)
@@ -21,9 +21,9 @@
 #include "config.h"
 #include "qdesktopwebview.h"
 
+#include "QtWebError.h"
 #include "UtilsQt.h"
 #include "qdesktopwebview_p.h"
-#include "qweberror.h"
 #include <QFileDialog>
 #include <QGraphicsSceneEvent>
 #include <QGraphicsSceneResizeEvent>
@@ -160,7 +160,7 @@ void QDesktopWebViewPrivate::loadDidSucceed()
     emit q->loadSucceeded();
 }
 
-void QDesktopWebViewPrivate::loadDidFail(const QWebError& error)
+void QDesktopWebViewPrivate::loadDidFail(const QtWebError& error)
 {
     emit q->loadFailed(static_cast<QDesktopWebView::ErrorType>(error.type()), error.errorCode(), error.url());
 }
index c0c72fe..5327c0b 100644 (file)
@@ -74,7 +74,7 @@ private:
     virtual void loadDidBegin();
     virtual void loadDidCommit();
     virtual void loadDidSucceed();
-    virtual void loadDidFail(const QWebError&);
+    virtual void loadDidFail(const QtWebError&);
     virtual void didChangeLoadProgress(int);
 
     virtual void showContextMenu(QSharedPointer<QMenu>);
index 9cf978b..3c54488 100644 (file)
 #include "config.h"
 #include "ClientImpl.h"
 
+#include "QtWebError.h"
 #include "WebFrameProxy.h"
 #include "WKAPICast.h"
 #include "WKStringQt.h"
 #include "WKURLQt.h"
-#include "qweberror.h"
-#include "qweberror_p.h"
 #include <QtPolicyInterface.h>
 #include <QtViewInterface.h>
 #include <QtWebPageProxy.h>
@@ -79,7 +78,7 @@ static void dispatchLoadFailed(WKFrameRef frame, const void* clientInfo, WKError
     if (toImpl(error)->platformError().isCancellation() || errorCode == kWKErrorCodeFrameLoadInterruptedByPolicyChange || errorCode == kWKErrorCodePlugInWillHandleLoad)
         return;
 
-    toQtWebPageProxy(clientInfo)->loadDidFail(QWebErrorPrivate::createQWebError(error));
+    toQtWebPageProxy(clientInfo)->loadDidFail(QtWebError(error));
 }
 
 void qt_wk_didStartProvisionalLoadForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void* clientInfo)
index 49d2388..f414436 100644 (file)
 #include "config.h"
 #include "QtTouchViewInterface.h"
 
+#include "QtWebError.h"
 #include "qtouchwebpage.h"
 #include "qtouchwebpage_p.h"
 #include "qtouchwebview.h"
 #include "qtouchwebview_p.h"
-#include "qweberror.h"
 
 #include <QDeclarativeEngine>
 #include <QSGView>
@@ -132,7 +132,7 @@ void QtTouchViewInterface::loadDidSucceed()
     emit m_pageView->loadSucceeded();
 }
 
-void QtTouchViewInterface::loadDidFail(const QWebError& error)
+void QtTouchViewInterface::loadDidFail(const QtWebError& error)
 {
     emit m_pageView->loadFailed(static_cast<QTouchWebPage::ErrorType>(error.type()), error.errorCode(), error.url());
 }
index 3b69018..60fb696 100644 (file)
@@ -65,7 +65,7 @@ private:
     virtual void loadDidBegin();
     virtual void loadDidCommit();
     virtual void loadDidSucceed();
-    virtual void loadDidFail(const QWebError&);
+    virtual void loadDidFail(const QtWebError&);
     virtual void didChangeLoadProgress(int);
 
     virtual void showContextMenu(QSharedPointer<QMenu>);
index b6d8b3b..92e4488 100644 (file)
@@ -26,7 +26,7 @@
 #include <QtCore/QSize>
 #include <WebKit2/WKBase.h>
 
-class QWebError;
+class QtWebError;
 
 QT_BEGIN_NAMESPACE
 class QCursor;
@@ -75,7 +75,7 @@ public:
     virtual void loadDidBegin() = 0;
     virtual void loadDidCommit() = 0;
     virtual void loadDidSucceed() = 0;
-    virtual void loadDidFail(const QWebError&) = 0;
+    virtual void loadDidFail(const QtWebError&) = 0;
     virtual void didChangeLoadProgress(int) = 0;
 
     virtual void showContextMenu(QSharedPointer<QMenu>) = 0;
similarity index 65%
rename from Source/WebKit2/UIProcess/qt/qweberror.cpp
rename to Source/WebKit2/UIProcess/qt/QtWebError.cpp
index a5f8d98..7654977 100644 (file)
@@ -19,9 +19,8 @@
  */
 
 #include "config.h"
-#include "qweberror.h"
+#include "QtWebError.h"
 
-#include "qweberror_p.h"
 #include <QtCore/QUrl>
 #include <WKSharedAPICast.h>
 #include <WKString.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)
+QtWebError::QtWebError(WKErrorRef errorRef)
     : error(errorRef)
 {
 }
 
-QWebErrorPrivate::~QWebErrorPrivate()
-{
-}
-
-QWebError::Type QWebError::type() const
+QtWebError::Type QtWebError::type() const
 {
-    WKRetainPtr<WKStringRef> errorDomainPtr = adoptWK(WKErrorCopyDomain(d->error.get()));
+    WKRetainPtr<WKStringRef> errorDomainPtr = adoptWK(WKErrorCopyDomain(error.get()));
     WTF::String errorDomain = toWTFString(errorDomainPtr.get());
 
     if (errorDomain == "QtNetwork")
-        return QWebError::NetworkError;
+        return QtWebError::NetworkError;
     if (errorDomain == "HTTP")
-        return QWebError::HttpError;
+        return QtWebError::HttpError;
     if (errorDomain == "Download")
-        return QWebError::DownloadError;
-    return QWebError::EngineError;
+        return QtWebError::DownloadError;
+    return QtWebError::EngineError;
 }
 
-int QWebError::errorCode() const
+int QtWebError::errorCode() const
 {
-    return WKErrorGetErrorCode(d->error.get());
+    return WKErrorGetErrorCode(error.get());
 }
 
-QUrl QWebError::url() const
+QUrl QtWebError::url() const
 {
-    WKRetainPtr<WKURLRef> failingURL = adoptWK(WKErrorCopyFailingURL(d->error.get()));
+    WKRetainPtr<WKURLRef> failingURL = adoptWK(WKErrorCopyFailingURL(error.get()));
     return WKURLCopyQUrl(failingURL.get());
 }
similarity index 82%
rename from Source/WebKit2/UIProcess/qt/qweberror.h
rename to Source/WebKit2/UIProcess/qt/QtWebError.h
index 3142b64..11b0953 100644 (file)
  *
  */
 
-#ifndef qweberror_h
-#define qweberror_h
+#ifndef QtWebError_h
+#define QtWebError_h
 
 #include "qwebkitglobal.h"
-#include <QSharedDataPointer>
 #include <QtNetwork/QNetworkReply>
-
-class QWebErrorPrivate;
+#include <WKError.h>
+#include <WKRetainPtr.h>
 
 QT_BEGIN_NAMESPACE
 class QUrl;
 QT_END_NAMESPACE
 
-class QWebError {
+class QtWebError {
 public:
     enum Type {
         EngineError,
@@ -47,13 +46,12 @@ public:
     int errorCodeAsHttpStatusCode() const { return errorCode(); }
     QNetworkReply::NetworkError errorCodeAsNetworkError() const { return static_cast<QNetworkReply::NetworkError>(errorCode()); }
 
-    QWebError(const QWebError&);
+    QtWebError(const QtWebError&);
 
-private:
-    QWebError(QWebErrorPrivate*);
+    QtWebError(WKErrorRef);
 
-    QSharedDataPointer<QWebErrorPrivate> d;
-    friend class QWebErrorPrivate;
+private:
+    WKRetainPtr<WKErrorRef> error;
 };
 
-#endif /* qweberror_h */
+#endif /* QtWebError_h */
index 7dbe477..55b306f 100644 (file)
@@ -21,7 +21,7 @@
 #include "config.h"
 #include "QtWebPageProxy.h"
 
-#include "qweberror.h"
+#include "QtWebError.h"
 #include "qwebpreferences_p.h"
 
 #include "ClientImpl.h"
@@ -411,7 +411,7 @@ void QtWebPageProxy::loadDidSucceed()
     m_viewInterface->loadDidSucceed();
 }
 
-void QtWebPageProxy::loadDidFail(const QWebError& error)
+void QtWebPageProxy::loadDidFail(const QtWebError& error)
 {
     m_viewInterface->loadDidFail(error);
 }
index e208daf..3404ff7 100644 (file)
@@ -41,7 +41,7 @@ QT_BEGIN_NAMESPACE
 class QUndoStack;
 QT_END_NAMESPACE
 
-class QWebError;
+class QtWebError;
 class QWebPreferences;
 class QWKHistory;
 
@@ -133,7 +133,7 @@ public:
     void loadDidBegin();
     void loadDidCommit();
     void loadDidSucceed();
-    void loadDidFail(const QWebError&);
+    void loadDidFail(const QtWebError&);
     void didChangeLoadProgress(int);
     int loadProgress() const { return m_loadProgress; }
 
diff --git a/Source/WebKit2/UIProcess/qt/qweberror_p.h b/Source/WebKit2/UIProcess/qt/qweberror_p.h
deleted file mode 100644 (file)
index 3ab88f2..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright (C) 2011 Andreas Kling <kling@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 */
index 3943756..a31e354 100644 (file)
@@ -259,8 +259,7 @@ HEADERS += \
     UIProcess/qt/QtPinchGestureRecognizer.h \
     UIProcess/qt/QtDesktopWebPageProxy.h \
     UIProcess/qt/QtTouchWebPageProxy.h \
-    UIProcess/qt/qweberror.h \
-    UIProcess/qt/qweberror_p.h \
+    UIProcess/qt/QtWebError.h \
     UIProcess/qt/QtWebPageProxy.h \
     UIProcess/qt/qwkhistory.h \
     UIProcess/qt/qwkhistory_p.h \
@@ -501,7 +500,7 @@ SOURCES += \
     UIProcess/qt/QtPinchGestureRecognizer.cpp \
     UIProcess/qt/QtDesktopWebPageProxy.cpp \
     UIProcess/qt/QtTouchWebPageProxy.cpp \
-    UIProcess/qt/qweberror.cpp \
+    UIProcess/qt/QtWebError.cpp \
     UIProcess/qt/QtWebPageProxy.cpp \
     UIProcess/qt/qwkhistory.cpp \
     UIProcess/qt/QtSGUpdateQueue.cpp \