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

Side by Side Diff: Source/core/loader/cache/CachedFont.cpp

Issue 18808004: Refactoring: Extract DocumentInit for capture Document construction parameter. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixed webkit_unit_tests build failure. Created 7 years, 5 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/loader/cache/CachedDocument.cpp ('k') | Source/core/svg/SVGDocument.h » ('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) 2006, 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2009 Torch Mobile, Inc. 3 * Copyright (C) 2009 Torch Mobile, Inc.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 return FontPlatformData(size, bold, italic); 95 return FontPlatformData(size, bold, italic);
96 #endif 96 #endif
97 ASSERT(m_fontData); 97 ASSERT(m_fontData);
98 return m_fontData->fontPlatformData(static_cast<int>(size), bold, italic, or ientation, widthVariant); 98 return m_fontData->fontPlatformData(static_cast<int>(size), bold, italic, or ientation, widthVariant);
99 } 99 }
100 100
101 #if ENABLE(SVG_FONTS) 101 #if ENABLE(SVG_FONTS)
102 bool CachedFont::ensureSVGFontData() 102 bool CachedFont::ensureSVGFontData()
103 { 103 {
104 if (!m_externalSVGDocument && !errorOccurred() && !isLoading() && m_data) { 104 if (!m_externalSVGDocument && !errorOccurred() && !isLoading() && m_data) {
105 m_externalSVGDocument = SVGDocument::create(0, KURL()); 105 m_externalSVGDocument = SVGDocument::create();
106 106
107 RefPtr<TextResourceDecoder> decoder = TextResourceDecoder::create("appli cation/xml"); 107 RefPtr<TextResourceDecoder> decoder = TextResourceDecoder::create("appli cation/xml");
108 String svgSource = decoder->decode(m_data->data(), m_data->size()); 108 String svgSource = decoder->decode(m_data->data(), m_data->size());
109 svgSource.append(decoder->flush()); 109 svgSource.append(decoder->flush());
110 110
111 m_externalSVGDocument->setContent(svgSource); 111 m_externalSVGDocument->setContent(svgSource);
112 112
113 if (decoder->sawError()) 113 if (decoder->sawError())
114 m_externalSVGDocument = 0; 114 m_externalSVGDocument = 0;
115 } 115 }
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 { 167 {
168 MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CachedResou rceFont); 168 MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CachedResou rceFont);
169 CachedResource::reportMemoryUsage(memoryObjectInfo); 169 CachedResource::reportMemoryUsage(memoryObjectInfo);
170 #if ENABLE(SVG_FONTS) 170 #if ENABLE(SVG_FONTS)
171 info.addMember(m_externalSVGDocument, "externalSVGDocument"); 171 info.addMember(m_externalSVGDocument, "externalSVGDocument");
172 #endif 172 #endif
173 info.addMember(m_fontData, "fontData"); 173 info.addMember(m_fontData, "fontData");
174 } 174 }
175 175
176 } 176 }
OLDNEW
« no previous file with comments | « Source/core/loader/cache/CachedDocument.cpp ('k') | Source/core/svg/SVGDocument.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698