Title: [100503] trunk
Revision
100503
Author
jap...@chromium.org
Date
2011-11-16 14:10:53 -0800 (Wed, 16 Nov 2011)

Log Message

Source/WebCore: Fix incorrect multipart handling in r100311.
SubresourceLoader::didReceiveData() is getting called
twice, which has unintended side effects.
https://bugs.webkit.org/show_bug.cgi?id=72436

Reviewed by Adam Barth.

http/tests/multipart/invalid-image-data.html should stop
asserting after this.

* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::didReceiveResponse):
(WebCore::SubresourceLoader::didReceiveData):
(WebCore::SubresourceLoader::sendDataToResource):
* loader/SubresourceLoader.h:

LayoutTests: Remove CRASH expectation for
http/tests/multipart/invalid-image-data.html.
https://bugs.webkit.org/show_bug.cgi?id=72436

Reviewed by Adam Barth.

* platform/chromium/test_expectations.txt:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (100502 => 100503)


--- trunk/LayoutTests/ChangeLog	2011-11-16 22:07:23 UTC (rev 100502)
+++ trunk/LayoutTests/ChangeLog	2011-11-16 22:10:53 UTC (rev 100503)
@@ -1,3 +1,13 @@
+2011-11-16  Nate Chapin  <jap...@chromium.org>
+
+        Remove CRASH expectation for
+        http/tests/multipart/invalid-image-data.html.
+        https://bugs.webkit.org/show_bug.cgi?id=72436
+
+        Reviewed by Adam Barth.
+
+        * platform/chromium/test_expectations.txt:
+
 2011-11-16  Justin Schuh  <jsc...@chromium.org>
 
         Clear SVG filter client when its node is detached

Modified: trunk/LayoutTests/platform/chromium/test_expectations.txt (100502 => 100503)


--- trunk/LayoutTests/platform/chromium/test_expectations.txt	2011-11-16 22:07:23 UTC (rev 100502)
+++ trunk/LayoutTests/platform/chromium/test_expectations.txt	2011-11-16 22:10:53 UTC (rev 100503)
@@ -1253,8 +1253,7 @@
 BUGCR10361 WIN : http/tests/misc/single-character-pi-stylesheet.xhtml = FAIL
 
 // Windows is missing the green box. Started to pass in roll to WebKit r50313
-BUGCR8729 WIN RELEASE : http/tests/multipart/invalid-image-data.html = IMAGE+TEXT
-BUGWK72436 WIN DEBUG : http/tests/multipart/invalid-image-data.html = CRASH
+BUGCR8729 WIN : http/tests/multipart/invalid-image-data.html = IMAGE+TEXT
 
 // -----------------------------------------------------------------
 // MAC PORT TESTS

Modified: trunk/Source/WebCore/ChangeLog (100502 => 100503)


--- trunk/Source/WebCore/ChangeLog	2011-11-16 22:07:23 UTC (rev 100502)
+++ trunk/Source/WebCore/ChangeLog	2011-11-16 22:10:53 UTC (rev 100503)
@@ -1,3 +1,21 @@
+2011-11-16  Nate Chapin  <jap...@chromium.org>
+
+        Fix incorrect multipart handling in r100311.
+        SubresourceLoader::didReceiveData() is getting called
+        twice, which has unintended side effects.
+        https://bugs.webkit.org/show_bug.cgi?id=72436
+
+        Reviewed by Adam Barth.
+
+        http/tests/multipart/invalid-image-data.html should stop
+        asserting after this.
+
+        * loader/SubresourceLoader.cpp:
+        (WebCore::SubresourceLoader::didReceiveResponse):
+        (WebCore::SubresourceLoader::didReceiveData):
+        (WebCore::SubresourceLoader::sendDataToResource):
+        * loader/SubresourceLoader.h:
+
 2011-11-16  Justin Schuh  <jsc...@chromium.org>
 
         Clear SVG filter client when its node is detached

Modified: trunk/Source/WebCore/loader/SubresourceLoader.cpp (100502 => 100503)


--- trunk/Source/WebCore/loader/SubresourceLoader.cpp	2011-11-16 22:07:23 UTC (rev 100502)
+++ trunk/Source/WebCore/loader/SubresourceLoader.cpp	2011-11-16 22:10:53 UTC (rev 100503)
@@ -179,7 +179,7 @@
         // Since a subresource loader does not load multipart sections progressively,
         // deliver the previously received data to the loader all at once now.
         // Then clear the data to make way for the next multipart section.
-        didReceiveData(buffer->data(), buffer->size(), -1, true);
+        sendDataToResource(buffer->data(), buffer->size());
         clearResourceData();
         
         // After the first multipart section is complete, signal to delegates that this load is "finished" 
@@ -204,6 +204,12 @@
         return;
     }
 
+    if (!m_loadingMultipartContent)
+        sendDataToResource(data, length);
+}
+
+void SubresourceLoader::sendDataToResource(const char* data, int length)
+{
     // There are two cases where we might need to create our own SharedBuffer instead of copying the one in ResourceLoader.
     // (1) Multipart content: The loader delivers the data in a multipart section all at once, then sends eof.
     //     The resource data will change as the next part is loaded, so we need to make a copy.

Modified: trunk/Source/WebCore/loader/SubresourceLoader.h (100502 => 100503)


--- trunk/Source/WebCore/loader/SubresourceLoader.h	2011-11-16 22:07:23 UTC (rev 100502)
+++ trunk/Source/WebCore/loader/SubresourceLoader.h	2011-11-16 22:10:53 UTC (rev 100503)
@@ -68,6 +68,8 @@
 #endif
     virtual void releaseResources();
 
+    void sendDataToResource(const char*, int);
+
     enum SubresourceLoaderState {
         Uninitialized,
         Initialized,
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to