summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/Source/core/css/LocalFontFaceSource.h
blob: c172f3073105b461f0c876e524f5550a243a226e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef LocalFontFaceSource_h
#define LocalFontFaceSource_h

#include "core/css/CSSFontFaceSource.h"
#include "wtf/Allocator.h"
#include "wtf/text/AtomicString.h"

namespace blink {

class LocalFontFaceSource final : public CSSFontFaceSource {
public:
    LocalFontFaceSource(const String& fontName) : m_fontName(fontName) { }
    bool isLocal() const override { return true; }
    bool isLocalFontAvailable(const FontDescription&) override;

private:
    PassRefPtr<SimpleFontData> createFontData(const FontDescription&) override;

    class LocalFontHistograms {
        DISALLOW_NEW();
    public:
        LocalFontHistograms() : m_reported(false) { }
        void record(bool loadSuccess);
    private:
        bool m_reported;
    };

    AtomicString m_fontName;
    LocalFontHistograms m_histograms;
};

} // namespace blink

#endif