Reviewed by Anders.
authordarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 3 May 2007 16:23:53 +0000 (16:23 +0000)
committerdarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 3 May 2007 16:23:53 +0000 (16:23 +0000)
commitb8a8971bee799ecfbbc80463de6f5a0beab712f7
tree53e1b77aebedc30b52ee11fbc98ab4a0ed8435ca
parent6a51a994f9e543766859417d51a24583ed8b550a
    Reviewed by Anders.

        - make ICU initialization lazy to speed up application start-up time
          (when it includes an initial webpage load)

        * platform/TextCodecICU.h: Replaced registerEncodingNames and
        registerCodecs with registerBaseEncodingNames, registerBaseCodecs,
        registerExtendedEncodingNames, and registerExtendedCodecs.
        * platform/TextCodecICU.cpp:
        (WebCore::newTextCodecICU): Moved up to the top of the file.
        (WebCore::TextCodecICU::registerBaseEncodingNames): Added. Registers
        just UTF-8.
        (WebCore::TextCodecICU::registerBaseCodecs): Ditto.
        (WebCore::TextCodecICU::registerExtendedEncodingNames): Renamed.
        (WebCore::TextCodecICU::registerExtendedCodecs): Ditto.
        (WebCore::TextCodecICU::createICUConverter): Compare with the name
        "GBK" in a way that does not require extending the maps.

        * platform/TextEncoding.cpp:
        (WebCore::TextEncoding::usesVisualOrdering): Added code so this will
        just return false if we haven't used any extended encoding names yet.
        The result will be correct, and we won't ask for an encoding name that
        will require registering the extended encoding names.
        (WebCore::TextEncoding::isJapanese): Ditto.
        (WebCore::TextEncoding::backslashAsCurrencySymbol): Ditto, but return
        a backslash instead of false.

        * platform/TextEncodingRegistry.h: Added a new function named
         noExtendedTextEncodingNameUsed.
        * platform/TextEncodingRegistry.cpp:
        (WebCore::buildBaseTextCodecMaps): Added. Registers the base encodings,
        including Latin-1 because it's the default, and the UTF encodings.
        (WebCore::extendTextCodecMaps): Added. Registers all the other encodings.
        (WebCore::newTextCodec): Removed the all to buildTextCodecMap because
        we always build the map when making the canonical encoding name.
        (WebCore::atomicCanonicalTextEncodingName): Changed code to build only
        the base maps at first, then extend the maps the first time we run into
        a name we don't know.
        (WebCore::noExtendedTextEncodingNameUsed): Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@21227 268f45cc-cd09-0410-ab3c-d52691b4dbfc
WebCore/ChangeLog
WebCore/platform/TextCodecICU.cpp
WebCore/platform/TextCodecICU.h
WebCore/platform/TextEncoding.cpp
WebCore/platform/TextEncodingRegistry.cpp
WebCore/platform/TextEncodingRegistry.h