OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2007, 2008, 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008, 2011 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
48 class CSSFontFaceSource : public CachedFontClient { | 48 class CSSFontFaceSource : public CachedFontClient { |
49 public: | 49 public: |
50 CSSFontFaceSource(const String&, CachedFont* = 0); | 50 CSSFontFaceSource(const String&, CachedFont* = 0); |
51 virtual ~CSSFontFaceSource(); | 51 virtual ~CSSFontFaceSource(); |
52 | 52 |
53 bool isLoaded() const; | 53 bool isLoaded() const; |
54 bool isValid() const; | 54 bool isValid() const; |
55 | 55 |
56 const AtomicString& string() const { return m_string; } | 56 const AtomicString& string() const { return m_string; } |
57 | 57 |
58 void setFontFace(CSSFontFace* face) { m_face = face; } | 58 void setFontFace(Handle<CSSFontFace> face) { m_face = face.raw(); } |
59 | 59 |
60 virtual void fontLoaded(CachedFont*); | 60 virtual void fontLoaded(CachedFont*); |
61 | 61 |
62 PassRefPtr<SimpleFontData> getFontData(const FontDescription&, bool syntheti cBold, bool syntheticItalic, CSSFontSelector*); | 62 PassRefPtr<SimpleFontData> getFontData(const FontDescription&, bool syntheti cBold, bool syntheticItalic, CSSFontSelector*); |
63 | 63 |
64 void pruneTable(); | 64 void pruneTable(); |
65 | 65 |
66 #if ENABLE(SVG_FONTS) | 66 #if ENABLE(SVG_FONTS) |
67 SVGFontFaceElement* svgFontFaceElement() const; | 67 SVGFontFaceElement* svgFontFaceElement() const; |
68 void setSVGFontFaceElement(PassRefPtr<SVGFontFaceElement>); | 68 void setSVGFontFaceElement(PassRefPtr<SVGFontFaceElement>); |
69 bool isSVGFontFaceSource() const; | 69 bool isSVGFontFaceSource() const; |
70 void setHasExternalSVGFont(bool value) { m_hasExternalSVGFont = value; } | 70 void setHasExternalSVGFont(bool value) { m_hasExternalSVGFont = value; } |
71 #endif | 71 #endif |
72 | 72 |
73 bool isDecodeError() const; | 73 bool isDecodeError() const; |
74 bool ensureFontData(); | 74 bool ensureFontData(); |
75 | 75 |
76 private: | 76 private: |
77 void startLoadingTimerFired(Timer<CSSFontFaceSource>*); | 77 void startLoadingTimerFired(Timer<CSSFontFaceSource>*); |
78 | 78 |
79 AtomicString m_string; // URI for remote, built-in font name for local. | 79 AtomicString m_string; // URI for remote, built-in font name for local. |
80 CachedResourceHandle<CachedFont> m_font; // For remote fonts, a pointer to o ur cached resource. | 80 CachedResourceHandle<CachedFont> m_font; // For remote fonts, a pointer to o ur cached resource. |
81 // FIXME(oilpan): Move CSSFontFaceSource to the managed heap and change this to a Member. | |
81 CSSFontFace* m_face; // Our owning font face. | 82 CSSFontFace* m_face; // Our owning font face. |
Vyacheslav Egorov (Google)
2013/07/10 10:59:58
I think you can make it a member right away. There
haraken
2013/07/10 11:38:41
My concern is that using Members in not heap alloc
| |
82 HashMap<unsigned, RefPtr<SimpleFontData> > m_fontDataTable; // The hash key is composed of size synthetic styles. | 83 HashMap<unsigned, RefPtr<SimpleFontData> > m_fontDataTable; // The hash key is composed of size synthetic styles. |
83 | 84 |
84 #if ENABLE(SVG_FONTS) | 85 #if ENABLE(SVG_FONTS) |
85 RefPtr<SVGFontFaceElement> m_svgFontFaceElement; | 86 RefPtr<SVGFontFaceElement> m_svgFontFaceElement; |
86 RefPtr<SVGFontElement> m_externalSVGFontElement; | 87 RefPtr<SVGFontElement> m_externalSVGFontElement; |
87 bool m_hasExternalSVGFont; | 88 bool m_hasExternalSVGFont; |
88 #endif | 89 #endif |
89 }; | 90 }; |
90 | 91 |
91 } | 92 } |
92 | 93 |
93 #endif | 94 #endif |
OLD | NEW |