Bug 1648440 - Use TransformIntoNewArray in RemoteWorkerChild. r=dom-workers-and-storage-reviewers,asuth

Differential Revision: https://phabricator.services.mozilla.com/D81061
This commit is contained in:
Simon Giesecke 2020-06-26 14:52:52 +00:00
Родитель 06499b6d63
Коммит 5431b7ebd7
1 изменённых файлов: 8 добавлений и 10 удалений

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

@ -21,6 +21,7 @@
#include "nsXULAppAPI.h"
#include "RemoteWorkerService.h"
#include "mozilla/ArrayAlgorithm.h"
#include "mozilla/Assertions.h"
#include "mozilla/Attributes.h"
#include "mozilla/BasePrincipal.h"
@ -658,16 +659,13 @@ void RemoteWorkerChild::ErrorPropagationOnMainThread(
ErrorValue value;
if (aIsErrorEvent) {
nsTArray<ErrorDataNote> notes;
for (size_t i = 0, len = aReport->mNotes.Length(); i < len; i++) {
const WorkerErrorNote& note = aReport->mNotes.ElementAt(i);
notes.AppendElement(ErrorDataNote(note.mLineNumber, note.mColumnNumber,
note.mMessage, note.mFilename));
}
ErrorData data(aReport->mIsWarning, aReport->mLineNumber,
aReport->mColumnNumber, aReport->mMessage,
aReport->mFilename, aReport->mLine, notes);
ErrorData data(
aReport->mIsWarning, aReport->mLineNumber, aReport->mColumnNumber,
aReport->mMessage, aReport->mFilename, aReport->mLine,
TransformIntoNewArray(aReport->mNotes, [](const WorkerErrorNote& note) {
return ErrorDataNote(note.mLineNumber, note.mColumnNumber,
note.mMessage, note.mFilename);
}));
value = data;
} else {
value = void_t();