It's a bit weird that the object is always created and has an isOpenType() method to check whether it's an OpenType or not. The caller is always deleting the object when it's not an OpenType, so it would be better if the create method returned nullptr instead of creating the object when the font is not OpenType.
Created attachment 277690 [details] Patch
Comment on attachment 277690 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=277690&action=review > Source/WebCore/platform/graphics/FontCache.cpp:322 > auto addResult = fontVerticalDataCache().add(platformData, nullptr); > - if (addResult.isNewEntry) { > - RefPtr<OpenTypeVerticalData> data = OpenTypeVerticalData::create(platformData); > - addResult.iterator->value = data->isOpenType() ? WTFMove(data) : nullptr; > - } > + if (addResult.isNewEntry) > + addResult.iterator->value = OpenTypeVerticalData::create(platformData); This is now a perfect candidate for using the new "ensure" function instead of add.
Committed r200364: <http://trac.webkit.org/changeset/200364>