Chromium Code Reviews| 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; } |
| 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 CSSFontFace* m_face; // Our owning font face. | 81 Persistent<CSSFontFace> m_face; // Our owning font face. |
|
Mads Ager (chromium)
2013/07/02 14:59:23
This looks like a definite leak. The CSSFontFace h
haraken
2013/07/03 04:39:20
Good point. Done.
| |
| 82 HashMap<unsigned, RefPtr<SimpleFontData> > m_fontDataTable; // The hash key is composed of size synthetic styles. | 82 HashMap<unsigned, RefPtr<SimpleFontData> > m_fontDataTable; // The hash key is composed of size synthetic styles. |
| 83 | 83 |
| 84 #if ENABLE(SVG_FONTS) | 84 #if ENABLE(SVG_FONTS) |
| 85 RefPtr<SVGFontFaceElement> m_svgFontFaceElement; | 85 RefPtr<SVGFontFaceElement> m_svgFontFaceElement; |
| 86 RefPtr<SVGFontElement> m_externalSVGFontElement; | 86 RefPtr<SVGFontElement> m_externalSVGFontElement; |
| 87 bool m_hasExternalSVGFont; | 87 bool m_hasExternalSVGFont; |
| 88 #endif | 88 #endif |
| 89 }; | 89 }; |
| 90 | 90 |
| 91 } | 91 } |
| 92 | 92 |
| 93 #endif | 93 #endif |
| OLD | NEW |