diff options
author | Markus Goetz <Markus.Goetz@nokia.com> | 2010-09-28 16:32:16 (GMT) |
---|---|---|
committer | Markus Goetz <Markus.Goetz@nokia.com> | 2010-09-29 09:58:34 (GMT) |
commit | cf4f2847c1a1df101e2983a0e1e8682ace323c0d (patch) | |
tree | 6a054961d4e3ca66cbad075b25309ab4468c5d63 /tests/benchmarks | |
parent | d49a7e382c69076de179103c9072e49a72db264d (diff) | |
download | Qt-cf4f2847c1a1df101e2983a0e1e8682ace323c0d.zip Qt-cf4f2847c1a1df101e2983a0e1e8682ace323c0d.tar.gz Qt-cf4f2847c1a1df101e2983a0e1e8682ace323c0d.tar.bz2 |
QNAM: More zerocopy changes
The zerocopy download buffer is now QSharedPointer<char>
instead of the QSharedPointer to QVarLengthArray<char>.
This will be a bit leaner to handle by QML and QtWebKit
and does not tie us to a QVLA that much.
Also fix some bugs related to signal emissions and the
return value of bytesAvailable(). Now the behaviour should be
the same if a zerocopy buffer is used or not.
Reviewed-by: Peter Hartmann
Reviewed-by: Thiago Macieira
Diffstat (limited to 'tests/benchmarks')
-rw-r--r-- | tests/benchmarks/network/access/qnetworkreply/tst_qnetworkreply.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/benchmarks/network/access/qnetworkreply/tst_qnetworkreply.cpp b/tests/benchmarks/network/access/qnetworkreply/tst_qnetworkreply.cpp index 0098d8e..f75d681 100644 --- a/tests/benchmarks/network/access/qnetworkreply/tst_qnetworkreply.cpp +++ b/tests/benchmarks/network/access/qnetworkreply/tst_qnetworkreply.cpp @@ -51,8 +51,7 @@ #include "../../../../auto/network-settings.h" -typedef QSharedPointer<QVarLengthArray<char, 0> > QVarLengthArraySharedPointer; -Q_DECLARE_METATYPE(QVarLengthArraySharedPointer) +Q_DECLARE_METATYPE(QSharedPointer<char>) class TimedSender: public QThread { @@ -661,6 +660,7 @@ private: bool useDownloadBuffer; QNetworkReply *reply; qint64 uploadSize; + QList<qint64> bytesAvailableList; public: HttpDownloadPerformanceClientDownloadBuffer (QNetworkReply *reply, bool useDownloadBuffer, qint64 uploadSize) : useDownloadBuffer(useDownloadBuffer), reply(reply), uploadSize(uploadSize) @@ -672,7 +672,7 @@ public: void finishedSlot() { if (useDownloadBuffer) { QVariant downloadBufferAttribute = reply->attribute(QNetworkRequest::DownloadBufferAttribute); - QSharedPointer<QVarLengthArray<char, 0> > data = downloadBufferAttribute.value<QSharedPointer<QVarLengthArray<char, 0> > >(); + QSharedPointer<char> data = downloadBufferAttribute.value<QSharedPointer<char> >(); } else { // We did not have a download buffer but we still need to benchmark having the data, e.g. reading it all. char* replyData = (char*) qMalloc(uploadSize); @@ -690,6 +690,7 @@ void tst_qnetworkreply::httpDownloadPerformanceDownloadBuffer_data() QTest::newRow("do-not-use-download-buffer") << false; } +// Please note that the whole "zero copy" download buffer API is private right now. Do not use it. void tst_qnetworkreply::httpDownloadPerformanceDownloadBuffer() { QFETCH(bool, useDownloadBuffer); |