[Qt][WK2] Use QVariant for payload data in application URL schemes.
authorzeno.albisser@nokia.com <zeno.albisser@nokia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 26 Jan 2012 12:28:03 +0000 (12:28 +0000)
committerzeno.albisser@nokia.com <zeno.albisser@nokia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 26 Jan 2012 12:28:03 +0000 (12:28 +0000)
https://bugs.webkit.org/show_bug.cgi?id=77007

Make application schemes use QVariant for payload data.
This allows passing QByteArrays as well as simple String data.

Remove unneeded http header parts that were exposed in
QQuickNetworkReply.

Add ByteArrayTestData class to allow injecting QByteArray
data into an application scheme handler for testing.

Reviewed by Simon Hausmann.

* Shared/qt/QtNetworkReplyData.cpp:
(WebKit::QtNetworkReplyData::QtNetworkReplyData):
(WebKit::QtNetworkReplyData::encode):
(WebKit::QtNetworkReplyData::decode):
* Shared/qt/QtNetworkReplyData.h:
* UIProcess/API/qt/qquicknetworkreply.cpp:
(QQuickNetworkReply::QQuickNetworkReply):
(QQuickNetworkReply::data):
(QQuickNetworkReply::setData):
(QQuickNetworkReply::send):
* UIProcess/API/qt/qquicknetworkreply_p.h:
* UIProcess/API/qt/tests/bytearraytestdata.cpp: Added.
(ByteArrayTestData::ByteArrayTestData):
(ByteArrayTestData::latin1Data):
(ByteArrayTestData::utf8Data):
* UIProcess/API/qt/tests/bytearraytestdata.h: Added.
* UIProcess/API/qt/tests/qmltests/WebView/tst_applicationScheme.qml:
* UIProcess/API/qt/tests/qmltests/tst_qmltests.cpp:
(main):
* UIProcess/API/qt/tests/tests.pri:
* WebProcess/qt/QtNetworkReply.cpp:
(WebKit::QtNetworkReply::setReplyData):
* WebProcess/qt/QtNetworkReply.h:

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

12 files changed:
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/qt/QtNetworkReplyData.cpp
Source/WebKit2/Shared/qt/QtNetworkReplyData.h
Source/WebKit2/UIProcess/API/qt/qquicknetworkreply.cpp
Source/WebKit2/UIProcess/API/qt/qquicknetworkreply_p.h
Source/WebKit2/UIProcess/API/qt/tests/bytearraytestdata.cpp [new file with mode: 0644]
Source/WebKit2/UIProcess/API/qt/tests/bytearraytestdata.h [new file with mode: 0644]
Source/WebKit2/UIProcess/API/qt/tests/qmltests/WebView/tst_applicationScheme.qml
Source/WebKit2/UIProcess/API/qt/tests/qmltests/tst_qmltests.cpp
Source/WebKit2/UIProcess/API/qt/tests/tests.pri
Source/WebKit2/WebProcess/qt/QtNetworkReply.cpp
Source/WebKit2/WebProcess/qt/QtNetworkReply.h

