| 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 #endif | 73 #endif |
| 74 | 74 |
| 75 bool isDecodeError() const; | 75 bool isDecodeError() const; |
| 76 bool ensureFontData(); | 76 bool ensureFontData(); |
| 77 bool isLocalFontAvailable(const FontDescription&); | 77 bool isLocalFontAvailable(const FontDescription&); |
| 78 void willUseFontData(); | 78 void willUseFontData(); |
| 79 | 79 |
| 80 private: | 80 private: |
| 81 class FontLoadHistograms { | 81 class FontLoadHistograms { |
| 82 public: | 82 public: |
| 83 enum UsageType { | 83 FontLoadHistograms() : m_loadStartTime(0) { } |
| 84 StyledAndUsed, | |
| 85 StyledButNotUsed, | |
| 86 NotStyledButUsed, | |
| 87 UsageTypeMax | |
| 88 }; | |
| 89 FontLoadHistograms() : m_styledTime(0), m_loadStartTime(0) { } | |
| 90 ~FontLoadHistograms(); | |
| 91 void willUseFontData(); | 84 void willUseFontData(); |
| 92 void loadStarted(); | 85 void loadStarted(); |
| 93 void recordLocalFont(bool loadSuccess); | 86 void recordLocalFont(bool loadSuccess); |
| 94 void recordRemoteFont(const FontResource*); | 87 void recordRemoteFont(const FontResource*); |
| 95 private: | 88 private: |
| 96 const char* histogramName(const FontResource*); | 89 const char* histogramName(const FontResource*); |
| 97 double m_styledTime; | |
| 98 double m_loadStartTime; | 90 double m_loadStartTime; |
| 99 }; | 91 }; |
| 100 | 92 |
| 101 void startLoadingTimerFired(Timer<CSSFontFaceSource>*); | 93 void startLoadingTimerFired(Timer<CSSFontFaceSource>*); |
| 102 | 94 |
| 103 AtomicString m_string; // URI for remote, built-in font name for local. | 95 AtomicString m_string; // URI for remote, built-in font name for local. |
| 104 ResourcePtr<FontResource> m_font; // For remote fonts, a pointer to our cach
ed resource. | 96 ResourcePtr<FontResource> m_font; // For remote fonts, a pointer to our cach
ed resource. |
| 105 CSSFontFace* m_face; // Our owning font face. | 97 CSSFontFace* m_face; // Our owning font face. |
| 106 HashMap<unsigned, RefPtr<SimpleFontData> > m_fontDataTable; // The hash key
is composed of size synthetic styles. | 98 HashMap<unsigned, RefPtr<SimpleFontData> > m_fontDataTable; // The hash key
is composed of size synthetic styles. |
| 107 FontLoadHistograms m_histograms; | 99 FontLoadHistograms m_histograms; |
| 108 | 100 |
| 109 #if ENABLE(SVG_FONTS) | 101 #if ENABLE(SVG_FONTS) |
| 110 RefPtr<SVGFontFaceElement> m_svgFontFaceElement; | 102 RefPtr<SVGFontFaceElement> m_svgFontFaceElement; |
| 111 RefPtr<SVGFontElement> m_externalSVGFontElement; | 103 RefPtr<SVGFontElement> m_externalSVGFontElement; |
| 112 bool m_hasExternalSVGFont; | 104 bool m_hasExternalSVGFont; |
| 113 #endif | 105 #endif |
| 114 }; | 106 }; |
| 115 | 107 |
| 116 } | 108 } |
| 117 | 109 |
| 118 #endif | 110 #endif |
| OLD | NEW |