Commit 005a6885 authored by Fernando Serboncini's avatar Fernando Serboncini Committed by Commit Bot

Initialize FontFamilyNames also on Platform.

This is needed because PPAPI uses Platform without Core, so font names
aren't initialized properly there.

Bug: 742311
Change-Id: Ia0c89ffa9391759b54a73ec0d020ff437343e7a3
Reviewed-on: https://chromium-review.googlesource.com/570661Reviewed-by: default avatarJustin Novosad <junov@chromium.org>
Commit-Queue: Fernando Serboncini <fserb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#486488}
parent 43929085
......@@ -19,6 +19,10 @@ const AtomicString& {{entry|symbol}} = reinterpret_cast<AtomicString*>(&{{suffix
{% endfor %}
void init{{suffix}}() {
static bool isLoaded = false;
if (isLoaded) return;
isLoaded = true;
struct NameEntry {
const char* name;
unsigned hash;
......
......@@ -34,6 +34,7 @@
#include "base/threading/thread_task_runner_handle.h"
#include "base/trace_event/memory_dump_manager.h"
#include "platform/FontFamilyNames.h"
#include "platform/Histogram.h"
#include "platform/Language.h"
#include "platform/MemoryCoordinator.h"
......@@ -123,6 +124,11 @@ void Platform::Initialize(Platform* platform) {
base::ThreadTaskRunnerHandle::Get());
ThreadState::AttachMainThread();
// FontFamilyNames are used by platform/fonts and are initialized by core.
// In case core is not available (like on PPAPI plugins), we need to init
// them here.
FontFamilyNames::init();
InitializePlatformLanguage();
// TODO(ssid): remove this check after fixing crbug.com/486782.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment