OLD | NEW |
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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 } | 132 } |
133 | 133 |
134 bool FontResource::ensureCustomFontData() { | 134 bool FontResource::ensureCustomFontData() { |
135 if (!m_fontData && !errorOccurred() && !isLoading()) { | 135 if (!m_fontData && !errorOccurred() && !isLoading()) { |
136 if (data()) | 136 if (data()) |
137 m_fontData = FontCustomPlatformData::create(data(), m_otsParsingMessage); | 137 m_fontData = FontCustomPlatformData::create(data(), m_otsParsingMessage); |
138 | 138 |
139 if (m_fontData) { | 139 if (m_fontData) { |
140 recordPackageFormatHistogram(packageFormatOf(data())); | 140 recordPackageFormatHistogram(packageFormatOf(data())); |
141 } else { | 141 } else { |
142 setStatus(DecodeError); | 142 setStatus(ResourceStatus::DecodeError); |
143 recordPackageFormatHistogram(PackageFormatUnknown); | 143 recordPackageFormatHistogram(PackageFormatUnknown); |
144 } | 144 } |
145 } | 145 } |
146 return m_fontData.get(); | 146 return m_fontData.get(); |
147 } | 147 } |
148 | 148 |
149 FontPlatformData FontResource::platformDataFromCustomData( | 149 FontPlatformData FontResource::platformDataFromCustomData( |
150 float size, | 150 float size, |
151 bool bold, | 151 bool bold, |
152 bool italic, | 152 bool italic, |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 Resource::onMemoryDump(level, memoryDump); | 238 Resource::onMemoryDump(level, memoryDump); |
239 if (!m_fontData) | 239 if (!m_fontData) |
240 return; | 240 return; |
241 const String name = getMemoryDumpName() + "/decoded_webfont"; | 241 const String name = getMemoryDumpName() + "/decoded_webfont"; |
242 WebMemoryAllocatorDump* dump = memoryDump->createMemoryAllocatorDump(name); | 242 WebMemoryAllocatorDump* dump = memoryDump->createMemoryAllocatorDump(name); |
243 dump->addScalar("size", "bytes", m_fontData->dataSize()); | 243 dump->addScalar("size", "bytes", m_fontData->dataSize()); |
244 memoryDump->addSuballocation(dump->guid(), "malloc"); | 244 memoryDump->addSuballocation(dump->guid(), "malloc"); |
245 } | 245 } |
246 | 246 |
247 } // namespace blink | 247 } // namespace blink |
OLD | NEW |