| 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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 bool CSSFontFaceSrcValue::hasFailedOrCanceledSubresources() const | 90 bool CSSFontFaceSrcValue::hasFailedOrCanceledSubresources() const |
| 91 { | 91 { |
| 92 if (!m_cachedFont) | 92 if (!m_cachedFont) |
| 93 return false; | 93 return false; |
| 94 return m_cachedFont->loadFailedOrCanceled(); | 94 return m_cachedFont->loadFailedOrCanceled(); |
| 95 } | 95 } |
| 96 | 96 |
| 97 CachedFont* CSSFontFaceSrcValue::cachedFont(Document* document) | 97 CachedFont* CSSFontFaceSrcValue::cachedFont(Document* document) |
| 98 { | 98 { |
| 99 if (!m_cachedFont) { | 99 if (!m_cachedFont) { |
| 100 CachedResourceRequest request(ResourceRequest(document->completeURL(m_re
source))); | 100 CachedResourceRequest request(ResourceRequest(document->completeURL(m_re
source)), cachedResourceRequestInitiators().css); |
| 101 request.setInitiator(cachedResourceRequestInitiators().css); | |
| 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 | 111 void CSSFontFaceSrcValue::reportDescendantMemoryUsage(MemoryObjectInfo* memoryOb
jectInfo) const |
| 113 { | 112 { |
| 114 MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); | 113 MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); |
| 115 info.addMember(m_resource, "resource"); | 114 info.addMember(m_resource, "resource"); |
| 116 info.addMember(m_format, "format"); | 115 info.addMember(m_format, "format"); |
| 117 // FIXME: add m_cachedFont when MemoryCache is instrumented. | 116 // FIXME: add m_cachedFont when MemoryCache is instrumented. |
| 118 #if ENABLE(SVG_FONTS) | 117 #if ENABLE(SVG_FONTS) |
| 119 info.addMember(m_svgFontFaceElement, "svgFontFaceElement"); | 118 info.addMember(m_svgFontFaceElement, "svgFontFaceElement"); |
| 120 #endif | 119 #endif |
| 121 } | 120 } |
| 122 | 121 |
| 123 } | 122 } |
| OLD | NEW |