Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(260)

Side by Side Diff: Source/core/css/CSSFontFaceSrcValue.cpp

Issue 14672042: Prepare to add more initiator info to CachedResource(Request) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/core.gypi ('k') | Source/core/css/CSSImageSetValue.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 }
OLDNEW
« no previous file with comments | « Source/core/core.gypi ('k') | Source/core/css/CSSImageSetValue.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698