Bug 1097878 - Additional fix for divertion from child to parent. r=sworkman

This commit is contained in:
Dragana Damjanovic 2014-11-12 18:01:00 +01:00
parent 924b597d99
commit 248f0d3df9

View File

@ -968,11 +968,6 @@ HttpChannelParent::DivertTo(nsIStreamListener *aListener)
mDivertListener = aListener;
if (NS_WARN_IF(mIPCClosed || !SendFlushedForDiversion())) {
FailDiversion(NS_ERROR_UNEXPECTED);
return;
}
// Call OnStartRequest and SendDivertMessages asynchronously to avoid
// reentering client context.
NS_DispatchToCurrentThread(
@ -1020,6 +1015,11 @@ HttpChannelParent::StartDiversion()
MOZ_ASSERT(NS_SUCCEEDED(rvdbg));
mDivertListener = nullptr;
if (NS_WARN_IF(mIPCClosed || !SendFlushedForDiversion())) {
FailDiversion(NS_ERROR_UNEXPECTED);
return;
}
// The listener chain should now be setup; tell HttpChannelChild to divert
// the OnDataAvailables and OnStopRequest to this HttpChannelParent.
if (NS_WARN_IF(mIPCClosed || !SendDivertMessages())) {