Bug 1813494 - Part 3: Add more cancellation checks and state assertions to module load requests r=smaug

We should check for previous cancellation on all path where a module load
request's state can be changed by an asynchronous action. Also add assertions
about the expected previous state where possible.

Differential Revision: https://phabricator.services.mozilla.com/D168233
This commit is contained in:
Jon Coppeard
2023-02-07 11:55:51 +00:00
parent 1952f4725c
commit cc6ddbdd0f
3 changed files with 65 additions and 32 deletions

View File

@@ -209,8 +209,8 @@ class ScriptLoadRequest
};
bool IsFetching() const { return mState == State::Fetching; }
bool IsCompiling() const { return mState == State::Compiling; }
bool IsLoadingImports() const { return mState == State::LoadingImports; }
bool IsReadyToRun() const {
return mState == State::Ready || mState == State::Canceled;