Bug 1626570 - Improve handling of copying arrays in extensions/spellcheck. r=m_kato

Differential Revision: https://phabricator.services.mozilla.com/D72319
This commit is contained in:
Simon Giesecke 2020-04-30 09:36:26 +00:00
parent 9ad17cfd3d
commit 6a983da8c3
3 changed files with 4 additions and 4 deletions

View File

@ -1430,7 +1430,7 @@ void mozInlineSpellChecker::CheckCurrentWordsNoSuggest(
uint32_t token = mDisabledAsyncToken;
mSpellCheck->CheckCurrentWordsNoSuggest(aWords)->Then(
GetMainThreadSerialEventTarget(), __func__,
[self, spellCheckerSelection, aRanges,
[self, spellCheckerSelection, ranges = aRanges.Clone(),
token](const nsTArray<bool>& aIsMisspelled) {
if (token != self->mDisabledAsyncToken) {
// This result is never used
@ -1453,7 +1453,7 @@ void mozInlineSpellChecker::CheckCurrentWordsNoSuggest(
}
RefPtr<nsRange> wordRange =
mozInlineSpellWordUtil::MakeRange(aRanges[i]);
mozInlineSpellWordUtil::MakeRange(ranges[i]);
// If we somehow can't make a range for this word, just ignore
// it.
if (wordRange) {

View File

@ -77,7 +77,7 @@ class mozPersonalDictionarySave final : public mozilla::Runnable {
nsCOMPtr<nsIFile> aFile,
nsTArray<nsString>&& aDictWords)
: mozilla::Runnable("mozPersonalDictionarySave"),
mDictWords(aDictWords),
mDictWords(std::move(aDictWords)),
mFile(aFile),
mDict(aDict) {}

View File

@ -21,7 +21,7 @@ class mozEnglishWordUtils;
namespace mozilla {
class RemoteSpellcheckEngineChild;
class TextServicesDocument;
typedef MozPromise<nsTArray<bool>, nsresult, false> CheckWordPromise;
typedef MozPromise<CopyableTArray<bool>, nsresult, false> CheckWordPromise;
} // namespace mozilla
class mozSpellChecker final {