Title: [129692] trunk
Revision
129692
Author
commit-qu...@webkit.org
Date
2012-09-26 13:10:16 -0700 (Wed, 26 Sep 2012)

Log Message

[Qt] load event fires on XMLHttpRequestUpload twice with Qt5
https://bugs.webkit.org/show_bug.cgi?id=92669

Patch by Marcelo Lira <marcelo.l...@openbossa.org> on 2012-09-26
Reviewed by Kenneth Rohde Christiansen.

When finishing, after the upload have already been done, Qt5's
QNetworkReply emits an uploadProgress signal with total bytes set to
zero. Since 0 of 0 bytes doesn't make any sense as progress, a
conditional was added to QNetworkReplyHandler::uploadProgress to make
do nothing with such values.

Unskip XMLHttpRequestUpload tests.

Source/WebCore:

* platform/network/qt/QNetworkReplyHandler.cpp:
(WebCore::QNetworkReplyHandler::uploadProgress):

LayoutTests:

* platform/qt-5.0/Skipped:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (129691 => 129692)


--- trunk/LayoutTests/ChangeLog	2012-09-26 20:08:06 UTC (rev 129691)
+++ trunk/LayoutTests/ChangeLog	2012-09-26 20:10:16 UTC (rev 129692)
@@ -1,3 +1,20 @@
+2012-09-26  Marcelo Lira  <marcelo.l...@openbossa.org>
+
+        [Qt] load event fires on XMLHttpRequestUpload twice with Qt5
+        https://bugs.webkit.org/show_bug.cgi?id=92669
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        When finishing, after the upload have already been done, Qt5's
+        QNetworkReply emits an uploadProgress signal with total bytes set to
+        zero. Since 0 of 0 bytes doesn't make any sense as progress, a
+        conditional was added to QNetworkReplyHandler::uploadProgress to make
+        do nothing with such values.
+
+        Unskip XMLHttpRequestUpload tests.
+
+        * platform/qt-5.0/Skipped:
+
 2012-09-26  Filip Pizlo  <fpi...@apple.com>
 
         JSObject::ensureArrayStorage() ignores the possibility that extensions have been prevented

Modified: trunk/LayoutTests/platform/qt-5.0/Skipped (129691 => 129692)


--- trunk/LayoutTests/platform/qt-5.0/Skipped	2012-09-26 20:08:06 UTC (rev 129691)
+++ trunk/LayoutTests/platform/qt-5.0/Skipped	2012-09-26 20:10:16 UTC (rev 129692)
@@ -1,8 +1,3 @@
-# [Qt] load event fires on XMLHttpRequestUpload twice with Qt5
-# https://bugs.webkit.org/show_bug.cgi?id=92669
-http/tests/xmlhttprequest/upload-onprogress-event.html
-http/tests/xmlhttprequest/upload-progress-events.html
-
 # timeout
 fast/events/bogus-dropEffect-effectAllowed.html
 fast/forms/textfield-drag-into-disabled.html

Modified: trunk/Source/WebCore/ChangeLog (129691 => 129692)


--- trunk/Source/WebCore/ChangeLog	2012-09-26 20:08:06 UTC (rev 129691)
+++ trunk/Source/WebCore/ChangeLog	2012-09-26 20:10:16 UTC (rev 129692)
@@ -1,3 +1,21 @@
+2012-09-26  Marcelo Lira  <marcelo.l...@openbossa.org>
+
+        [Qt] load event fires on XMLHttpRequestUpload twice with Qt5
+        https://bugs.webkit.org/show_bug.cgi?id=92669
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        When finishing, after the upload have already been done, Qt5's
+        QNetworkReply emits an uploadProgress signal with total bytes set to
+        zero. Since 0 of 0 bytes doesn't make any sense as progress, a
+        conditional was added to QNetworkReplyHandler::uploadProgress to make
+        do nothing with such values.
+
+        Unskip XMLHttpRequestUpload tests.
+
+        * platform/network/qt/QNetworkReplyHandler.cpp:
+        (WebCore::QNetworkReplyHandler::uploadProgress):
+
 2012-09-26  Bear Travis  <betra...@adobe.com>
 
         [CSS Exclusions] Rename WrapShapeInfo to ExclusionShapeInfo

Modified: trunk/Source/WebCore/platform/network/qt/QNetworkReplyHandler.cpp (129691 => 129692)


--- trunk/Source/WebCore/platform/network/qt/QNetworkReplyHandler.cpp	2012-09-26 20:08:06 UTC (rev 129691)
+++ trunk/Source/WebCore/platform/network/qt/QNetworkReplyHandler.cpp	2012-09-26 20:10:16 UTC (rev 129692)
@@ -582,6 +582,12 @@
     if (!client)
         return;
 
+    if (!bytesTotal) {
+        // When finished QNetworkReply emits a progress of 0 bytes.
+        // Ignore that, to avoid firing twice.
+        return;
+    }
+
     client->didSendData(m_resourceHandle, bytesSent, bytesTotal);
 }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to