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

Side by Side Diff: third_party/WebKit/Source/core/loader/resource/FontResource.cpp

Issue 2642383003: Replace Resource::Status with ResourceStatus (Closed)
Patch Set: Rebase. Created 3 years, 10 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
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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698