2011-02-06 Darin Adler <darin@apple.com>
Reviewed by Antti Koivisto.
Add built-in decoder for UTF-8 for improved performance
https://bugs.webkit.org/show_bug.cgi?id=53898
Correct behavior is covered by existing tests.
* Android.mk: Added TextCodecUTF8.
* CMakeLists.txt: Ditto.
* GNUmakefile.am: Ditto.
* WebCore.gypi: Ditto.
* WebCore.pro: Ditto.
* WebCore.vcproj/WebCore.vcproj: Ditto.
* WebCore.xcodeproj/project.pbxproj: Ditto.
* platform/text/TextCodecICU.cpp: Removed registration of UTF-8
since that's now handled by the built-in UTF-8 codec.
(WebCore::TextCodecICU::registerEncodingNames): Renamed to remove
the word "extended" since all codecs from ICU are now extended.
(WebCore::TextCodecICU::registerCodecs): Ditto.
* platform/text/TextCodecICU.h: Ditto.
* platform/text/TextCodecUTF16.cpp:
(WebCore::TextCodecUTF16::decode): Added a FIXME about missing
error handling.
* platform/text/TextCodecUTF8.cpp: Added.
* platform/text/TextCodecUTF8.h: Added.
* platform/text/TextEncodingRegistry.cpp:
(WebCore::buildBaseTextCodecMaps): Added TextCodecUTF8, and
removed TextCodecICU, TextCodecBrew, and TextCodecWinCE.
(WebCore::extendTextCodecMaps): Updated names for
TextCodecICU and TextCodecWinCE.
* platform/text/brew/TextCodecBrew.cpp:
(WebCore::TextCodecBrew::registerEncodingNames): Renamed to remove
the word "extended" since all codecs from Brew are now extended.
(WebCore::TextCodecBrew::registerCodecs): Ditto.
* platform/text/brew/TextCodecBrew.h: Ditto.
* platform/text/gtk/TextCodecGtk.cpp:
(WebCore::TextCodecGtk::registerBaseEncodingNames): Removed
registration of UTF-8. It's questionable whether the other codecs
here are really basic. If we think they qualify, then we should
register them on other platforms, not just GTK.
(WebCore::TextCodecGtk::registerBaseCodecs): Ditto.
* platform/text/wince/TextCodecWinCE.cpp:
(WebCore::getCodePage): Removed special case for UTF-8 since we
no longer use this codec for UTF-8.
(WebCore::TextCodecWinCE::registerEncodingNames): Renamed to remove
the word "extended" since all codecs from WinCE are now extended.
(WebCore::TextCodecWinCE::registerCodecs): Ditto.
* platform/text/wince/TextCodecWinCE.h: Ditto.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@77819 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebCore/WebCore.pro b/Source/WebCore/WebCore.pro
index f7070e9..f0512aa 100644
--- a/Source/WebCore/WebCore.pro
+++ b/Source/WebCore/WebCore.pro
@@ -1273,6 +1273,7 @@
platform/text/TextCodecLatin1.cpp \
platform/text/TextCodecUserDefined.cpp \
platform/text/TextCodecUTF16.cpp \
+ platform/text/TextCodecUTF8.cpp \
platform/text/TextEncoding.cpp \
platform/text/TextEncodingDetectorNone.cpp \
platform/text/TextEncodingRegistry.cpp \
@@ -2228,6 +2229,7 @@
platform/text/TextCodecLatin1.h \
platform/text/TextCodecUserDefined.h \
platform/text/TextCodecUTF16.h \
+ platform/text/TextCodecUTF8.h \
platform/text/TextEncoding.h \
platform/text/TextEncodingRegistry.h \
platform/text/TextStream.h \