chromium/third_party/blink/renderer/core/css/local_font_face_source.h

// Copyright 2014 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_CSS_LOCAL_FONT_FACE_SOURCE_H_
#define THIRD_PARTY_BLINK_RENDERER_CORE_CSS_LOCAL_FONT_FACE_SOURCE_H_

#include "base/memory/weak_ptr.h"
#include "third_party/blink/renderer/core/css/css_font_face_source.h"
#include "third_party/blink/renderer/platform/heap/member.h"
#include "third_party/blink/renderer/platform/wtf/allocator/allocator.h"
#include "third_party/blink/renderer/platform/wtf/text/atomic_string.h"

namespace blink {

class CSSFontFace;
class FontSelector;

// LocalFontFaceSource represents a src: local(<unique_name>) font face
// source. It operates in one of two ways: Synchronous or asynchronous,
// depending on what the platform implementation of FontUniqueNameLookup
// supports. If it operates in synchronous mode, IsLocalNonBlocking() return
// true and lookups are performed immediately. If IsLocalNonBlocking() returns
// false, a fallback font is returned from GetFontData() until
// FontUniqueNameLookup is ready (which is signalled by a callback). When
// FontUniqueNameLookup becomes ready, LocalFontFaceSource can lookup fonts
// synchronously and a relayout is triggered.
class LocalFontFaceSource final : public CSSFontFaceSource,
                                  public GarbageCollectedMixin {};

}  // namespace blink

#endif  // THIRD_PARTY_BLINK_RENDERER_CORE_CSS_LOCAL_FONT_FACE_SOURCE_H_