Title: [96985] trunk
- Revision
- 96985
- Author
- [email protected]
- Date
- 2011-10-07 16:18:35 -0700 (Fri, 07 Oct 2011)
Log Message
fix a crash when loading non-html multipart data
https://bugs.webkit.org/show_bug.cgi?id=69675
Reviewed by Adam Barth.
Source/WebCore:
setupForReplaceByMIMEType calls DocumentWriter::end(). This leads to
a crash on Mac because WebHTMLRepresentation() calls commitLoad(nil),
which tries to write to the DocumentWriter. By just inlining the code
to load the last page, we avoid this crash (and makes the non-html
multipart code more like the html multipart code).
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::maybeFinishLoadingMultipartContent):
LayoutTests:
* http/tests/multipart/load-last-non-html-frame.php: Ensure same
output on Apple Mac and Chromium (was getting different number of
trailing new lines).
Modified Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (96984 => 96985)
--- trunk/LayoutTests/ChangeLog 2011-10-07 23:00:04 UTC (rev 96984)
+++ trunk/LayoutTests/ChangeLog 2011-10-07 23:18:35 UTC (rev 96985)
@@ -1,3 +1,14 @@
+2011-10-07 Tony Chang <[email protected]>
+
+ fix a crash when loading non-html multipart data
+ https://bugs.webkit.org/show_bug.cgi?id=69675
+
+ Reviewed by Adam Barth.
+
+ * http/tests/multipart/load-last-non-html-frame.php: Ensure same
+ output on Apple Mac and Chromium (was getting different number of
+ trailing new lines).
+
2011-10-07 Sergey Glazunov <[email protected]>
XSLT-generated document should inherit its SecurityOrigin from the source document
Modified: trunk/LayoutTests/http/tests/multipart/load-last-non-html-frame.php (96984 => 96985)
--- trunk/LayoutTests/http/tests/multipart/load-last-non-html-frame.php 2011-10-07 23:00:04 UTC (rev 96984)
+++ trunk/LayoutTests/http/tests/multipart/load-last-non-html-frame.php 2011-10-07 23:18:35 UTC (rev 96985)
@@ -18,6 +18,4 @@
<?php
# Add some padding because CFNetwork merges small multipart segments together.
echo str_pad('', 5000);
-?>
-
---asdf--
+?>--asdf--
Modified: trunk/Source/WebCore/ChangeLog (96984 => 96985)
--- trunk/Source/WebCore/ChangeLog 2011-10-07 23:00:04 UTC (rev 96984)
+++ trunk/Source/WebCore/ChangeLog 2011-10-07 23:18:35 UTC (rev 96985)
@@ -1,3 +1,19 @@
+2011-10-07 Tony Chang <[email protected]>
+
+ fix a crash when loading non-html multipart data
+ https://bugs.webkit.org/show_bug.cgi?id=69675
+
+ Reviewed by Adam Barth.
+
+ setupForReplaceByMIMEType calls DocumentWriter::end(). This leads to
+ a crash on Mac because WebHTMLRepresentation() calls commitLoad(nil),
+ which tries to write to the DocumentWriter. By just inlining the code
+ to load the last page, we avoid this crash (and makes the non-html
+ multipart code more like the html multipart code).
+
+ * loader/DocumentLoader.cpp:
+ (WebCore::DocumentLoader::maybeFinishLoadingMultipartContent):
+
2011-10-07 Sergey Glazunov <[email protected]>
XSLT-generated document should inherit its SecurityOrigin from the source document
Modified: trunk/Source/WebCore/loader/DocumentLoader.cpp (96984 => 96985)
--- trunk/Source/WebCore/loader/DocumentLoader.cpp 2011-10-07 23:00:04 UTC (rev 96984)
+++ trunk/Source/WebCore/loader/DocumentLoader.cpp 2011-10-07 23:18:35 UTC (rev 96985)
@@ -849,8 +849,12 @@
void DocumentLoader::maybeFinishLoadingMultipartContent()
{
- if (!doesProgressiveLoad(m_response.mimeType()))
- setupForReplaceByMIMEType(m_response.mimeType());
+ if (!doesProgressiveLoad(m_response.mimeType())) {
+ frameLoader()->client()->revertToProvisionalState(this);
+ setupForReplace();
+ RefPtr<SharedBuffer> resourceData = mainResourceData();
+ commitLoad(resourceData->data(), resourceData->size());
+ }
}
void DocumentLoader::iconLoadDecisionAvailable()
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes