OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef LocalFontFaceSource_h | 5 #ifndef LocalFontFaceSource_h |
6 #define LocalFontFaceSource_h | 6 #define LocalFontFaceSource_h |
7 | 7 |
8 #include "core/css/CSSFontFaceSource.h" | 8 #include "core/css/CSSFontFaceSource.h" |
9 #include "wtf/Allocator.h" | 9 #include "wtf/Allocator.h" |
10 #include "wtf/text/AtomicString.h" | 10 #include "wtf/text/AtomicString.h" |
11 | 11 |
12 namespace blink { | 12 namespace blink { |
13 | 13 |
14 class LocalFontFaceSource final : public CSSFontFaceSource { | 14 class LocalFontFaceSource final : public CSSFontFaceSource { |
15 public: | 15 public: |
16 LocalFontFaceSource(const String& fontName) : m_fontName(fontName) { } | 16 LocalFontFaceSource(const String& fontName) : m_fontName(fontName) { } |
17 bool isLocal() const override { return true; } | 17 bool isLocal() const override { return true; } |
18 bool isLocalFontAvailable(const FontDescription&) override; | 18 bool isLocalFontAvailable(const FontDescription&) override; |
19 | 19 |
20 private: | 20 private: |
21 PassRefPtr<SimpleFontData> createFontData(const FontDescription&) override; | 21 PassRefPtr<SimpleFontData> createFontData(const FontDescription&) override; |
22 | 22 |
23 class LocalFontHistograms { | 23 class LocalFontHistograms { |
24 DISALLOW_ALLOCATION(); | 24 DISALLOW_NEW(); |
25 public: | 25 public: |
26 LocalFontHistograms() : m_reported(false) { } | 26 LocalFontHistograms() : m_reported(false) { } |
27 void record(bool loadSuccess); | 27 void record(bool loadSuccess); |
28 private: | 28 private: |
29 bool m_reported; | 29 bool m_reported; |
30 }; | 30 }; |
31 | 31 |
32 AtomicString m_fontName; | 32 AtomicString m_fontName; |
33 LocalFontHistograms m_histograms; | 33 LocalFontHistograms m_histograms; |
34 }; | 34 }; |
35 | 35 |
36 } // namespace blink | 36 } // namespace blink |
37 | 37 |
38 #endif | 38 #endif |
OLD | NEW |