index 93cc396..5c4c170 100644 (file)
@@ -1,3 +1,43 @@
+2012-01-26  Zeno Albisser  <zeno@webkit.org>
+
+        [Qt][WK2] Use QVariant for payload data in application URL schemes.
+        https://bugs.webkit.org/show_bug.cgi?id=77007
+
+        Make application schemes use QVariant for payload data.
+        This allows passing QByteArrays as well as simple String data.
+
+        Remove unneeded http header parts that were exposed in
+        QQuickNetworkReply.
+
+        Add ByteArrayTestData class to allow injecting QByteArray
+        data into an application scheme handler for testing.
+
+        Reviewed by Simon Hausmann.
+
+        * Shared/qt/QtNetworkReplyData.cpp:
+        (WebKit::QtNetworkReplyData::QtNetworkReplyData):
+        (WebKit::QtNetworkReplyData::encode):
+        (WebKit::QtNetworkReplyData::decode):
+        * Shared/qt/QtNetworkReplyData.h:
+        * UIProcess/API/qt/qquicknetworkreply.cpp:
+        (QQuickNetworkReply::QQuickNetworkReply):
+        (QQuickNetworkReply::data):
+        (QQuickNetworkReply::setData):
+        (QQuickNetworkReply::send):
+        * UIProcess/API/qt/qquicknetworkreply_p.h:
+        * UIProcess/API/qt/tests/bytearraytestdata.cpp: Added.
+        (ByteArrayTestData::ByteArrayTestData):
+        (ByteArrayTestData::latin1Data):
+        (ByteArrayTestData::utf8Data):
+        * UIProcess/API/qt/tests/bytearraytestdata.h: Added.
+        * UIProcess/API/qt/tests/qmltests/WebView/tst_applicationScheme.qml:
+        * UIProcess/API/qt/tests/qmltests/tst_qmltests.cpp:
+        (main):
+        * UIProcess/API/qt/tests/tests.pri:
+        * WebProcess/qt/QtNetworkReply.cpp:
+        (WebKit::QtNetworkReply::setReplyData):
+        * WebProcess/qt/QtNetworkReply.h:
+
 2012-01-26  Thiago Marcos P. Santos  <tmpsantos@gmail.com>
 
         [Qt] Fixed build when using force_static_libs_as_shared
