зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1157488 - Assert against re-entrant sync sections. r=bent
This commit is contained in:
Родитель
593c23f2d0
Коммит
345531a4ce
|
@ -31,6 +31,7 @@ nsBaseAppShell::nsBaseAppShell()
|
|||
, mSwitchTime(0)
|
||||
, mLastNativeEventTime(0)
|
||||
, mEventloopNestingState(eEventloopNone)
|
||||
, mRunningSyncSections(false)
|
||||
, mRunning(false)
|
||||
, mExiting(false)
|
||||
, mBlockNativeEvent(false)
|
||||
|
@ -350,6 +351,11 @@ nsBaseAppShell::RunSyncSectionsInternal(bool aStable,
|
|||
NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");
|
||||
NS_ASSERTION(!mSyncSections.IsEmpty(), "Nothing to do!");
|
||||
|
||||
// We don't support re-entering sync sections. This effectively means that
|
||||
// sync sections may not spin the event loop.
|
||||
MOZ_RELEASE_ASSERT(!mRunningSyncSections);
|
||||
mRunningSyncSections = true;
|
||||
|
||||
// We've got synchronous sections. Run all of them that are are awaiting a
|
||||
// stable state if aStable is true (i.e. we really are in a stable state).
|
||||
// Also run the synchronous sections that are simply waiting for the right
|
||||
|
@ -377,6 +383,7 @@ nsBaseAppShell::RunSyncSectionsInternal(bool aStable,
|
|||
}
|
||||
|
||||
mSyncSections.SwapElements(pendingSyncSections);
|
||||
mRunningSyncSections = false;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -134,6 +134,7 @@ private:
|
|||
};
|
||||
EventloopNestingState mEventloopNestingState;
|
||||
nsTArray<SyncSection> mSyncSections;
|
||||
bool mRunningSyncSections;
|
||||
bool mRunning;
|
||||
bool mExiting;
|
||||
/**
|
||||
|
|
Загрузка…
Ссылка в новой задаче