Changeset 123541 in webkit


Ignore:
Timestamp:
Jul 24, 2012, 3:33:14 PM (13 years ago)
Author:
zmo@google.com
Message:

Unreviewed, rolling out r123504.
http://trac.webkit.org/changeset/123504
https://bugs.webkit.org/show_bug.cgi?id=92169

broke a bunch of text-related tests in chromium mac debug
(Requested by zhenyao on #webkit).

Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2012-07-24

  • platform/text/cf/StringCF.cpp:

(WTF::String::createCFString):

  • platform/text/cf/StringImplCF.cpp:

(WTF::StringImpl::createCFString):

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified trunk/Source/WebCore/ChangeLog

    r123537 r123541  
     12012-07-24  Sheriff Bot  <webkit.review.bot@gmail.com>
     2
     3        Unreviewed, rolling out r123504.
     4        http://trac.webkit.org/changeset/123504
     5        https://bugs.webkit.org/show_bug.cgi?id=92169
     6
     7        broke a bunch of text-related tests in chromium mac debug
     8        (Requested by zhenyao on #webkit).
     9
     10        * platform/text/cf/StringCF.cpp:
     11        (WTF::String::createCFString):
     12        * platform/text/cf/StringImplCF.cpp:
     13        (WTF::StringImpl::createCFString):
     14
    1152012-07-24  Kwang Yul Seo  <skyul@company100.net>
    216
  • TabularUnified trunk/Source/WebCore/platform/text/cf/StringCF.cpp

    r123504 r123541  
    4646{
    4747    if (!m_impl)
    48         return CFSTR("");
     48        return static_cast<CFStringRef>(CFRetain(CFSTR("")));
    4949
    5050    return m_impl->createCFString();
  • TabularUnified trunk/Source/WebCore/platform/text/cf/StringImplCF.cpp

    r123504 r123541  
    135135CFStringRef StringImpl::createCFString()
    136136{
    137     if (!m_length || !isMainThread()) {
    138         if (is8Bit())
    139             return CFStringCreateWithBytes(0, reinterpret_cast<const UInt8*>(characters8()), m_length, kCFStringEncodingISOLatin1, false);
    140         return CFStringCreateWithCharacters(0, reinterpret_cast<const UniChar*>(characters16()), m_length);
    141     }
    142     CFAllocatorRef allocator = StringWrapperCFAllocator::allocator();
     137    CFAllocatorRef allocator = (m_length && isMainThread()) ? StringWrapperCFAllocator::allocator() : 0;
     138    if (!allocator)
     139        return CFStringCreateWithCharacters(0, reinterpret_cast<const UniChar*>(characters()), m_length);
    143140
    144141    // Put pointer to the StringImpl in a global so the allocator can store it with the CFString.
     
    146143    StringWrapperCFAllocator::currentString = this;
    147144
    148     CFStringRef string;
    149     if (is8Bit())
    150         string = CFStringCreateWithBytesNoCopy(allocator, reinterpret_cast<const UInt8*>(characters8()), m_length, kCFStringEncodingISOLatin1, false, kCFAllocatorNull);
    151     else
    152         string = CFStringCreateWithCharactersNoCopy(allocator, reinterpret_cast<const UniChar*>(characters16()), m_length, kCFAllocatorNull);
     145    CFStringRef string = CFStringCreateWithCharactersNoCopy(allocator, reinterpret_cast<const UniChar*>(characters()), m_length, kCFAllocatorNull);
    153146
    154147    // The allocator cleared the global when it read it, but also clear it here just in case.
Note: See TracChangeset for help on using the changeset viewer.