2009-01-30 Darin Adler <darin@apple.com>
authordarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 31 Jan 2009 02:31:32 +0000 (02:31 +0000)
committerdarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 31 Jan 2009 02:31:32 +0000 (02:31 +0000)
commit7cbb17dbafbca3b47e0071c3fe92694003d6b250
tree75d248a31b111f2f60210f215301b0e88f689026
parentfed0ba46febc7aee0339a70b2c16e4d9a69285a9
2009-01-30  Darin Adler  <darin@apple.com>

        Reviewed by Mark Rowe.

        Bug 23622: create CFString and NSString objects from WebCore::String without copying the characters
        https://bugs.webkit.org/show_bug.cgi?id=23622

        * platform/text/cf/StringImplCF.cpp:
        (WebCore::StringWrapperCFAllocator::allocator): Added. Returns the allocator.
        (WebCore::StringWrapperCFAllocator::retain): Added. Callback for allocator.
        (WebCore::StringWrapperCFAllocator::release): Ditto.
        (WebCore::StringWrapperCFAllocator::copyDescription): Ditto.
        (WebCore::StringWrapperCFAllocator::allocate): Ditto.
        (WebCore::StringWrapperCFAllocator::reallocate): Ditto.
        (WebCore::StringWrapperCFAllocator::deallocate): Ditto.
        (WebCore::StringWrapperCFAllocator::preferredSize): Ditto.
        (WebCore::StringWrapperCFAllocator::create): Added. Creates the allocator, but
        returns 0 if garbage collection is enabled.
        (WebCore::StringImpl::createCFString): Use StringWrapperCFAllocator if possible.

        * platform/text/mac/StringImplMac.mm:
        (WebCore::StringImpl::operator NSString *): Use CFString and toll-free bridging,
        rather than using NSString directly. This lets NSString benefit from the above.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@40438 268f45cc-cd09-0410-ab3c-d52691b4dbfc
WebCore/ChangeLog
WebCore/platform/text/cf/StringImplCF.cpp
WebCore/platform/text/mac/StringImplMac.mm