Bug 1828537 - Add assertion to check if HttpChannelChild is released on main thread, r=necko-reviewers,valentin

Differential Revision: https://phabricator.services.mozilla.com/D178159
This commit is contained in:
Kershaw Chang 2023-05-17 14:15:37 +00:00
Родитель 187cbbb8f9
Коммит 95a22f0f74
1 изменённых файлов: 6 добавлений и 0 удалений

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

@ -108,6 +108,12 @@ HttpChannelChild::~HttpChannelChild() {
LOG(("Destroying HttpChannelChild @%p\n", this));
#ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED
// See HttpChannelChild::Release, HttpChannelChild should be always destroyed
// on the main thread.
MOZ_DIAGNOSTIC_ASSERT(NS_IsMainThread());
// mEventQ should be empty at this point.
MOZ_DIAGNOSTIC_ASSERT(mEventQ->IsEmpty());
if (mDoDiagnosticAssertWhenOnStopNotCalledOnDestroy && mAsyncOpenSucceeded &&
!mSuccesfullyRedirected && !LoadOnStopRequestCalled()) {
bool emptyBgChildQueue, nullBgChild;