зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
06499b6d63
Коммит
5431b7ebd7
|
@ -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();
|
||||
|
|
Загрузка…
Ссылка в новой задаче