OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2010 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 16 matching lines...) Expand all Loading... |
27 #include "CSSFontFaceSrcValue.h" | 27 #include "CSSFontFaceSrcValue.h" |
28 #include "CachedFont.h" | 28 #include "CachedFont.h" |
29 #include "CachedResourceLoader.h" | 29 #include "CachedResourceLoader.h" |
30 #include "CachedResourceRequest.h" | 30 #include "CachedResourceRequest.h" |
31 #include "CachedResourceRequestInitiators.h" | 31 #include "CachedResourceRequestInitiators.h" |
32 #include "Document.h" | 32 #include "Document.h" |
33 #include "FontCustomPlatformData.h" | 33 #include "FontCustomPlatformData.h" |
34 #include "Node.h" | 34 #include "Node.h" |
35 #include "SVGFontFaceElement.h" | 35 #include "SVGFontFaceElement.h" |
36 #include "StyleSheetContents.h" | 36 #include "StyleSheetContents.h" |
37 #include "WebCoreMemoryInstrumentation.h" | |
38 #include <wtf/text/StringBuilder.h> | 37 #include <wtf/text/StringBuilder.h> |
39 | 38 |
40 namespace WebCore { | 39 namespace WebCore { |
41 | 40 |
42 #if ENABLE(SVG_FONTS) | 41 #if ENABLE(SVG_FONTS) |
43 bool CSSFontFaceSrcValue::isSVGFontFaceSrc() const | 42 bool CSSFontFaceSrcValue::isSVGFontFaceSrc() const |
44 { | 43 { |
45 return equalIgnoringCase(m_format, "svg"); | 44 return equalIgnoringCase(m_format, "svg"); |
46 } | 45 } |
47 #endif | 46 #endif |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 m_cachedFont = document->cachedResourceLoader()->requestFont(request); | 101 m_cachedFont = document->cachedResourceLoader()->requestFont(request); |
103 } | 102 } |
104 return m_cachedFont.get(); | 103 return m_cachedFont.get(); |
105 } | 104 } |
106 | 105 |
107 bool CSSFontFaceSrcValue::equals(const CSSFontFaceSrcValue& other) const | 106 bool CSSFontFaceSrcValue::equals(const CSSFontFaceSrcValue& other) const |
108 { | 107 { |
109 return m_isLocal == other.m_isLocal && m_format == other.m_format && m_resou
rce == other.m_resource; | 108 return m_isLocal == other.m_isLocal && m_format == other.m_format && m_resou
rce == other.m_resource; |
110 } | 109 } |
111 | 110 |
112 void CSSFontFaceSrcValue::reportDescendantMemoryUsage(MemoryObjectInfo* memoryOb
jectInfo) const | |
113 { | |
114 MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); | |
115 info.addMember(m_resource, "resource"); | |
116 info.addMember(m_format, "format"); | |
117 // FIXME: add m_cachedFont when MemoryCache is instrumented. | |
118 #if ENABLE(SVG_FONTS) | |
119 info.addMember(m_svgFontFaceElement, "svgFontFaceElement"); | |
120 #endif | |
121 } | 111 } |
122 | |
123 } | |
OLD | NEW |