Changeset 48787 in webkit


Ignore:
Timestamp:
Sep 25, 2009 11:43:25 PM (15 years ago)
Author:
mitz@apple.com
Message:

REGRESSION (r48775) FontList.plist written by TOT WebKit causes Safari 4
to crash on launch
https://bugs.webkit.org/show_bug.cgi?id=29759

Reviewed by Sam Weinig.

  • platform/graphics/win/FontDatabase.cpp:

(WebCore::writeFontDatabaseToPlist): Reverted to saving the CG font DB
property list at the root of FontList.plist, but with an additional
key for the last value of the Fonts registry key.
(WebCore::populateFontDatabase): Pass the FontList.plist in its entirety
to populatFontDatabaseFromPlist.

Location:
trunk/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r48785 r48787  
     12009-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
    1162009-09-25  Kevin Ollivier  <kevino@theolliviers.com>
    217
  • trunk/WebCore/platform/graphics/win/FontDatabase.cpp

    r48775 r48787  
    125125}
    126126
    127 static CFStringRef cgFontDBKey()
    128 {
    129     static CFStringRef key = CFSTR("WebKitCGFontDB");
    130     return key;
    131 }
    132 
    133127static void writeFontDatabaseToPlist(CFPropertyListRef cgFontDBPropertyList, CFPropertyListRef filenamesFromRegistry)
    134128{
    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)));
    140138        CFDictionarySetValue(dictionary.get(), fontFilenamesFromRegistryKey(), filenamesFromRegistry);
    141 
    142     RetainPtr<CFDataRef> data(AdoptCF, CFPropertyListCreateXMLData(kCFAllocatorDefault, dictionary.get()));
     139        data.adoptCF(CFPropertyListCreateXMLData(kCFAllocatorDefault, dictionary.get()));
     140    }
     141
    143142    if (!data)
    144143        return;
     
    202201
    203202    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()))
    216204            return;
    217205    }
Note: See TracChangeset for help on using the changeset viewer.