Modified: trunk/LayoutTests/ChangeLog (130748 => 130749)
--- trunk/LayoutTests/ChangeLog 2012-10-09 11:05:27 UTC (rev 130748)
+++ trunk/LayoutTests/ChangeLog 2012-10-09 11:33:42 UTC (rev 130749)
@@ -1,3 +1,13 @@
+2012-10-09 Sheriff Bot <[email protected]>
+
+ Unreviewed, rolling out r130746.
+ http://trac.webkit.org/changeset/130746
+ https://bugs.webkit.org/show_bug.cgi?id=98749
+
+ It made 45 tests crash on Qt (Requested by Ossy on #webkit).
+
+ * platform/qt/TestExpectations:
+
2012-10-09 Raphael Kubo da Costa <[email protected]>
[EFL] Mark a few tests skipped in r130745 as failures instead of timeouts.
Modified: trunk/LayoutTests/platform/qt/TestExpectations (130748 => 130749)
--- trunk/LayoutTests/platform/qt/TestExpectations 2012-10-09 11:05:27 UTC (rev 130748)
+++ trunk/LayoutTests/platform/qt/TestExpectations 2012-10-09 11:33:42 UTC (rev 130749)
@@ -588,6 +588,7 @@
fast/forms/file/input-file-write-files.html
fast/forms/file/selected-files-from-history-state.html
http/tests/local/blob/send-hybrid-blob.html
+http/tests/local/blob/send-sliced-data-blob.html
http/tests/local/formdata
http/tests/security/clipboard/clipboard-file-access.html
@@ -721,6 +722,9 @@
http/tests/security/401-logout/401-logout.php
http/tests/xmlhttprequest/remember-bad-password.html
+# BlodBuilder is not enabled
+http/tests/local/blob/send-data-blob.html
+
# new test introduced in r94828, but fails on Qt.
# https://bugs.webkit.org/show_bug.cgi?id=66588
http/tests/security/xssAuditor/script-tag-with-16bit-unicode4.html
Modified: trunk/Source/WebCore/ChangeLog (130748 => 130749)
--- trunk/Source/WebCore/ChangeLog 2012-10-09 11:05:27 UTC (rev 130748)
+++ trunk/Source/WebCore/ChangeLog 2012-10-09 11:33:42 UTC (rev 130749)
@@ -1,3 +1,23 @@
+2012-10-09 Sheriff Bot <[email protected]>
+
+ Unreviewed, rolling out r130746.
+ http://trac.webkit.org/changeset/130746
+ https://bugs.webkit.org/show_bug.cgi?id=98749
+
+ It made 45 tests crash on Qt (Requested by Ossy on #webkit).
+
+ * platform/network/qt/QNetworkReplyHandler.cpp:
+ (WebCore::FormDataIODevice::FormDataIODevice):
+ (WebCore::FormDataIODevice::computeSize):
+ (WebCore::FormDataIODevice::moveToNextElement):
+ (WebCore::FormDataIODevice::openFileForCurrentElement):
+ (WebCore::FormDataIODevice::readData):
+ (WebCore::QNetworkReplyHandler::getIODevice):
+ (WebCore::QNetworkReplyHandler::sendNetworkRequest):
+ * platform/network/qt/QNetworkReplyHandler.h:
+ (QNetworkReplyHandler):
+ (FormDataIODevice):
+
2012-10-09 Allan Sandfeld Jensen <[email protected]>
[Qt] Uploading images to Google+ using QtWebKit does not work.
Modified: trunk/Source/WebCore/platform/network/qt/QNetworkReplyHandler.cpp (130748 => 130749)
--- trunk/Source/WebCore/platform/network/qt/QNetworkReplyHandler.cpp 2012-10-09 11:05:27 UTC (rev 130748)
+++ trunk/Source/WebCore/platform/network/qt/QNetworkReplyHandler.cpp 2012-10-09 11:33:42 UTC (rev 130749)
@@ -1,8 +1,7 @@
/*
- Copyright (C) 2008, 2012 Digia Plc. and/or its subsidiary(-ies)
+ Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
Copyright (C) 2007 Staikos Computing Services Inc. <[email protected]>
Copyright (C) 2008 Holger Hans Peter Freyther
- Copyright (C) 2012 Apple Inc. All rights reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
@@ -22,7 +21,6 @@
#include "config.h"
#include "QNetworkReplyHandler.h"
-#include "BlobRegistryImpl.h"
#include "HTTPParsers.h"
#include "MIMETypeRegistry.h"
#include "ResourceHandle.h"
@@ -39,7 +37,12 @@
#include <wtf/text/CString.h>
#include <QCoreApplication>
+#include <QDebug>
+// In Qt 4.8, the attribute for sending a request synchronously will be made public,
+// for now, use this hackish solution for setting the internal attribute.
+const QNetworkRequest::Attribute gSynchronousNetworkRequestAttribute = static_cast<QNetworkRequest::Attribute>(QNetworkRequest::HttpPipeliningWasUsedAttribute + 7);
+
static const int gMaxRedirections = 10;
namespace WebCore {
@@ -54,7 +57,8 @@
{
setOpenMode(FormDataIODevice::ReadOnly);
- prepareCurrentElement();
+ if (!m_formElements.isEmpty() && m_formElements[0].m_type == FormDataElement::encodedFile)
+ openFileForCurrentElement();
computeSize();
}
@@ -71,14 +75,7 @@
m_dataSize += element.m_data.size();
else {
QFileInfo fi(element.m_filename);
-#if ENABLE(BLOB)
- qint64 fileEnd = fi.size();
- if (element.m_fileLength != BlobDataItem::toEndOfFile)
- fileEnd = qMin<qint64>(fi.size(), element.m_fileStart + element.m_fileLength);
- m_fileSize += qMax<qint64>(0, fileEnd - element.m_fileStart);
-#else
m_fileSize += fi.size();
-#endif
}
}
return m_dataSize + m_fileSize;
@@ -92,24 +89,10 @@
m_formElements.remove(0);
- prepareCurrentElement();
-}
-
-void FormDataIODevice::prepareCurrentElement()
-{
- if (m_formElements.isEmpty())
+ if (m_formElements.isEmpty() || m_formElements[0].m_type == FormDataElement::data)
return;
- switch (m_formElements[0].m_type) {
- case FormDataElement::data:
- return;
- case FormDataElement::encodedFile:
- openFileForCurrentElement();
- break;
- default:
- // At this point encodedBlob should already have been handled.
- ASSERT_NOT_REACHED();
- }
+ openFileForCurrentElement();
}
void FormDataIODevice::openFileForCurrentElement()
@@ -119,17 +102,6 @@
m_currentFile->setFileName(m_formElements[0].m_filename);
m_currentFile->open(QFile::ReadOnly);
-#if ENABLE(BLOB)
- if (isValidFileTime(m_formElements[0].m_expectedFileModificationTime)) {
- QFileInfo info(*m_currentFile);
- if (!info.exists() || static_cast<time_t>(m_formElements[0].m_expectedFileModificationTime) < info.lastModified().toTime_t()) {
- moveToNextElement();
- return;
- }
- }
- if (m_formElements[0].m_fileStart)
- m_currentFile->seek(m_formElements[0].m_fileStart);
-#endif
}
// m_formElements[0] is the current item. If the destination buffer is
@@ -152,23 +124,13 @@
if (m_currentDelta == element.m_data.size())
moveToNextElement();
- } else if (element.m_type == FormDataElement::encodedFile) {
- quint64 toCopy = available;
-#if ENABLE(BLOB)
- if (element.m_fileLength != BlobDataItem::toEndOfFile)
- toCopy = qMin<qint64>(toCopy, element.m_fileLength - m_currentDelta);
-#endif
- const QByteArray data = ""
+ } else {
+ const QByteArray data = ""
memcpy(destination+copied, data.constData(), data.size());
- m_currentDelta += data.size();
copied += data.size();
if (m_currentFile->atEnd() || !m_currentFile->isOpen())
moveToNextElement();
-#if ENABLE(BLOB)
- else if (element.m_fileLength != BlobDataItem::toEndOfFile && m_currentDelta == element.m_fileLength)
- moveToNextElement();
-#endif
}
}
@@ -640,69 +602,17 @@
FormDataIODevice* QNetworkReplyHandler::getIODevice(const ResourceRequest& request)
{
- RefPtr<FormData> formData = handleBlobDataIfAny(request.httpBody());
- FormDataIODevice* device = new FormDataIODevice(formData.get());
+ FormDataIODevice* device = new FormDataIODevice(request.httpBody());
// We may be uploading files so prevent QNR from buffering data.
m_request.setHeader(QNetworkRequest::ContentLengthHeader, device->getFormDataSize());
m_request.setAttribute(QNetworkRequest::DoNotBufferUploadDataAttribute, QVariant(true));
return device;
}
-PassRefPtr<FormData> QNetworkReplyHandler::handleBlobDataIfAny(FormData* formDataPtr)
-{
- RefPtr<FormData> formData(formDataPtr);
-
-#if ENABLE(BLOB)
- // Check if there is a blob in the form data.
- bool hasBlob = false;
-
- Vector<FormDataElement>::const_iterator it = formData->elements().begin();
- const Vector<FormDataElement>::const_iterator itend = formData->elements().end();
- for (; it != itend; ++it) {
- if (it->m_type == FormDataElement::encodedBlob) {
- hasBlob = true;
- break;
- }
- }
-
- // If yes, we have to resolve all the blob references and regenerate the form data with only data and file types.
- if (hasBlob) {
- RefPtr<FormData> newFormData = FormData::create();
- newFormData->setAlwaysStream(formData->alwaysStream());
- newFormData->setIdentifier(formData->identifier());
- it = formData->elements().begin();
- for (; it != itend; ++it) {
- const FormDataElement& element = *it;
- if (element.m_type == FormDataElement::data)
- newFormData->appendData(element.m_data.data(), element.m_data.size());
- else if (element.m_type == FormDataElement::encodedFile)
- newFormData->appendFile(element.m_filename, element.m_shouldGenerateFile);
- else if (element.m_type == FormDataElement::encodedBlob) {
- RefPtr<BlobStorageData> blobData = static_cast<BlobRegistryImpl&>(blobRegistry()).getBlobDataFromURL(KURL(ParsedURLString, element.m_url));
- if (blobData) {
- for (size_t j = 0; j < blobData->items().size(); ++j) {
- const BlobDataItem& blobItem = blobData->items()[j];
- if (blobItem.type == BlobDataItem::Data)
- newFormData->appendData(blobItem.data->data() + static_cast<int>(blobItem.offset), static_cast<int>(blobItem.length));
- else if (blobItem.type == BlobDataItem::File)
- newFormData->appendFileRange(blobItem.path, blobItem.offset, blobItem.length, blobItem.expectedModificationTime);
- else
- ASSERT_NOT_REACHED();
- }
- }
- } else
- ASSERT_NOT_REACHED();
- }
- formData = newFormData;
- }
-#endif
- return formData.release();
-}
-
QNetworkReply* QNetworkReplyHandler::sendNetworkRequest(QNetworkAccessManager* manager, const ResourceRequest& request)
{
if (m_loadType == SynchronousLoad)
- m_request.setAttribute(QNetworkRequest::SynchronousRequestAttribute, true);
+ m_request.setAttribute(gSynchronousNetworkRequestAttribute, true);
if (!manager)
return 0;
Modified: trunk/Source/WebCore/platform/network/qt/QNetworkReplyHandler.h (130748 => 130749)
--- trunk/Source/WebCore/platform/network/qt/QNetworkReplyHandler.h 2012-10-09 11:05:27 UTC (rev 130748)
+++ trunk/Source/WebCore/platform/network/qt/QNetworkReplyHandler.h 2012-10-09 11:33:42 UTC (rev 130749)
@@ -27,7 +27,6 @@
#include "FormData.h"
#include "QtMIMETypeSniffer.h"
-#include <wtf/PassRefPtr.h>
QT_BEGIN_NAMESPACE
class QFile;
@@ -147,7 +146,6 @@
bool wasAborted() const { return !m_resourceHandle; }
QNetworkReply* sendNetworkRequest(QNetworkAccessManager*, const ResourceRequest&);
FormDataIODevice* getIODevice(const ResourceRequest&);
- PassRefPtr<FormData> handleBlobDataIfAny(FormData*);
void clearContentHeaders();
OwnPtr<QNetworkReplyWrapper> m_replyWrapper;
@@ -184,7 +182,6 @@
void moveToNextElement();
qint64 computeSize();
void openFileForCurrentElement();
- void prepareCurrentElement();
private:
Vector<FormDataElement> m_formElements;