index 62e5807..abc43b1 100644 (file)
@@ -39,21 +39,13 @@ namespace WebKit {
 
 QtNetworkReplyData::QtNetworkReplyData()
     : m_contentLength(0)
-    , m_lastModified(0)
 { }
 
 void QtNetworkReplyData::encode(CoreIPC::ArgumentEncoder* encoder) const
 {
     encoder->encode(m_urlString);
-    encoder->encodeEnum(m_operation);
-    encoder->encode(m_contentDisposition);
     encoder->encode(m_contentType);
     encoder->encodeUInt64(m_contentLength);
-    encoder->encode(m_location);
-    encoder->encodeUInt64(m_lastModified);
-    encoder->encode(m_cookie);
-    encoder->encode(m_userAgent);
-    encoder->encode(m_server);
     encoder->encode(m_replyUuid);
     encoder->encode(m_dataHandle);
 }
@@ -62,24 +54,10 @@ bool QtNetworkReplyData::decode(CoreIPC::ArgumentDecoder* decoder, QtNetworkRepl
 {
     if (!decoder->decode(destination.m_urlString))
         return false;
-    if (!decoder->decodeEnum(destination.m_operation))
-        return false;
-    if (!decoder->decode(destination.m_contentDisposition))
-        return false;
     if (!decoder->decode(destination.m_contentType))
         return false;
     if (!decoder->decodeUInt64(destination.m_contentLength))
         return false;
-    if (!decoder->decode(destination.m_location))
-        return false;
-    if (!decoder->decodeUInt64(destination.m_lastModified))
-        return false;
-    if (!decoder->decode(destination.m_cookie))
-        return false;
-    if (!decoder->decode(destination.m_userAgent))
-        return false;
-    if (!decoder->decode(destination.m_server))
-        return false;
     if (!decoder->decode(destination.m_replyUuid))
         return false;
     if (!decoder->decode(destination.m_dataHandle))
index c39a48f..d1565be 100644 (file)
@@ -47,15 +47,8 @@ struct QtNetworkReplyData {
 
     WTF::String m_urlString;
 
-    QNetworkAccessManager::Operation m_operation;
-    WTF::String m_contentDisposition;
     WTF::String m_contentType;
     uint64_t m_contentLength;
-    WTF::String m_location;
-    uint64_t m_lastModified;
-    WTF::String m_cookie;
-    WTF::String m_userAgent;
-    WTF::String m_server;
     String m_replyUuid;
 
     SharedMemory::Handle m_dataHandle;
index c69486c..4bea69c 100644 (file)
@@ -31,7 +31,6 @@ using namespace WebKit;
 QQuickNetworkReply::QQuickNetworkReply(QObject* parent)
     : QObject(parent)
     , m_networkReplyData(adoptRef(new WebKit::QtRefCountedNetworkReplyData))
-    , m_dataLength(0)
 {
     Q_ASSERT(parent);
 }
@@ -46,118 +45,54 @@ void QQuickNetworkReply::setContentType(const QString& contentType)
     m_networkReplyData->data().m_contentType = contentType;
 }
 
-QNetworkAccessManager::Operation QQuickNetworkReply::operation() const
+QVariant QQuickNetworkReply::data() const
 {
-    return m_networkReplyData->data().m_operation;
+    return m_data;
 }
 
-void QQuickNetworkReply::setOperation(QNetworkAccessManager::Operation operation)
+void QQuickNetworkReply::setData(const QVariant& data)
 {
-    m_networkReplyData->data().m_operation = operation;
+    m_data = data;
 }
 
-QString QQuickNetworkReply::contentDisposition() const
-{
-    return m_networkReplyData->data().m_contentDisposition;
-}
-
-void QQuickNetworkReply::setContentDisposition(const QString& disposition)
-{
-    m_networkReplyData->data().m_contentDisposition = disposition;
-}
-
-QString QQuickNetworkReply::location() const
-{
-    return m_networkReplyData->data().m_location;
-}
-
-void QQuickNetworkReply::setLocation(const QString& location)
-{
-    m_networkReplyData->data().m_location = location;
-}
-
-QString QQuickNetworkReply::lastModified() const
-{
-    return QDateTime::fromMSecsSinceEpoch(m_networkReplyData->data().m_lastModified).toString(Qt::ISODate);
-}
-
-void QQuickNetworkReply::setLastModified(const QString& lastModified)
-{
-    m_networkReplyData->data().m_lastModified = QDateTime::fromString(lastModified, Qt::ISODate).toMSecsSinceEpoch();
-}
-
-QString QQuickNetworkReply::cookie() const
-{
-    return m_networkReplyData->data().m_cookie;
-}
-
-void QQuickNetworkReply::setCookie(const QString& cookie)
-{
-    m_networkReplyData->data().m_cookie = cookie;
-}
-
-QString QQuickNetworkReply::userAgent() const
-{
-    return m_networkReplyData->data().m_userAgent;
-}
-
-void QQuickNetworkReply::setUserAgent(const QString& userAgent)
-{
-    m_networkReplyData->data().m_userAgent = userAgent;
-}
-
-QString QQuickNetworkReply::server() const
-{
-    return m_networkReplyData->data().m_server;
-}
-
-void QQuickNetworkReply::setServer(const QString& server)
-{
-    m_networkReplyData->data().m_server = server;
-}
-
-QString QQuickNetworkReply::data() const
-{
-    if (!m_sharedMemory)
-        return QString();
-
-    uint64_t stringLength = m_dataLength / sizeof(QChar);
-    return QString(reinterpret_cast<const QChar*>(m_sharedMemory->data()), stringLength);
-}
-
-void QQuickNetworkReply::setData(const QString& data)
+void QQuickNetworkReply::send()
 {
-    // This function can be called several times. In this case the previously allocated SharedMemory
-    // will be released automatically and new memory will be allocated.
-    m_dataLength = 0;
-
-    if (data.isNull())
+    if (m_data.isNull())
         return;
 
-    uint64_t smLength = sizeof(QChar) * data.length();
-    m_sharedMemory = SharedMemory::create(smLength);
-    if (!m_sharedMemory)
+    uint64_t smLength = 0;
+    const void* ptrData = 0;
+    QString stringData;
+    QByteArray byteArrayData;
+    if (m_data.type() == QVariant::String) {
+        stringData = m_data.toString();
+        ptrData = reinterpret_cast<const void*>(stringData.constData());
+        smLength = sizeof(QChar) * stringData.length();
+    } else {
+        if (!m_data.canConvert<QByteArray>())
+            return;
+        byteArrayData = m_data.toByteArray();
+        ptrData = byteArrayData.data();
+        smLength = byteArrayData.size();
+    }
+
+    WTF::RefPtr<WebKit::SharedMemory> sharedMemory = SharedMemory::create(smLength);
+    if (!sharedMemory)
         return;
-
     // The size of the allocated shared memory can be bigger than requested.
     // Usually the size will be rounded up to the next multiple of a page size.
-    memcpy(m_sharedMemory->data(), data.constData(), smLength);
-    m_dataLength = smLength;
-}
-
-void QQuickNetworkReply::send()
-{
-    if (!m_sharedMemory || !m_sharedMemory->createHandle(m_networkReplyData->data().m_dataHandle, SharedMemory::ReadOnly))
-        return;
-    m_networkReplyData->data().m_contentLength = m_dataLength;
-
-    QObject* schemeParent = parent()->parent();
-    if (!schemeParent)
-        return;
-    QQuickWebViewExperimental* webViewExperimental = qobject_cast<QQuickWebViewExperimental*>(schemeParent->parent());
-    if (!webViewExperimental)
-        return;
-    webViewExperimental->sendApplicationSchemeReply(this);
+    memcpy(sharedMemory->data(), ptrData, smLength);
+
+    if (sharedMemory->createHandle(m_networkReplyData->data().m_dataHandle, SharedMemory::ReadOnly)) {
+        m_networkReplyData->data().m_contentLength = smLength;
+
+        QObject* schemeParent = parent()->parent();
+        if (schemeParent) {
+            QQuickWebViewExperimental* webViewExperimental = qobject_cast<QQuickWebViewExperimental*>(schemeParent->parent());
+            if (webViewExperimental)
+                webViewExperimental->sendApplicationSchemeReply(this);
+        }
+    }
 
     // After sending the reply data, we have to reinitialize the m_networkReplyData,
     // to make sure we have a fresh SharesMemory::Handle.
index 59eb7f2..713f4e6 100644 (file)
 class QWEBKIT_EXPORT QQuickNetworkReply : public QObject {
     Q_OBJECT
     Q_PROPERTY(QString contentType READ contentType WRITE setContentType)
-    Q_PROPERTY(QString data READ data WRITE setData)
+    Q_PROPERTY(QVariant data READ data WRITE setData)
     Q_ENUMS(QNetworkAccessManager::Operation)
 
 public:
     QQuickNetworkReply(QObject* parent);
     QString contentType() const;
     void setContentType(const QString&);
-    QNetworkAccessManager::Operation operation() const;
-    void setOperation(QNetworkAccessManager::Operation);
-    QString contentDisposition() const;
-    void setContentDisposition(const QString&);
-    QString location() const;
-    void setLocation(const QString&);
-    QString lastModified() const;
-    void setLastModified(const QString&);
-    QString cookie() const;
-    void setCookie(const QString&);
-    QString userAgent() const;
-    void setUserAgent(const QString&);
-    QString server() const;
-    void setServer(const QString&);
 
-    QString data() const;
-    void setData(const QString& data);
+    QVariant data() const;
+    void setData(const QVariant& data);
 
     WebKit::QtRefCountedNetworkRequestData* networkRequestData() const;
     void setNetworkRequestData(WTF::PassRefPtr<WebKit::QtRefCountedNetworkRequestData> data);
@@ -68,8 +54,7 @@ public Q_SLOTS:
 private:
     WTF::RefPtr<WebKit::QtRefCountedNetworkRequestData> m_networkRequestData;
     WTF::RefPtr<WebKit::QtRefCountedNetworkReplyData> m_networkReplyData;
-    WTF::RefPtr<WebKit::SharedMemory> m_sharedMemory;
-    uint64_t m_dataLength;
+    QVariant m_data;
 };
 
 QML_DECLARE_TYPE(QQuickNetworkReply)
diff --git a/Source/WebKit2/UIProcess/API/qt/tests/bytearraytestdata.cpp b/Source/WebKit2/UIProcess/API/qt/tests/bytearraytestdata.cpp
new file mode 100644 (file)
index 0000000..e0c2c25
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies)
+ *
+ * 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 "bytearraytestdata.h"
+
+ByteArrayTestData::ByteArrayTestData(QObject* parent)
+    : QObject(parent)
+{
+    QString text = QStringLiteral("<html><head><title>title with copyright %1</title></head><body>content</body></html>");
+    text = text.arg(QChar::fromLatin1(169));
+
+    m_latin1Data = text.toLatin1();
+    m_utf8Data = text.toUtf8();
+
+    Q_ASSERT(m_latin1Data != m_utf8Data);
+}
+
+QVariant ByteArrayTestData::latin1Data() const
+{
+    return QVariant(m_latin1Data);
+}
+
+QVariant ByteArrayTestData::utf8Data() const
+{
+    return QVariant(m_utf8Data);
+}
+
+#include "moc_bytearraytestdata.cpp"
diff --git a/Source/WebKit2/UIProcess/API/qt/tests/bytearraytestdata.h b/Source/WebKit2/UIProcess/API/qt/tests/bytearraytestdata.h
new file mode 100644 (file)
index 0000000..7170f65
--- /dev/null
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies)
+ *
+ * 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 bytearraytestdata_h
+#define bytearraytestdata_h
+
+#include "qwebkitglobal.h"
+#include <QByteArray>
+#include <QObject>
+#include <QtQuick/qquickitem.h>
+
+class QWEBKIT_EXPORT ByteArrayTestData : public QObject {
+    Q_OBJECT
+    Q_PROPERTY(QVariant latin1Data READ latin1Data)
+    Q_PROPERTY(QVariant utf8Data READ utf8Data)
+
+public:
+    ByteArrayTestData(QObject* parent = 0);
+    QVariant latin1Data() const;
+    QVariant utf8Data() const;
+
+private:
+    QByteArray m_latin1Data;
+    QByteArray m_utf8Data;
+};
+
+QML_DECLARE_TYPE(ByteArrayTestData)
+
+#endif // bytearraytestdata_h
index 095ab30..239483c 100644 (file)
@@ -2,6 +2,7 @@ import QtQuick 2.0
 import QtTest 1.0
 import QtWebKit 3.0
 import QtWebKit.experimental 3.0
+import Test 1.0
 
 WebView {
     id: webView
@@ -42,7 +43,21 @@ WebView {
                         reply.data = "<html><head><title>Should not happen</title></head><body>A test page.</body></html>"
                     reply.send()
                 }
+            },
+            UrlSchemeDelegate {
+                scheme: "schemeCharset"
+                onReceivedRequest: {
+                    if (request.url == "schemecharset://latin1") {
+                        reply.data = byteArrayHelper.latin1Data
+                        reply.contentType = "text/html; charset=iso-8859-1"
+                    } else if (request.url == "schemecharset://utf-8") {
+                        reply.data = byteArrayHelper.utf8Data
+                        reply.contentType = "text/html; charset=utf-8"
+                    }
+                    reply.send()
+                }
             }
+
         ]
     }
 
