Rename QWebNetworkRequest::request into QWebNetworkRequest::httpHeader.
authorhausmann <hausmann@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 13 Jun 2007 13:03:11 +0000 (13:03 +0000)
committerhausmann <hausmann@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 13 Jun 2007 13:03:11 +0000 (13:03 +0000)
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@23488 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebKitQt/Api/qwebnetworkinterface.cpp
WebKitQt/Api/qwebnetworkinterface_p.h
WebKitQt/ChangeLog
WebKitQt/WebCoreSupport/FrameLoaderClientQt.cpp

index 94ffb75224f9d8c22993bcf6d9c2b084249c273d..eab6c22e98dd8c21f890464e65e210cb51c2808e 100644 (file)
@@ -66,10 +66,10 @@ void QWebNetworkRequest::init(const WebCore::ResourceRequest &resourceRequest)
 
 void QWebNetworkRequest::init(const QString &method, const QUrl &url, const WebCore::ResourceRequest *resourceRequest)
 {
-    request = QHttpRequestHeader(method, url.toEncoded(QUrl::RemoveScheme|QUrl::RemoveAuthority));
-    request.setValue(QLatin1String("User-Agent"),
-                             QLatin1String("Mozilla/5.0 (PC; U; Intel; Linux; en) AppleWebKit/420+ (KHTML, like Gecko)"));
-    request.setValue(QLatin1String("Connection"), QLatin1String("Keep-Alive"));
+    httpHeader = QHttpRequestHeader(method, url.toEncoded(QUrl::RemoveScheme|QUrl::RemoveAuthority));
+    httpHeader.setValue(QLatin1String("User-Agent"),
+                         QLatin1String("Mozilla/5.0 (PC; U; Intel; Linux; en) AppleWebKit/420+ (KHTML, like Gecko)"));
+    httpHeader.setValue(QLatin1String("Connection"), QLatin1String("Keep-Alive"));
     setURL(url);
 
     if (resourceRequest) {
@@ -77,20 +77,20 @@ void QWebNetworkRequest::init(const QString &method, const QUrl &url, const WebC
         if (scheme == QLatin1String("http") || scheme == QLatin1String("https")) {
             QString cookies = WebCore::cookies(resourceRequest->url());
             if (!cookies.isEmpty())
-                request.setValue(QLatin1String("Cookie"), cookies);
+                httpHeader.setValue(QLatin1String("Cookie"), cookies);
         }
 
 
         const HTTPHeaderMap& loaderHeaders = resourceRequest->httpHeaderFields();
         HTTPHeaderMap::const_iterator end = loaderHeaders.end();
         for (HTTPHeaderMap::const_iterator it = loaderHeaders.begin(); it != end; ++it)
-            request.setValue(it->first, it->second);
+            httpHeader.setValue(it->first, it->second);
 
         // handle and perform a 'POST' request
         if (method == "POST") {
             DeprecatedString pd = resourceRequest->httpBody()->flattenToString().deprecatedString();
             postData = QByteArray(pd.ascii(), pd.length());
-            request.setValue(QLatin1String("content-length"), QString::number(postData.size()));
+            httpHeader.setValue(QLatin1String("content-length"), QString::number(postData.size()));
         }
     }
 }
@@ -100,9 +100,9 @@ void QWebNetworkRequest::setURL(const QUrl &u)
     url = u;
     int port = url.port();
     if (port > 0 && port != 80)
-        request.setValue(QLatin1String("Host"), url.host() + QLatin1Char(':') + QString::number(port));
+        httpHeader.setValue(QLatin1String("Host"), url.host() + QLatin1Char(':') + QString::number(port));
     else
-        request.setValue(QLatin1String("Host"), url.host());
+        httpHeader.setValue(QLatin1String("Host"), url.host());
 }
 
 /*!
@@ -161,7 +161,7 @@ QByteArray QWebNetworkJob::postData() const
 */
 QHttpRequestHeader QWebNetworkJob::request() const
 {
-    return d->request;
+    return d->httpHeader;
 }
 
 /*!
@@ -258,10 +258,10 @@ bool QWebNetworkManager::add(ResourceHandle *handle, QWebNetworkInterface *inter
     if (handle->method() != "POST" && handle->method() != "GET") {
         // don't know what to do! (probably a request error!!)
         // but treat it like a 'GET' request
-        qWarning("REQUEST: [%s]\n", qPrintable(job->d->request.toString()));
+        qWarning("REQUEST: [%s]\n", qPrintable(job->d->httpHeader.toString()));
     }
 
-    DEBUG() << "QWebNetworkManager::add:" <<  job->d->request.toString();
+    DEBUG() << "QWebNetworkManager::add:" <<  job->d->httpHeader.toString();
 
     interface->addJob(job);
 
@@ -343,7 +343,7 @@ void QWebNetworkManager::started(QWebNetworkJob *job)
             newRequest.setURL(KURL(newRequest.url(), DeprecatedString(location)));
             if (client)
                 client->willSendRequest(job->d->resourceHandle, newRequest, response);
-            job->d->request.setRequest(job->d->request.method(), newRequest.url().path() + newRequest.url().query());
+            job->d->httpHeader.setRequest(job->d->httpHeader.method(), newRequest.url().path() + newRequest.url().query());
             job->d->setURL(QString(newRequest.url().url()));
             job->d->redirected = true;
             return;
index 3ebe01b4daa14922866572860907f8b099c83e06..4907e74319c48dfe01a14389374f9654c34c050d 100644 (file)
@@ -39,7 +39,7 @@ namespace WebCore {
 struct QWebNetworkRequest
 {
     QUrl url;
-    QHttpRequestHeader request;
+    QHttpRequestHeader httpHeader;
     QByteArray postData;
 
     void init(const WebCore::ResourceRequest &resourceRequest);
index 06ae4c6f82bc9180227c254a7ac6f006d93e19b5..e92688bb91fafa3bf1881b4ae9785105643ba7e8 100644 (file)
@@ -1,3 +1,18 @@
+2007-06-13  Simon Hausmann  <hausmann@kde.org>
+
+        Reviewed by Lars.
+
+        Rename QWebNetworkRequest::request into QWebNetworkRequest::httpHeader.
+
+        * Api/qwebnetworkinterface.cpp:
+        (QWebNetworkRequest::init):
+        (QWebNetworkRequest::setURL):
+        (QWebNetworkManager::add):
+        (QWebNetworkManager::started):
+        * Api/qwebnetworkinterface_p.h:
+        * WebCoreSupport/FrameLoaderClientQt.cpp:
+        (WebCore::FrameLoaderClientQt::dispatchDecidePolicyForNavigationAction):
+
 2007-06-12  Lars Knoll <lars@trolltech.com>
 
         Reviewed by George Staikos.
index a1f139fc0c967d4d0aee9f1a82d45440b9c36811..6b9a88ccdf1524dbd83deefc62816eb24554bd16 100644 (file)
@@ -815,7 +815,7 @@ void FrameLoaderClientQt::dispatchDecidePolicyForNavigationAction(FramePolicyFun
         r.init(request);
         QWebPage *page = m_webFrame->page();
 
-        if (page->d->navigationRequested(m_webFrame, r.url, r.request, r.postData) == QWebPage::IgnoreNavigationRequest) {
+        if (page->d->navigationRequested(m_webFrame, r.url, r.httpHeader, r.postData) == QWebPage::IgnoreNavigationRequest) {
             slotCallPolicyFunction(PolicyIgnore);
             return;
         }