diff options
author | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2017-11-27 07:57:36 +0100 |
---|---|---|
committer | wolfbeast <mcwerewolf@gmail.com> | 2018-02-18 10:30:15 +0100 |
commit | 712d1c84ef50bcf3f62fd895e695ecbd51ee0c91 (patch) | |
tree | 0d81568c659cc0949e6732c198fe2ab42e490b0e /netwerk/protocol/http | |
parent | 1429e6d489066a603bd5790ba287b7dd8db3e2af (diff) | |
download | uxp-712d1c84ef50bcf3f62fd895e695ecbd51ee0c91.tar.gz |
Two (and more) extensions together - http resume - basilisk crashes
Diffstat (limited to 'netwerk/protocol/http')
-rw-r--r-- | netwerk/protocol/http/nsHttpChannel.cpp | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/netwerk/protocol/http/nsHttpChannel.cpp b/netwerk/protocol/http/nsHttpChannel.cpp index 0e570e8cb5..1c90934956 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; |