mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-09 08:47:31 +09:00
Issue #618 - Rename some script load request flags to be more descriptive.
This commit is contained in:
parent
b7dbc3e795
commit
ecf9c7cf08
2 changed files with 11 additions and 11 deletions
|
|
@ -1358,7 +1358,7 @@ ScriptLoader::ProcessScriptElement(nsIScriptElement *aElement)
|
||||||
request->mJSVersion = version;
|
request->mJSVersion = version;
|
||||||
|
|
||||||
if (aElement->GetScriptAsync()) {
|
if (aElement->GetScriptAsync()) {
|
||||||
request->mIsAsync = true;
|
request->mInAsyncList = true;
|
||||||
if (request->IsReadyToRun()) {
|
if (request->IsReadyToRun()) {
|
||||||
mLoadedAsyncRequests.AppendElement(request);
|
mLoadedAsyncRequests.AppendElement(request);
|
||||||
// The script is available already. Run it ASAP when the event
|
// The script is available already. Run it ASAP when the event
|
||||||
|
|
@ -1469,7 +1469,7 @@ ScriptLoader::ProcessScriptElement(nsIScriptElement *aElement)
|
||||||
modReq->mBaseURL = mDocument->GetDocBaseURI();
|
modReq->mBaseURL = mDocument->GetDocBaseURI();
|
||||||
|
|
||||||
if (aElement->GetScriptAsync()) {
|
if (aElement->GetScriptAsync()) {
|
||||||
modReq->mIsAsync = true;
|
modReq->mInAsyncList = true;
|
||||||
mLoadingAsyncRequests.AppendElement(modReq);
|
mLoadingAsyncRequests.AppendElement(modReq);
|
||||||
} else {
|
} else {
|
||||||
AddDeferRequest(modReq);
|
AddDeferRequest(modReq);
|
||||||
|
|
@ -2342,14 +2342,14 @@ ScriptLoader::HandleLoadError(ScriptLoadRequest *aRequest, nsresult aResult) {
|
||||||
SetModuleFetchFinishedAndResumeWaitingRequests(request, aResult);
|
SetModuleFetchFinishedAndResumeWaitingRequests(request, aResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (aRequest->mIsDefer) {
|
if (aRequest->mInDeferList) {
|
||||||
MOZ_ASSERT_IF(aRequest->IsModuleRequest(),
|
MOZ_ASSERT_IF(aRequest->IsModuleRequest(),
|
||||||
aRequest->AsModuleRequest()->IsTopLevel());
|
aRequest->AsModuleRequest()->IsTopLevel());
|
||||||
if (aRequest->isInList()) {
|
if (aRequest->isInList()) {
|
||||||
RefPtr<ScriptLoadRequest> req = mDeferRequests.Steal(aRequest);
|
RefPtr<ScriptLoadRequest> req = mDeferRequests.Steal(aRequest);
|
||||||
FireScriptAvailable(aResult, req);
|
FireScriptAvailable(aResult, req);
|
||||||
}
|
}
|
||||||
} else if (aRequest->mIsAsync) {
|
} else if (aRequest->mInAsyncList) {
|
||||||
MOZ_ASSERT_IF(aRequest->IsModuleRequest(),
|
MOZ_ASSERT_IF(aRequest->IsModuleRequest(),
|
||||||
aRequest->AsModuleRequest()->IsTopLevel());
|
aRequest->AsModuleRequest()->IsTopLevel());
|
||||||
if (aRequest->isInList()) {
|
if (aRequest->isInList()) {
|
||||||
|
|
@ -2423,10 +2423,10 @@ ScriptLoader::MaybeMoveToLoadedList(ScriptLoadRequest* aRequest)
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(aRequest->IsReadyToRun());
|
MOZ_ASSERT(aRequest->IsReadyToRun());
|
||||||
|
|
||||||
// If it's async, move it to the loaded list. aRequest->mIsAsync really
|
// If it's async, move it to the loaded list. aRequest->mInAsyncList really
|
||||||
// _should_ be in a list, but the consequences if it's not are bad enough we
|
// _should_ be in a list, but the consequences if it's not are bad enough we
|
||||||
// want to avoid trying to move it if it's not.
|
// want to avoid trying to move it if it's not.
|
||||||
if (aRequest->mIsAsync) {
|
if (aRequest->mInAsyncList) {
|
||||||
MOZ_ASSERT(aRequest->isInList());
|
MOZ_ASSERT(aRequest->isInList());
|
||||||
if (aRequest->isInList()) {
|
if (aRequest->isInList()) {
|
||||||
RefPtr<ScriptLoadRequest> req = mLoadingAsyncRequests.Steal(aRequest);
|
RefPtr<ScriptLoadRequest> req = mLoadingAsyncRequests.Steal(aRequest);
|
||||||
|
|
@ -2636,7 +2636,7 @@ ScriptLoader::PreloadURI(nsIURI *aURI, const nsAString &aCharset,
|
||||||
void
|
void
|
||||||
ScriptLoader::AddDeferRequest(ScriptLoadRequest* aRequest)
|
ScriptLoader::AddDeferRequest(ScriptLoadRequest* aRequest)
|
||||||
{
|
{
|
||||||
aRequest->mIsDefer = true;
|
aRequest->mInDeferList = true;
|
||||||
mDeferRequests.AppendElement(aRequest);
|
mDeferRequests.AppendElement(aRequest);
|
||||||
if (mDeferEnabled && aRequest == mDeferRequests.getFirst() &&
|
if (mDeferEnabled && aRequest == mDeferRequests.getFirst() &&
|
||||||
mDocument && !mBlockingDOMContentLoaded) {
|
mDocument && !mBlockingDOMContentLoaded) {
|
||||||
|
|
|
||||||
|
|
@ -74,8 +74,8 @@ public:
|
||||||
mProgress(Progress::Loading),
|
mProgress(Progress::Loading),
|
||||||
mIsInline(true),
|
mIsInline(true),
|
||||||
mHasSourceMapURL(false),
|
mHasSourceMapURL(false),
|
||||||
mIsDefer(false),
|
mInDeferList(false),
|
||||||
mIsAsync(false),
|
mInAsyncList(false),
|
||||||
mIsNonAsyncScriptInserted(false),
|
mIsNonAsyncScriptInserted(false),
|
||||||
mIsXSLT(false),
|
mIsXSLT(false),
|
||||||
mIsCanceled(false),
|
mIsCanceled(false),
|
||||||
|
|
@ -159,8 +159,8 @@ public:
|
||||||
Progress mProgress; // Are we still waiting for a load to complete?
|
Progress mProgress; // Are we still waiting for a load to complete?
|
||||||
bool mIsInline; // Is the script inline or loaded?
|
bool mIsInline; // Is the script inline or loaded?
|
||||||
bool mHasSourceMapURL; // Does the HTTP header have a source map url?
|
bool mHasSourceMapURL; // Does the HTTP header have a source map url?
|
||||||
bool mIsDefer; // True if we live in mDeferRequests.
|
bool mInDeferList; // True if we live in mDeferRequests.
|
||||||
bool mIsAsync; // True if we live in mLoadingAsyncRequests or mLoadedAsyncRequests.
|
bool mInAsyncList; // True if we live in mLoadingAsyncRequests or mLoadedAsyncRequests.
|
||||||
bool mIsNonAsyncScriptInserted; // True if we live in mNonAsyncExternalScriptInsertedRequests
|
bool mIsNonAsyncScriptInserted; // True if we live in mNonAsyncExternalScriptInsertedRequests
|
||||||
bool mIsXSLT; // True if we live in mXSLTRequests.
|
bool mIsXSLT; // True if we live in mXSLTRequests.
|
||||||
bool mIsCanceled; // True if we have been explicitly canceled.
|
bool mIsCanceled; // True if we have been explicitly canceled.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue