Changed QWebNetworkJobPrivate to aggregate a QWebNetworkRequest instead of inheriting...
authorhausmann <hausmann@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 13 Jun 2007 13:03:23 +0000 (13:03 +0000)
committerhausmann <hausmann@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 13 Jun 2007 13:03:23 +0000 (13:03 +0000)
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@23489 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebKitQt/Api/qwebnetworkinterface.cpp
WebKitQt/Api/qwebnetworkinterface_p.h
WebKitQt/Api/qwebobjectpluginconnector.cpp
WebKitQt/ChangeLog

index eab6c22e98dd8c21f890464e65e210cb51c2808e..f07ae53e5c004834268cf36ea83e3e26c66a91e5 100644 (file)
@@ -145,7 +145,7 @@ QWebNetworkJob::~QWebNetworkJob()
 */
 QUrl QWebNetworkJob::url() const
 {
-    return d->url;
+    return d->request.url;
 }
 
 /*!
@@ -153,7 +153,7 @@ QUrl QWebNetworkJob::url() const
 */
 QByteArray QWebNetworkJob::postData() const
 {
-    return d->postData;
+    return d->request.postData;
 }
 
 /*!
@@ -161,7 +161,7 @@ QByteArray QWebNetworkJob::postData() const
 */
 QHttpRequestHeader QWebNetworkJob::request() const
 {
-    return d->httpHeader;
+    return d->request.httpHeader;
 }
 
 /*!
@@ -253,15 +253,15 @@ bool QWebNetworkManager::add(ResourceHandle *handle, QWebNetworkInterface *inter
     job->d->interface = interface;
     job->d->connector = 0;
 
-    job->d->init(handle->request());
+    job->d->request.init(handle->request());
 
     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->httpHeader.toString()));
+        qWarning("REQUEST: [%s]\n", qPrintable(job->d->request.httpHeader.toString()));
     }
 
-    DEBUG() << "QWebNetworkManager::add:" <<  job->d->httpHeader.toString();
+    DEBUG() << "QWebNetworkManager::add:" <<  job->d->request.httpHeader.toString();
 
     interface->addJob(job);
 
@@ -314,7 +314,7 @@ void QWebNetworkManager::started(QWebNetworkJob *job)
     }
     if (contentType.isEmpty()) {
         // let's try to guess from the extension
-        QString extension = job->d->url.path();
+        QString extension = job->d->request.url.path();
         int index = extension.lastIndexOf(QLatin1Char('.'));
         if (index > 0) {
             extension = extension.mid(index + 1);
@@ -343,8 +343,8 @@ void QWebNetworkManager::started(QWebNetworkJob *job)
             newRequest.setURL(KURL(newRequest.url(), DeprecatedString(location)));
             if (client)
                 client->willSendRequest(job->d->resourceHandle, newRequest, response);
-            job->d->httpHeader.setRequest(job->d->httpHeader.method(), newRequest.url().path() + newRequest.url().query());
-            job->d->setURL(QString(newRequest.url().url()));
+            job->d->request.httpHeader.setRequest(job->d->request.httpHeader.method(), newRequest.url().path() + newRequest.url().query());
+            job->d->request.setURL(QString(newRequest.url().url()));
             job->d->redirected = true;
             return;
         }
@@ -371,7 +371,7 @@ void QWebNetworkManager::data(QWebNetworkJob *job, const QByteArray &data)
     if (job->d->redirected)
         return; // don't emit the "Document has moved here" type of HTML
 
-    DEBUG() << "receivedData" << job->d->url.path();
+    DEBUG() << "receivedData" << job->d->request.url.path();
     if (client)
         client->didReceiveData(job->d->resourceHandle, data.constData(), data.length(), data.length() /*FixMe*/);
     if (job->d->connector)
@@ -406,8 +406,8 @@ void QWebNetworkManager::finished(QWebNetworkJob *job, int errorCode)
         if (errorCode) {
             //FIXME: error setting error was removed from ResourceHandle
             client->didFail(job->d->resourceHandle,
-                            ResourceError(job->d->url.host(), job->d->response.statusCode(),
-                                          job->d->url.toString(), String()));
+                            ResourceError(job->d->request.url.host(), job->d->response.statusCode(),
+                                          job->d->request.url.toString(), String()));
         } else {
             client->didFinishLoading(job->d->resourceHandle);
         }
@@ -416,7 +416,7 @@ void QWebNetworkManager::finished(QWebNetworkJob *job, int errorCode)
     if (job->d->connector)
         emit job->d->connector->finished(job, errorCode);
     
-    DEBUG() << "receivedFinished done" << job->d->url;
+    DEBUG() << "receivedFinished done" << job->d->request.url;
 
     job->deref();
 }
index 4907e74319c48dfe01a14389374f9654c34c050d..3905fc1dd1740e83698bc209ea49735c6fd36209 100644 (file)
@@ -47,7 +47,7 @@ struct QWebNetworkRequest
     void setURL(const QUrl &u);
 };
 
-class QWebNetworkJobPrivate : public QWebNetworkRequest
+class QWebNetworkJobPrivate
 {
 public:
     QWebNetworkJobPrivate()
@@ -59,6 +59,7 @@ public:
         {}
     int ref;
 
+    QWebNetworkRequest request;
     QHttpResponseHeader response;
 
     WebCore::ResourceHandle *resourceHandle;
index 4e49d316dac7f29bfa2be952d57f34fc6d15dfbf..8c5e276fa34a5526c3da2cd584587f10827c00c9 100644 (file)
@@ -57,7 +57,7 @@ QWebNetworkJob *QWebObjectPluginConnector::requestUrl(QWebNetworkJob::Method met
     p->connector = this;
 
     QString m = (method == QWebNetworkJob::Get ? "GET" : "POST");
-    p->init(m, url);
+    p->request.init(m, url);
 
     d->frame->page()->networkInterface()->addJob(job);
     return job;
index e92688bb91fafa3bf1881b4ae9785105643ba7e8..66f048629b07b4b28ee2ac32377741057eee63bc 100644 (file)
@@ -1,3 +1,18 @@
+2007-06-13  Simon Hausmann  <hausmann@kde.org>
+
+        Reviewed by Lars.
+
+        Changed QWebNetworkJobPrivate to aggregate a QWebNetworkRequest instead of inheriting from it.
+
+        * Api/qwebnetworkinterface.cpp:
+        (QWebNetworkManager::add):
+        (QWebNetworkManager::started):
+        (QWebNetworkManager::data):
+        (QWebNetworkManager::finished):
+        * Api/qwebnetworkinterface_p.h:
+        * Api/qwebobjectpluginconnector.cpp:
+        (QWebObjectPluginConnector::requestUrl):
+
 2007-06-13  Simon Hausmann  <hausmann@kde.org>
 
         Reviewed by Lars.