summaryrefslogtreecommitdiffstats
path: root/netwerk/protocol/http/nsHttpChannel.cpp
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@gmail.com>2018-02-18 12:21:38 +0100
committerwolfbeast <mcwerewolf@gmail.com>2018-02-18 12:21:38 +0100
commit51b6354f31b5f2122c11afec7fc0e3d650ce5e5d (patch)
treecfc8e519c89e459f7199a8210c72879537dec208 /netwerk/protocol/http/nsHttpChannel.cpp
parentd38f865699b1c1cb2395f719324b661acffa3223 (diff)
parent31c5e63eda295ed87419ff035631cadf776244af (diff)
downloadUXP-51b6354f31b5f2122c11afec7fc0e3d650ce5e5d.tar
UXP-51b6354f31b5f2122c11afec7fc0e3d650ce5e5d.tar.gz
UXP-51b6354f31b5f2122c11afec7fc0e3d650ce5e5d.tar.lz
UXP-51b6354f31b5f2122c11afec7fc0e3d650ce5e5d.tar.xz
UXP-51b6354f31b5f2122c11afec7fc0e3d650ce5e5d.zip
Merge branch 'ported-moebius'
Diffstat (limited to 'netwerk/protocol/http/nsHttpChannel.cpp')
-rw-r--r--netwerk/protocol/http/nsHttpChannel.cpp24
1 files changed, 23 insertions, 1 deletions
diff --git a/netwerk/protocol/http/nsHttpChannel.cpp b/netwerk/protocol/http/nsHttpChannel.cpp
index 0e570e8cb..1c9093495 100644
--- a/netwerk/protocol/http/nsHttpChannel.cpp
+++ b/netwerk/protocol/http/nsHttpChannel.cpp
@@ -8335,9 +8335,31 @@ nsHttpChannel::ResumeInternal()
LOG(("nsHttpChannel::ResumeInternal [this=%p]\n", this));
if (--mSuspendCount == 0 && mCallOnResume) {
- nsresult rv = AsyncCall(mCallOnResume);
+ // Resume the interrupted procedure first, then resume
+ // the pump to continue process the input stream.
+ RefPtr<nsRunnableMethod<nsHttpChannel>> callOnResume=
+ NewRunnableMethod(this, mCallOnResume);
+ // Should not resume pump that created after resumption.
+ RefPtr<nsInputStreamPump> transactionPump = mTransactionPump;
+ RefPtr<nsInputStreamPump> cachePump = mCachePump;
+
+ nsresult rv =
+ NS_DispatchToCurrentThread(NS_NewRunnableFunction(
+ [callOnResume, transactionPump, cachePump]() {
+ callOnResume->Run();
+
+ if (transactionPump) {
+ transactionPump->Resume();
+ }
+
+ if (cachePump) {
+ cachePump->Resume();
+ }
+ })
+ );
mCallOnResume = nullptr;
NS_ENSURE_SUCCESS(rv, rv);
+ return rv;
}
nsresult rvTransaction = NS_OK;