| Index: third_party/WebKit/Source/platform/fonts/FontCache.cpp
|
| diff --git a/third_party/WebKit/Source/platform/fonts/FontCache.cpp b/third_party/WebKit/Source/platform/fonts/FontCache.cpp
|
| index 2844a92e37aa811a9dd023d1d65441be65a5e5da..1ac542a2c04fdca50461f0c8a3c724346acec6b4 100644
|
| --- a/third_party/WebKit/Source/platform/fonts/FontCache.cpp
|
| +++ b/third_party/WebKit/Source/platform/fonts/FontCache.cpp
|
| @@ -48,6 +48,7 @@
|
| #include "platform/tracing/web_memory_allocator_dump.h"
|
| #include "platform/tracing/web_process_memory_dump.h"
|
| #include "public/platform/Platform.h"
|
| +#include "ui/gfx/font_list.h"
|
| #include "wtf/HashMap.h"
|
| #include "wtf/ListHashSet.h"
|
| #include "wtf/PtrUtil.h"
|
| @@ -303,6 +304,15 @@ bool FontCache::isPlatformFontAvailable(const FontDescription& fontDescription,
|
| checkingAlternateName);
|
| }
|
|
|
| +String FontCache::firstAvailableOrFirst(const String& families) {
|
| + // The conversions involve at least two string copies, and more if non-ASCII.
|
| + // For now we prefer shared code over the cost because a) inputs are
|
| + // only from grd/xtb and all ASCII, and b) at most only a few times per
|
| + // setting change/script.
|
| + return String::fromUTF8(
|
| + gfx::FontList::FirstAvailableOrFirst(families.utf8().data()).c_str());
|
| +}
|
| +
|
| SimpleFontData* FontCache::getNonRetainedLastResortFallbackFont(
|
| const FontDescription& fontDescription) {
|
| return getLastResortFallbackFont(fontDescription, DoNotRetain).leakRef();
|
|
|