@@ -52,6 +67,10 @@ WebView {
         signalName: "titleChanged"
     }
 
+    ByteArrayTestData {
+        id: byteArrayHelper
+    }
+
     TestCase {
         name: "WebViewApplicationSchemes"
 
@@ -96,5 +115,19 @@ WebView {
 
             compare(spyTitle.count, 2)
         }
+
+        function test_charsets() {
+            spyTitle.clear()
+            compare(spyTitle.count, 0)
+            var testUrl = "schemeCharset://latin1"
+            webView.load(testUrl)
+            spyTitle.wait()
+            compare(webView.title, "title with copyright ©")
+
+            testUrl = "schemeCharset://utf-8"
+            webView.load(testUrl)
+            spyTitle.wait()
+            compare(webView.title, "title with copyright ©")
+        }
     }
 }
index e8d9aab..8c8c4b3 100644 (file)
@@ -17,6 +17,7 @@
     Boston, MA 02110-1301, USA.
 */
 
+#include "../bytearraytestdata.h"
 #include "../util.h"
 
 #include <QVarLengthArray>
@@ -41,5 +42,6 @@ int main(int argc, char** argv)
     // Instantiate QApplication to prevent quick_test_main to instantiate a QGuiApplication.
     // This can be removed as soon as we do not use QtWidgets any more.
     QApplication app(argc, argv);
