Bug 1814749 - part2 : do not call engine method until the recovery finishes. r=jolin

Differential Revision: https://phabricator.services.mozilla.com/D173374
This commit is contained in:
alwu 2023-03-31 08:14:03 +00:00
parent 7665c0c2f2
commit 5a761dbf39

View File

@ -574,8 +574,9 @@ void ExternalEngineStateMachine::BufferedRangeUpdated() {
// Note: the variadic only supports passing member variables.
#define PERFORM_WHEN_ALLOW(Func, ...) \
do { \
/* Initialzation is not done yet, posepone the operation */ \
if (mState.IsInitEngine() && mState.AsInitEngine()->mInitPromise) { \
/* Initialzation is not done yet, postpone the operation */ \
if ((mState.IsInitEngine() || mState.IsRecoverEngine()) && \
mState.AsInitEngine()->mInitPromise) { \
LOG("%s is called before init", __func__); \
mState.AsInitEngine()->mInitPromise->Then( \
OwnerThread(), __func__, \