Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(509)

Unified Diff: third_party/WebKit/Source/wtf/text/TextCodecReplacement.cpp

Issue 1611343002: wtf reformat test Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: pydent Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/wtf/text/TextCodecReplacement.cpp
diff --git a/third_party/WebKit/Source/wtf/text/TextCodecReplacement.cpp b/third_party/WebKit/Source/wtf/text/TextCodecReplacement.cpp
index a3b399987b6968819de7cbd5414f79a5c628d228..ffaf51b0ce551b125f3c76e3031a50bb6e6f7149 100644
--- a/third_party/WebKit/Source/wtf/text/TextCodecReplacement.cpp
+++ b/third_party/WebKit/Source/wtf/text/TextCodecReplacement.cpp
@@ -10,44 +10,44 @@
namespace WTF {
-TextCodecReplacement::TextCodecReplacement()
- : m_sentEOF(false)
-{
+TextCodecReplacement::TextCodecReplacement() : m_sentEOF(false) {}
+
+void TextCodecReplacement::registerEncodingNames(
+ EncodingNameRegistrar registrar) {
+ // The 'replacement' label itself should not be referenceable by
+ // resources or script - it's a specification convenience - but much of
+ // the wtf/text API asserts that an encoding name is a label for itself.
+ // This is handled in TextEncoding by marking it as not valid.
+ registrar("replacement", "replacement");
+
+ registrar("csiso2022kr", "replacement");
+ registrar("hz-gb-2312", "replacement");
+ registrar("iso-2022-cn", "replacement");
+ registrar("iso-2022-cn-ext", "replacement");
+ registrar("iso-2022-kr", "replacement");
}
-void TextCodecReplacement::registerEncodingNames(EncodingNameRegistrar registrar)
-{
- // The 'replacement' label itself should not be referenceable by
- // resources or script - it's a specification convenience - but much of
- // the wtf/text API asserts that an encoding name is a label for itself.
- // This is handled in TextEncoding by marking it as not valid.
- registrar("replacement", "replacement");
-
- registrar("csiso2022kr", "replacement");
- registrar("hz-gb-2312", "replacement");
- registrar("iso-2022-cn", "replacement");
- registrar("iso-2022-cn-ext", "replacement");
- registrar("iso-2022-kr", "replacement");
+static PassOwnPtr<TextCodec> newStreamingTextDecoderReplacement(
+ const TextEncoding&,
+ const void*) {
+ return adoptPtr(new TextCodecReplacement);
}
-static PassOwnPtr<TextCodec> newStreamingTextDecoderReplacement(const TextEncoding&, const void*)
-{
- return adoptPtr(new TextCodecReplacement);
+void TextCodecReplacement::registerCodecs(TextCodecRegistrar registrar) {
+ registrar("replacement", newStreamingTextDecoderReplacement, 0);
}
-void TextCodecReplacement::registerCodecs(TextCodecRegistrar registrar)
-{
- registrar("replacement", newStreamingTextDecoderReplacement, 0);
+String TextCodecReplacement::decode(const char*,
+ size_t,
+ FlushBehavior,
+ bool,
+ bool& sawError) {
+ sawError = true;
+ if (m_sentEOF)
+ return String();
+
+ m_sentEOF = true;
+ return String(&replacementCharacter, 1);
}
-String TextCodecReplacement::decode(const char*, size_t, FlushBehavior, bool, bool& sawError)
-{
- sawError = true;
- if (m_sentEOF)
- return String();
-
- m_sentEOF = true;
- return String(&replacementCharacter, 1);
-}
-
-} // namespace WTF
+} // namespace WTF

Powered by Google App Engine
This is Rietveld 408576698