2011-06-27 Joseph Pecoraro <joepeck@webkit.org>
authorjoepeck@webkit.org <joepeck@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 27 Jun 2011 23:57:48 +0000 (23:57 +0000)
committerjoepeck@webkit.org <joepeck@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 27 Jun 2011 23:57:48 +0000 (23:57 +0000)
commitfa382c8c408907566c81c4c4fe4d2e2d5cdc5574
treee2a0a1c04248fb0051a328c446d271d51b8643b1
parent0e64ec3ae58e600a613964527e4663ebe1b44fb3
2011-06-27  Joseph Pecoraro  <joepeck@webkit.org>

        Reviewed by Darin Adler.

        Allow non-main thread text drawing in ICU ports
        https://bugs.webkit.org/show_bug.cgi?id=63482

        Some ports allow multiple threads to draw strings.
        LineBreakIteratorPool is not thread safe and the existing
        ASSERT caught cases where multiple threads were trying
        to access the shared pool. This makes the pool a lazily
        created per-thread pool to allow for thread safe pool use.

        * platform/ThreadGlobalData.h:
        * platform/ThreadGlobalData.cpp:
        (WebCore::ThreadGlobalData::ThreadGlobalData): start with null.
        (WebCore::ThreadGlobalData::lineBreakIteratorPool): lazily create.
        (WebCore::ThreadGlobalData::destroy): delete.
        Manage the lifetime of the per-thread pool instance.

        * platform/text/LineBreakIteratorPoolICU.h:
        (WebCore::LineBreakIteratorPool::sharedPool):
        Use the per-thread pool instance and remove the ASSERT that
        this needs to be on the main thread.

        (WebCore::LineBreakIteratorPool::create):
        Create a PassOwnPtr so we can use OwnPtr on pools.

        (WebCore::LineBreakIteratorPool::LineBreakIteratorPool):
        Private now that there is a public create function.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@89878 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/platform/ThreadGlobalData.cpp
Source/WebCore/platform/ThreadGlobalData.h
Source/WebCore/platform/text/LineBreakIteratorPoolICU.h