Bug 1536236 - Make sure mDNSPrefetch is always released on main thread r=valentin

This patch should make mDNSPrefetch to be released always on main thread.

Differential Revision: https://phabricator.services.mozilla.com/D24685

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Kershaw Chang 2019-03-25 12:39:45 +00:00
Родитель 9d9c19e064
Коммит 4311c49299
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -371,6 +371,7 @@ void nsHttpChannel::ReleaseMainThreadOnlyReferences() {
arrayToRelease.AppendElement(mRedirectURI.forget()); arrayToRelease.AppendElement(mRedirectURI.forget());
arrayToRelease.AppendElement(mRedirectChannel.forget()); arrayToRelease.AppendElement(mRedirectChannel.forget());
arrayToRelease.AppendElement(mPreflightChannel.forget()); arrayToRelease.AppendElement(mPreflightChannel.forget());
arrayToRelease.AppendElement(mDNSPrefetch.forget());
NS_DispatchToMainThread(new ProxyReleaseRunnable(std::move(arrayToRelease))); NS_DispatchToMainThread(new ProxyReleaseRunnable(std::move(arrayToRelease)));
} }
@ -7805,7 +7806,6 @@ nsHttpChannel::OnStopRequest(nsIRequest *request, nsresult status) {
mTransactionTimings.domainLookupStart = mDNSPrefetch->StartTimestamp(); mTransactionTimings.domainLookupStart = mDNSPrefetch->StartTimestamp();
mTransactionTimings.domainLookupEnd = mDNSPrefetch->EndTimestamp(); mTransactionTimings.domainLookupEnd = mDNSPrefetch->EndTimestamp();
} }
mDNSPrefetch = nullptr;
// handle auth retry... // handle auth retry...
if (authRetry) { if (authRetry) {