Changeset 92553 in webkit


Ignore:
Timestamp:
Aug 6, 2011 10:00:48 AM (13 years ago)
Author:
mitz@apple.com
Message:

Move the shared LineBreakIteratorPool from ThreadGlobalData into its own ThreadSpecific
https://bugs.webkit.org/show_bug.cgi?id=65809

Reviewed by Darin Adler and Sam Weinig.

  • platform/ThreadGlobalData.cpp:

(WebCore::ThreadGlobalData::destroy): Removed code to clear the m_lineBreakIteratorPool member
variable, which was removed.

  • platform/ThreadGlobalData.h: Removed lineBreakIteratorPool() and associated member variable.
  • platform/text/LineBreakIteratorPoolICU.h:

(WebCore::LineBreakIteratorPool::sharedPool): Changed to return a thread-specific pool.

Location:
trunk/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r92552 r92553  
     12011-08-06  Dan Bernstein  <mitz@apple.com>
     2
     3        Move the shared LineBreakIteratorPool from ThreadGlobalData into its own ThreadSpecific
     4        https://bugs.webkit.org/show_bug.cgi?id=65809
     5
     6        Reviewed by Darin Adler and Sam Weinig.
     7
     8        * platform/ThreadGlobalData.cpp:
     9        (WebCore::ThreadGlobalData::destroy): Removed code to clear the m_lineBreakIteratorPool member
     10        variable, which was removed.
     11        * platform/ThreadGlobalData.h: Removed lineBreakIteratorPool() and associated member variable.
     12        * platform/text/LineBreakIteratorPoolICU.h:
     13        (WebCore::LineBreakIteratorPool::sharedPool): Changed to return a thread-specific pool.
     14
    1152011-08-06  Joseph Pecoraro  <joepeck@webkit.org>
    216
  • trunk/Source/WebCore/platform/ThreadGlobalData.cpp

    r92068 r92553  
    3636
    3737#if USE(ICU_UNICODE)
    38 #include "LineBreakIteratorPoolICU.h"
    3938#include "TextCodecICU.h"
    4039#endif
     
    8483}
    8584
    86 #if USE(ICU_UNICODE)
    87 LineBreakIteratorPool& ThreadGlobalData::lineBreakIteratorPool()
    88 {
    89     if (!m_lineBreakIteratorPool)
    90         m_lineBreakIteratorPool = LineBreakIteratorPool::create();
    91     return *m_lineBreakIteratorPool;
    92 }
    93 #endif
    94 
    9585void ThreadGlobalData::destroy()
    9686{
     
    10393    delete m_cachedConverterICU;
    10494    m_cachedConverterICU = 0;
    105     m_lineBreakIteratorPool = nullptr;
    10695#endif
    10796
  • trunk/Source/WebCore/platform/ThreadGlobalData.h

    r89878 r92553  
    4343
    4444    class EventNames;
    45     class LineBreakIteratorPool;
    4645    class ThreadTimers;
    4746
     
    6160#if USE(ICU_UNICODE)
    6261        ICUConverterWrapper& cachedConverterICU() { return *m_cachedConverterICU; }
    63         LineBreakIteratorPool& lineBreakIteratorPool();
    6462#endif
    6563
     
    7876#if USE(ICU_UNICODE)
    7977        ICUConverterWrapper* m_cachedConverterICU;
    80         OwnPtr<LineBreakIteratorPool> m_lineBreakIteratorPool;
    8178#endif
    8279
  • trunk/Source/WebCore/platform/text/LineBreakIteratorPoolICU.h

    r89878 r92553  
    2828
    2929#include "TextBreakIteratorInternalICU.h"
    30 #include "ThreadGlobalData.h"
    3130#include <unicode/ubrk.h>
    3231#include <wtf/Assertions.h>
    3332#include <wtf/HashMap.h>
    3433#include <wtf/PassOwnPtr.h>
     34#include <wtf/ThreadSpecific.h>
     35#include <wtf/text/AtomicString.h>
    3536#include <wtf/text/CString.h>
    3637
     
    4243    static LineBreakIteratorPool& sharedPool()
    4344    {
    44         return threadGlobalData().lineBreakIteratorPool();
     45        static WTF::ThreadSpecific<LineBreakIteratorPool>* pool = new WTF::ThreadSpecific<LineBreakIteratorPool>;
     46        return **pool;
    4547    }
    4648
     
    9395    Pool m_pool;
    9496    HashMap<UBreakIterator*, AtomicString> m_vendedIterators;
     97
     98    friend WTF::ThreadSpecific<LineBreakIteratorPool>::operator LineBreakIteratorPool*();
    9599};
    96100
Note: See TracChangeset for help on using the changeset viewer.