[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

andreas.kling at nokia.com andreas.kling at nokia.com
Wed Dec 22 14:42:39 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 9300cdf3d13cf92d1aeae764c0e101f16c76d5cf
Author: andreas.kling at nokia.com <andreas.kling at nokia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Oct 18 08:15:25 2010 +0000

    2010-10-17  Andreas Kling  <kling at webkit.org>
    
            Reviewed by Kenneth Rohde Christiansen.
    
            [Qt] Support custom open() verbs/methods in XMLHttpRequest
            https://bugs.webkit.org/show_bug.cgi?id=40476
    
            Fall back to QNetworkAccessManager::CustomOperation for any HTTP verb
            that's not specifically supported by QNetworkAccessManager.
    
            This prevents the infinite loop that otherwise occurs after sending
            an UnknownOperation request.
    
            This change is covered by existing (skipped) tests that will be
            unskipped once the Qt bots are running Qt 4.7.
    
            * platform/network/qt/QNetworkReplyHandler.cpp:
            (WebCore::QNetworkReplyHandler::httpMethod):
            (WebCore::QNetworkReplyHandler::QNetworkReplyHandler):
            (WebCore::QNetworkReplyHandler::sendResponseIfNeeded):
            * platform/network/qt/QNetworkReplyHandler.h:
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@69946 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 0d19e40..447fa08 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,25 @@
+2010-10-17  Andreas Kling  <kling at webkit.org>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [Qt] Support custom open() verbs/methods in XMLHttpRequest
+        https://bugs.webkit.org/show_bug.cgi?id=40476
+
+        Fall back to QNetworkAccessManager::CustomOperation for any HTTP verb
+        that's not specifically supported by QNetworkAccessManager.
+
+        This prevents the infinite loop that otherwise occurs after sending
+        an UnknownOperation request.
+
+        This change is covered by existing (skipped) tests that will be
+        unskipped once the Qt bots are running Qt 4.7.
+
+        * platform/network/qt/QNetworkReplyHandler.cpp:
+        (WebCore::QNetworkReplyHandler::httpMethod):
+        (WebCore::QNetworkReplyHandler::QNetworkReplyHandler):
+        (WebCore::QNetworkReplyHandler::sendResponseIfNeeded):
+        * platform/network/qt/QNetworkReplyHandler.h:
+
 2010-10-17  Adam Barth  <abarth at webkit.org>
 
         Reviewed by Dimitri Glazkov.
diff --git a/WebCore/platform/network/qt/QNetworkReplyHandler.cpp b/WebCore/platform/network/qt/QNetworkReplyHandler.cpp
index f0f4004..01e624e 100644
--- a/WebCore/platform/network/qt/QNetworkReplyHandler.cpp
+++ b/WebCore/platform/network/qt/QNetworkReplyHandler.cpp
@@ -155,9 +155,9 @@ bool FormDataIODevice::isSequential() const
     return true;
 }
 
-static QString httpMethodString(QNetworkAccessManager::Operation method)
+String QNetworkReplyHandler::httpMethod() const
 {
-    switch (method) {
+    switch (m_method) {
     case QNetworkAccessManager::GetOperation:
         return "GET";
     case QNetworkAccessManager::HeadOperation:
@@ -166,15 +166,14 @@ static QString httpMethodString(QNetworkAccessManager::Operation method)
         return "POST";
     case QNetworkAccessManager::PutOperation:
         return "PUT";
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
     case QNetworkAccessManager::DeleteOperation:
         return "DELETE";
-#endif
 #if QT_VERSION >= QT_VERSION_CHECK(4, 7, 0)
     case QNetworkAccessManager::CustomOperation:
-        return "OPTIONS";
+        return m_resourceHandle->firstRequest().httpMethod();
 #endif
     default:
+        ASSERT_NOT_REACHED();
         return "GET";
     }
 }
@@ -206,11 +205,12 @@ QNetworkReplyHandler::QNetworkReplyHandler(ResourceHandle* handle, LoadMode load
     else if (r.httpMethod() == "DELETE")
         m_method = QNetworkAccessManager::DeleteOperation;
 #if QT_VERSION >= QT_VERSION_CHECK(4, 7, 0)
-    else if (r.httpMethod() == "OPTIONS")
+    else
         m_method = QNetworkAccessManager::CustomOperation;
-#endif
+#else
     else
         m_method = QNetworkAccessManager::UnknownOperation;
+#endif
 
     QObject* originatingObject = 0;
     if (m_resourceHandle->getInternal()->m_context)
@@ -410,7 +410,7 @@ void QNetworkReplyHandler::sendResponseIfNeeded()
             m_method = QNetworkAccessManager::GetOperation;
 
         ResourceRequest newRequest = m_resourceHandle->firstRequest();
-        newRequest.setHTTPMethod(httpMethodString(m_method));
+        newRequest.setHTTPMethod(httpMethod());
         newRequest.setURL(newUrl);
 
         // Should not set Referer after a redirect from a secure resource to non-secure one.
diff --git a/WebCore/platform/network/qt/QNetworkReplyHandler.h b/WebCore/platform/network/qt/QNetworkReplyHandler.h
index b64d5ff..884a1a4 100644
--- a/WebCore/platform/network/qt/QNetworkReplyHandler.h
+++ b/WebCore/platform/network/qt/QNetworkReplyHandler.h
@@ -67,6 +67,7 @@ private slots:
 private:
     void start();
     void resetState();
+    String httpMethod() const;
 
     QNetworkReply* m_reply;
     ResourceHandle* m_resourceHandle;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list