зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1641737 - P7. Make the DLL and PPDC promises use direct task dispatch. r=mattwoodrow
We attempt to reduce the number of event loop iterations, which would bring us back to a similar behaviour to the pre-DocumentChannel days. This prevent some tests to have increase intermittent failures. While ideally, we would prefer to fix or re-write those tests properly, the extra work would block us for too long. All those increased intermittents already have bug logged about them; so we aren't hiding dust under the rust. Differential Revision: https://phabricator.services.mozilla.com/D78489
This commit is contained in:
Родитель
a0ac7bafae
Коммит
7a9999e7b7
|
@ -531,6 +531,9 @@ auto DocumentLoadListener::Open(
|
|||
|
||||
*aRv = NS_OK;
|
||||
mOpenPromise = new OpenPromise::Private(__func__);
|
||||
// We make the promise use direct task dispatch in order to reduce the number
|
||||
// of event loops iterations.
|
||||
mOpenPromise->UseDirectTaskDispatch(__func__);
|
||||
return mOpenPromise;
|
||||
}
|
||||
|
||||
|
|
|
@ -66,6 +66,9 @@ ParentProcessDocumentChannel::RedirectToRealChannel(
|
|||
mStreamFilterEndpoints = std::move(aStreamFilterEndpoints);
|
||||
|
||||
RefPtr<RedirectToRealChannelPromise> p = mPromise.Ensure(__func__);
|
||||
// We make the promise use direct task dispatch in order to reduce the number
|
||||
// of event loops iterations.
|
||||
mPromise.UseDirectTaskDispatch(__func__);
|
||||
|
||||
nsresult rv =
|
||||
gHttpHandler->AsyncOnChannelRedirect(this, channel, aRedirectFlags);
|
||||
|
@ -176,7 +179,7 @@ NS_IMETHODIMP ParentProcessDocumentChannel::AsyncOpen(
|
|||
->Then(
|
||||
GetCurrentThreadSerialEventTarget(), __func__,
|
||||
[self](RedirectToRealChannelPromise::ResolveOrRejectValue&&
|
||||
aValue) {
|
||||
aValue) -> RefPtr<RedirectToRealChannelPromise> {
|
||||
MOZ_ASSERT(aValue.IsResolve());
|
||||
nsresult rv = aValue.ResolveValue();
|
||||
if (NS_FAILED(rv)) {
|
||||
|
@ -186,8 +189,12 @@ NS_IMETHODIMP ParentProcessDocumentChannel::AsyncOpen(
|
|||
self->mListener = nullptr;
|
||||
self->mCallbacks = nullptr;
|
||||
self->RemoveObserver();
|
||||
return RedirectToRealChannelPromise::
|
||||
CreateAndResolveOrReject(std::move(aValue), __func__);
|
||||
auto p =
|
||||
MakeRefPtr<RedirectToRealChannelPromise::Private>(
|
||||
__func__);
|
||||
p->UseDirectTaskDispatch(__func__);
|
||||
p->ResolveOrReject(std::move(aValue), __func__);
|
||||
return p;
|
||||
});
|
||||
// We chain the promise the DLL is waiting on to the one returned by
|
||||
// RedirectToRealChannel. As soon as the promise returned is
|
||||
|
|
Загрузка…
Ссылка в новой задаче