Changeset 48787 in webkit
- Timestamp:
- Sep 25, 2009, 11:43:25 PM (16 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r48785 r48787 1 2009-09-25 Dan Bernstein <mitz@apple.com> 2 3 Reviewed by Sam Weinig. 4 5 REGRESSION (r48775) FontList.plist written by TOT WebKit causes Safari 4 6 to crash on launch 7 https://bugs.webkit.org/show_bug.cgi?id=29759 8 9 * platform/graphics/win/FontDatabase.cpp: 10 (WebCore::writeFontDatabaseToPlist): Reverted to saving the CG font DB 11 property list at the root of FontList.plist, but with an additional 12 key for the last value of the Fonts registry key. 13 (WebCore::populateFontDatabase): Pass the FontList.plist in its entirety 14 to populatFontDatabaseFromPlist. 15 1 16 2009-09-25 Kevin Ollivier <kevino@theolliviers.com> 2 17 -
trunk/WebCore/platform/graphics/win/FontDatabase.cpp
r48775 r48787 125 125 } 126 126 127 static CFStringRef cgFontDBKey()128 {129 static CFStringRef key = CFSTR("WebKitCGFontDB");130 return key;131 }132 133 127 static void writeFontDatabaseToPlist(CFPropertyListRef cgFontDBPropertyList, CFPropertyListRef filenamesFromRegistry) 134 128 { 135 RetainPtr<CFMutableDictionaryRef> dictionary(AdoptCF, CFDictionaryCreateMutable(kCFAllocatorDefault, 2, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks)); 136 137 if (cgFontDBPropertyList) 138 CFDictionarySetValue(dictionary.get(), cgFontDBKey(), cgFontDBPropertyList); 139 if (filenamesFromRegistry) 129 if (!cgFontDBPropertyList) 130 return; 131 132 RetainPtr<CFDataRef> data; 133 134 if (!filenamesFromRegistry || CFGetTypeID(cgFontDBPropertyList) != CFDictionaryGetTypeID()) 135 data.adoptCF(CFPropertyListCreateXMLData(kCFAllocatorDefault, cgFontDBPropertyList)); 136 else { 137 RetainPtr<CFMutableDictionaryRef> dictionary(AdoptCF, CFDictionaryCreateMutableCopy(kCFAllocatorDefault, 2, static_cast<CFDictionaryRef>(cgFontDBPropertyList))); 140 138 CFDictionarySetValue(dictionary.get(), fontFilenamesFromRegistryKey(), filenamesFromRegistry); 141 142 RetainPtr<CFDataRef> data(AdoptCF, CFPropertyListCreateXMLData(kCFAllocatorDefault, dictionary.get())); 139 data.adoptCF(CFPropertyListCreateXMLData(kCFAllocatorDefault, dictionary.get())); 140 } 141 143 142 if (!data) 144 143 return; … … 202 201 203 202 if (!registryChanged && !systemHasFontsNewerThanFontsPlist()) { 204 RetainPtr<CFPropertyListRef> cgFontDBPropertyList; 205 if (propertyList) { 206 if (CFGetTypeID(propertyList.get()) == CFDictionaryGetTypeID()) { 207 CFDictionaryRef dictionary = static_cast<CFDictionaryRef>(propertyList.get()); 208 cgFontDBPropertyList = static_cast<CFArrayRef>(CFDictionaryGetValue(dictionary, cgFontDBKey())); 209 } 210 // Older versions of WebKit stored the CG font DB property list at the root of the property list. 211 if (!cgFontDBPropertyList) 212 cgFontDBPropertyList = propertyList; 213 } 214 215 if (populateFontDatabaseFromPlist(cgFontDBPropertyList.get())) 203 if (populateFontDatabaseFromPlist(propertyList.get())) 216 204 return; 217 205 }
Note:
See TracChangeset
for help on using the changeset viewer.