mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-23 21:01:08 +00:00
Bug 1851992 - send onDataFinished notifications from nsInputStreamPump. r=necko-reviewers,jesup
Differential Revision: https://phabricator.services.mozilla.com/D188757
This commit is contained in:
parent
1acfb3f11f
commit
d2b6e6de8b
@ -11673,6 +11673,12 @@
|
||||
value: @IS_NIGHTLY_BUILD@
|
||||
mirror: always
|
||||
|
||||
# Whether we can send OnDataAvailable to content process directly.
|
||||
- name: network.send_OnDataFinished.nsInputStreamPump
|
||||
type: RelaxedAtomicBool
|
||||
value: @IS_NIGHTLY_BUILD@
|
||||
mirror: always
|
||||
|
||||
# Perform all network access on the socket process.
|
||||
# The pref requires "network.process.enabled" to be true.
|
||||
# Changing these prefs requires a restart.
|
||||
|
@ -14,6 +14,7 @@
|
||||
#include "mozilla/NonBlockingAsyncInputStream.h"
|
||||
#include "mozilla/ProfilerLabels.h"
|
||||
#include "mozilla/SlicedInputStream.h"
|
||||
#include "mozilla/StaticPrefs_network.h"
|
||||
#include "nsIStreamListener.h"
|
||||
#include "nsILoadGroup.h"
|
||||
#include "nsNetCID.h"
|
||||
@ -650,6 +651,14 @@ uint32_t nsInputStreamPump::OnStateStop() {
|
||||
if (!NS_IsMainThread() && !mOffMainThread) {
|
||||
// This method can be called on a different thread if nsInputStreamPump
|
||||
// is used off the main-thread.
|
||||
if (NS_SUCCEEDED(mStatus) && mListener &&
|
||||
mozilla::StaticPrefs::network_send_OnDataFinished_nsInputStreamPump()) {
|
||||
nsCOMPtr<nsIThreadRetargetableStreamListener> retargetableListener =
|
||||
do_QueryInterface(mListener);
|
||||
if (retargetableListener) {
|
||||
retargetableListener->OnDataFinished(mStatus);
|
||||
}
|
||||
}
|
||||
nsresult rv = mLabeledMainThreadTarget->Dispatch(
|
||||
mozilla::NewRunnableMethod("nsInputStreamPump::CallOnStateStop", this,
|
||||
&nsInputStreamPump::CallOnStateStop));
|
||||
|
@ -29,7 +29,6 @@
|
||||
#include "mozilla/StaticPrefs_html5.h"
|
||||
#include "mozilla/StaticPrefs_intl.h"
|
||||
#include "mozilla/StaticPrefs_network.h"
|
||||
#include "mozilla/TaskCategory.h"
|
||||
#include "mozilla/TextUtils.h"
|
||||
|
||||
#include "mozilla/UniquePtrExtensions.h"
|
||||
|
Loading…
Reference in New Issue
Block a user