Bug 814001, less surprising serializeToStream callback calls on content, r=bz

This commit is contained in:
Olli Pettay 2012-12-10 15:52:34 +02:00
Родитель 56d1df4c55
Коммит 554540ea81
2 изменённых файлов: 14 добавлений и 4 удалений

Просмотреть файл

@ -1202,12 +1202,18 @@ nsDocumentEncoder::EncodeToStream(nsIOutputStream* aStream)
NS_ENSURE_SUCCESS(rv, rv); NS_ENSURE_SUCCESS(rv, rv);
} }
mStream = aStream; bool chromeCaller = nsContentUtils::IsCallerChrome();
if (chromeCaller) {
mStream = aStream;
}
nsAutoString buf; nsAutoString buf;
rv = EncodeToString(buf); rv = EncodeToString(buf);
if (!chromeCaller) {
mStream = aStream;
}
// Force a flush of the last chunk of data. // Force a flush of the last chunk of data.
FlushText(buf, true); FlushText(buf, true);

Просмотреть файл

@ -2494,8 +2494,12 @@ GetRequestBody(nsIDOMDocument* aDoc, nsIInputStream** aResult,
NS_ENSURE_SUCCESS(rv, rv); NS_ENSURE_SUCCESS(rv, rv);
// Make sure to use the encoding we'll send // Make sure to use the encoding we'll send
rv = serializer->SerializeToStream(aDoc, output, aCharset); {
NS_ENSURE_SUCCESS(rv, rv); nsCxPusher pusher;
pusher.PushNull();
rv = serializer->SerializeToStream(aDoc, output, aCharset);
NS_ENSURE_SUCCESS(rv, rv);
}
output->Close(); output->Close();