+    qmlRegisterType<ByteArrayTestData>("Test", 1, 0, "ByteArrayTestData");
     return quick_test_main(argc, argv, "qmltests", 0, QUICK_TEST_SOURCE_DIR);
 }
index 71e8716..06ff1a0 100644 (file)
@@ -3,8 +3,11 @@ TEMPLATE = app
 VPATH += $$_PRO_FILE_PWD_
 TARGET = tst_$$TARGET
 
+HEADERS += ../bytearraytestdata.h
+
 SOURCES += $${TARGET}.cpp \
-           ../util.cpp
+           ../util.cpp \
+           ../bytearraytestdata.cpp
 INCLUDEPATH += $$PWD
 
 QT += testlib declarative widgets quick
index 9904110..c71f13f 100644 (file)
@@ -62,22 +62,8 @@ void QtNetworkReply::setData(const SharedMemory::Handle& handle, qint64 dataSize
 
 void QtNetworkReply::setReplyData(const QtNetworkReplyData& replyData)
 {
-    if (replyData.m_operation)
-        setOperation(replyData.m_operation);
-    if (!replyData.m_contentDisposition.isNull())
-        setHeader(QNetworkRequest::ContentDispositionHeader, QString(replyData.m_contentDisposition));
     if (!replyData.m_contentType.isNull())
         setHeader(QNetworkRequest::ContentTypeHeader, QString(replyData.m_contentType));
-    if (!replyData.m_location.isNull())
-        setHeader(QNetworkRequest::LocationHeader, QString(replyData.m_location));
-    if (replyData.m_lastModified)
-        setHeader(QNetworkRequest::LastModifiedHeader, QDateTime::fromMSecsSinceEpoch(replyData.m_lastModified));
-    if (!replyData.m_cookie.isNull())
-        setHeader(QNetworkRequest::SetCookieHeader, QVariant::fromValue(QNetworkCookie::parseCookies(QString(replyData.m_cookie).toAscii())));
-    if (!replyData.m_userAgent.isNull())
-        setHeader(QNetworkRequest::UserAgentHeader, QString(replyData.m_userAgent));
-    if (!replyData.m_server.isNull())
-        setHeader(QNetworkRequest::ServerHeader, QString(replyData.m_server));
     setHeader(QNetworkRequest::ContentLengthHeader, QVariant::fromValue(replyData.m_contentLength));
     setData(replyData.m_dataHandle, replyData.m_contentLength);
 }
@@ -100,11 +86,6 @@ qint64 QtNetworkReply::bytesAvailable() const
     return m_bytesAvailable + QNetworkReply::bytesAvailable();
 }
 
-void QtNetworkReply::setHeader(QNetworkRequest::KnownHeaders header, const QVariant &value)
-{
-    QNetworkReply::setHeader(header, value);
-}
-
 void QtNetworkReply::abort() { }
 void QtNetworkReply::close() { }
 void QtNetworkReply::setReadBufferSize(qint64 size) { }
index 8ceb792..d32c821 100644 (file)
@@ -42,12 +42,12 @@ public:
 
     virtual qint64 readData(char *data, qint64 maxlen);
     virtual qint64 bytesAvailable() const;
-    void setHeader(QNetworkRequest::KnownHeaders, const QVariant &value);
-    void setData(const SharedMemory::Handle&, qint64 dataSize);
     void setReplyData(const QtNetworkReplyData&);
     void finalize();
 
 protected:
+    void setData(const SharedMemory::Handle&, qint64 dataSize);
+
     virtual void abort();
     virtual void close();
     virtual void setReadBufferSize(qint64);
@@ -55,7 +55,6 @@ protected:
 
 private:
     qint64 m_bytesAvailable;
-    QByteArray m_buffer;
     RefPtr<SharedMemory> m_sharedMemory;
     qint64 m_sharedMemorySize;
 };