Bug 1678774 - Rename ScriptLoadRequestList::Cancel to CancelRequestsAndClear r=dpalmeiro

It's not otherwise obvious that calling this cancels all the requests in the list.

Differential Revision: https://phabricator.services.mozilla.com/D119491
This commit is contained in:
Jon Coppeard 2021-07-12 16:30:59 +00:00
Родитель 596f5488eb
Коммит d06022bd80
3 изменённых файлов: 9 добавлений и 9 удалений

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

@ -273,9 +273,9 @@ void ScriptLoadRequest::SetIsLoadRequest(nsIScriptElement* aElement) {
// ScriptLoadRequestList
//////////////////////////////////////////////////////////////
ScriptLoadRequestList::~ScriptLoadRequestList() { Clear(); }
ScriptLoadRequestList::~ScriptLoadRequestList() { CancelRequestsAndClear(); }
void ScriptLoadRequestList::Clear() {
void ScriptLoadRequestList::CancelRequestsAndClear() {
while (!isEmpty()) {
RefPtr<ScriptLoadRequest> first = StealFirst();
first->Cancel();

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

@ -351,7 +351,7 @@ class ScriptLoadRequestList : private mozilla::LinkedList<ScriptLoadRequest> {
public:
~ScriptLoadRequestList();
void Clear();
void CancelRequestsAndClear();
#ifdef DEBUG
bool Contains(ScriptLoadRequest* aElem) const;

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

@ -4307,11 +4307,11 @@ void ScriptLoader::ParsingComplete(bool aTerminated) {
if (!aTerminated) {
return;
}
mDeferRequests.Clear();
mLoadingAsyncRequests.Clear();
mLoadedAsyncRequests.Clear();
mNonAsyncExternalScriptInsertedRequests.Clear();
mXSLTRequests.Clear();
mDeferRequests.CancelRequestsAndClear();
mLoadingAsyncRequests.CancelRequestsAndClear();
mLoadedAsyncRequests.CancelRequestsAndClear();
mNonAsyncExternalScriptInsertedRequests.CancelRequestsAndClear();
mXSLTRequests.CancelRequestsAndClear();
for (ScriptLoadRequest* req = mDynamicImportRequests.getFirst(); req;
req = req->getNext()) {
@ -4321,7 +4321,7 @@ void ScriptLoader::ParsingComplete(bool aTerminated) {
// from mDynamicImportRequests.
FinishDynamicImportAndReject(req->AsModuleRequest(), NS_ERROR_ABORT);
}
mDynamicImportRequests.Clear();
mDynamicImportRequests.CancelRequestsAndClear();
if (mParserBlockingRequest) {
mParserBlockingRequest->Cancel();