OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 | 68 |
69 void addSource(PassOwnPtrWillBeRawPtr<CSSFontFaceSource>); | 69 void addSource(PassOwnPtrWillBeRawPtr<CSSFontFaceSource>); |
70 | 70 |
71 void didBeginLoad(); | 71 void didBeginLoad(); |
72 void fontLoaded(RemoteFontFaceSource*); | 72 void fontLoaded(RemoteFontFaceSource*); |
73 void fontLoadWaitLimitExceeded(RemoteFontFaceSource*); | 73 void fontLoadWaitLimitExceeded(RemoteFontFaceSource*); |
74 | 74 |
75 PassRefPtr<SimpleFontData> getFontData(const FontDescription&); | 75 PassRefPtr<SimpleFontData> getFontData(const FontDescription&); |
76 | 76 |
77 struct UnicodeRange { | 77 struct UnicodeRange { |
78 ALLOW_ONLY_INLINE_ALLOCATION(); | 78 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); |
79 UnicodeRange(UChar32 from, UChar32 to) | 79 UnicodeRange(UChar32 from, UChar32 to) |
80 : m_from(from) | 80 : m_from(from) |
81 , m_to(to) | 81 , m_to(to) |
82 { | 82 { |
83 } | 83 } |
84 | 84 |
85 UChar32 from() const { return m_from; } | 85 UChar32 from() const { return m_from; } |
86 UChar32 to() const { return m_to; } | 86 UChar32 to() const { return m_to; } |
87 bool contains(UChar32 c) const { return m_from <= c && c <= m_to; } | 87 bool contains(UChar32 c) const { return m_from <= c && c <= m_to; } |
88 bool operator<(const UnicodeRange& other) const { return m_from < other.
m_from; } | 88 bool operator<(const UnicodeRange& other) const { return m_from < other.
m_from; } |
89 bool operator<(UChar32 c) const { return m_to < c; } | 89 bool operator<(UChar32 c) const { return m_to < c; } |
90 bool operator==(const FontDataRange& fontDataRange) const { return fontD
ataRange.from() == m_from && fontDataRange.to() == m_to; }; | 90 bool operator==(const FontDataRange& fontDataRange) const { return fontD
ataRange.from() == m_from && fontDataRange.to() == m_to; }; |
91 | 91 |
92 private: | 92 private: |
93 UChar32 m_from; | 93 UChar32 m_from; |
94 UChar32 m_to; | 94 UChar32 m_to; |
95 }; | 95 }; |
96 | 96 |
97 class CORE_EXPORT UnicodeRangeSet { | 97 class CORE_EXPORT UnicodeRangeSet { |
98 ALLOW_ONLY_INLINE_ALLOCATION(); | 98 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); |
99 public: | 99 public: |
100 explicit UnicodeRangeSet(const Vector<UnicodeRange>&); | 100 explicit UnicodeRangeSet(const Vector<UnicodeRange>&); |
101 bool contains(UChar32) const; | 101 bool contains(UChar32) const; |
102 bool contains(const FontDataRange&) const; | 102 bool contains(const FontDataRange&) const; |
103 bool intersectsWith(const String&) const; | 103 bool intersectsWith(const String&) const; |
104 bool isEntireRange() const { return m_ranges.isEmpty(); } | 104 bool isEntireRange() const { return m_ranges.isEmpty(); } |
105 size_t size() const { return m_ranges.size(); } | 105 size_t size() const { return m_ranges.size(); } |
106 const UnicodeRange& rangeAt(size_t i) const { return m_ranges[i]; } | 106 const UnicodeRange& rangeAt(size_t i) const { return m_ranges[i]; } |
107 private: | 107 private: |
108 Vector<UnicodeRange> m_ranges; // If empty, represents the whole code sp
ace. | 108 Vector<UnicodeRange> m_ranges; // If empty, represents the whole code sp
ace. |
(...skipping 14 matching lines...) Expand all Loading... |
123 | 123 |
124 UnicodeRangeSet m_ranges; | 124 UnicodeRangeSet m_ranges; |
125 RawPtrWillBeMember<CSSSegmentedFontFace> m_segmentedFontFace; | 125 RawPtrWillBeMember<CSSSegmentedFontFace> m_segmentedFontFace; |
126 WillBeHeapDeque<OwnPtrWillBeMember<CSSFontFaceSource>> m_sources; | 126 WillBeHeapDeque<OwnPtrWillBeMember<CSSFontFaceSource>> m_sources; |
127 RawPtrWillBeMember<FontFace> m_fontFace; | 127 RawPtrWillBeMember<FontFace> m_fontFace; |
128 }; | 128 }; |
129 | 129 |
130 } | 130 } |
131 | 131 |
132 #endif | 132 #endif |
OLD | NEW |