Changeset 148261 in webkit


Ignore:
Timestamp:
Apr 11, 2013 10:03:18 PM (11 years ago)
Author:
thakis@chromium.org
Message:

Remove debugging code that is no longer used with current mac sdks.
https://bugs.webkit.org/show_bug.cgi?id=114486

Reviewed by Dan Bernstein.

This code compared MAC_OS_X_VERSION_MAX_ALLOWED and friends to
107 and 106 instead of the correct 1070 and 1060. Instead of fixing
this, rip the code out completely: Since WebKit now only targets
current systems, the ifdef is always false anyways.

No tests, as this only removes debugging code.

  • platform/graphics/mac/SimpleFontDataMac.mm:

(WebCore::SimpleFontData::platformInit):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r148260 r148261  
     12013-04-11  Nico Weber  <thakis@chromium.org>
     2
     3        Remove debugging code that is no longer used with current mac sdks.
     4        https://bugs.webkit.org/show_bug.cgi?id=114486
     5
     6        Reviewed by Dan Bernstein.
     7
     8        This code compared __MAC_OS_X_VERSION_MAX_ALLOWED and friends to
     9        107 and 106 instead of the correct 1070 and 1060. Instead of fixing
     10        this, rip the code out completely: Since WebKit now only targets
     11        current systems, the ifdef is always false anyways.
     12
     13        No tests, as this only removes debugging code.
     14
     15        * platform/graphics/mac/SimpleFontDataMac.mm:
     16        (WebCore::SimpleFontData::platformInit):
     17
    1182013-04-11  Oliver Hunt  <oliver@apple.com>
    219
  • trunk/Source/WebCore/platform/graphics/mac/SimpleFontDataMac.mm

    r147710 r148261  
    8080}
    8181
    82 #if !ERROR_DISABLED
    83 #if defined(__LP64__) || PLATFORM(IOS) || __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 || (__MAC_OS_X_VERSION_MAX_ALLOWED >= 107 && __MAC_OS_X_VERSION_MIN_REQUIRED >= 106)
    84 static NSString* pathFromFont(NSFont*)
    85 {
    86     // FMGetATSFontRefFromFont is not available. As pathFromFont is only used for debugging purposes,
    87     // returning nil is acceptable.
    88     return nil;
    89 }
    90 #else
    91 static NSString* pathFromFont(NSFont *font)
    92 {
    93     ATSFontRef atsFont = FMGetATSFontRefFromFont(CTFontGetPlatformFont(toCTFontRef(font), 0));
    94     FSRef fileRef;
    95 
    96     OSStatus status = ATSFontGetFileReference(atsFont, &fileRef);
    97     if (status != noErr)
    98         return nil;
    99 
    100     UInt8 filePathBuffer[PATH_MAX];
    101     status = FSRefMakePath(&fileRef, filePathBuffer, PATH_MAX);
    102     if (status == noErr)
    103         return [NSString stringWithUTF8String:(const char*)filePathBuffer];
    104 
    105     return nil;
    106 }
    107 #endif // __LP64__
    108 #endif // !ERROR_DISABLED
    109 
    11082const SimpleFontData* SimpleFontData::getCompositeFontReferenceFontData(NSFont *key) const
    11183{
     
    167139        else
    168140            m_platformData.setFont([NSFont fontWithName:fallbackFontFamily size:m_platformData.size()]);
    169 #if !ERROR_DISABLED
    170         NSString *filePath = pathFromFont(initialFont.get());
    171         if (!filePath)
    172             filePath = @"not known";
    173 #endif
    174141        if (!initFontData(this)) {
    175142            if ([fallbackFontFamily isEqual:@"Times New Roman"]) {
     
    179146                if (!initFontData(this)) {
    180147                    // We tried, Times, Times New Roman, and the system font. No joy. We have to give up.
    181                     LOG_ERROR("unable to initialize with font %@ at %@", initialFont.get(), filePath);
     148                    LOG_ERROR("unable to initialize with font %@", initialFont.get());
    182149                    failedSetup = true;
    183150                }
    184151            } else {
    185152                // We tried the requested font and the system font. No joy. We have to give up.
    186                 LOG_ERROR("unable to initialize with font %@ at %@", initialFont.get(), filePath);
     153                LOG_ERROR("unable to initialize with font %@", initialFont.get());
    187154                failedSetup = true;
    188155            }
     
    190157
    191158        // Report the problem.
    192         LOG_ERROR("Corrupt font detected, using %@ in place of %@ located at \"%@\".",
    193             [m_platformData.font() familyName], [initialFont.get() familyName], filePath);
     159        LOG_ERROR("Corrupt font detected, using %@ in place of %@.",
     160            [m_platformData.font() familyName], [initialFont.get() familyName]);
    194161    }
    195162
Note: See TracChangeset for help on using the changeset viewer.