Bug 1797143: Switch from 'new' to 'MakeUnique' to construct an instance that's stored in a UniquePtr, in nsTextFrame.cpp. r=layout-reviewers,emilio

This patch doesn't change behavior.

'observers' is a pointer to nsTArray<UniquePtr<GlyphObserver>>; and UniquePtr
prefers[1] MakeUnique over 'new' (due to stronger ownership-related
guarantees), so let's switch to MakeUnique for construction here.

[1] reference:
https://searchfox.org/mozilla-central/rev/88f285c5163f73abd209d4f73cfa476660351982/mfbt/UniquePtr.h#129-131

Depends on D160099

Differential Revision: https://phabricator.services.mozilla.com/D160100
This commit is contained in:
Daniel Holbert 2022-10-24 19:17:22 +00:00
Родитель 880ea24d1f
Коммит 3edbf95781
1 изменённых файлов: 1 добавлений и 1 удалений

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

@ -1046,7 +1046,7 @@ static void CreateObserversForAnimatedGlyphs(gfxTextRun* aTextRun) {
aTextRun->SetFlagBits(nsTextFrameUtils::Flags::MightHaveGlyphChanges);
for (auto font : fontsWithAnimatedGlyphs) {
observers->AppendElement(new GlyphObserver(font, aTextRun));
observers->AppendElement(MakeUnique<GlyphObserver>(font, aTextRun));
}
}