зеркало из https://github.com/mozilla/gecko-dev.git
Bug 814001, less surprising serializeToStream callback calls on content, r=bz
This commit is contained in:
Родитель
56d1df4c55
Коммит
554540ea81
|
@ -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();
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче