Chromium Code Reviews| Index: third_party/WebKit/Source/modules/encoding/TextEncoder.cpp |
| diff --git a/third_party/WebKit/Source/modules/encoding/TextEncoder.cpp b/third_party/WebKit/Source/modules/encoding/TextEncoder.cpp |
| index 72bb04deffb1d9bac4bf2f3f8c98e2f19f122f5c..4b23c2dd7d91a83a63d6b34698e2e1f66248a345 100644 |
| --- a/third_party/WebKit/Source/modules/encoding/TextEncoder.cpp |
| +++ b/third_party/WebKit/Source/modules/encoding/TextEncoder.cpp |
| @@ -32,7 +32,7 @@ |
| #include "bindings/core/v8/ExceptionState.h" |
| #include "core/dom/ExecutionContext.h" |
| -#include "core/frame/UseCounter.h" |
| +// #include "core/frame/UseCounter.h" |
|
jsbell
2016/04/06 18:03:22
Delete, don't comment it out.
lpan
2016/04/09 03:25:15
Done.
|
| #include "modules/encoding/Encoding.h" |
| #include "wtf/text/CString.h" |
| #include "wtf/text/TextEncodingRegistry.h" |
| @@ -48,14 +48,11 @@ TextEncoder* TextEncoder::create(ExecutionContext* context, const String& utfLab |
| } |
| String name(encoding.name()); |
|
jsbell
2016/04/06 18:03:23
This block can be removed.
lpan
2016/04/09 03:25:16
Done.
|
| - if (name != "UTF-8" && name != "UTF-16LE" && name != "UTF-16BE") { |
| - exceptionState.throwRangeError("The encoding provided ('" + utfLabel + "') is not one of 'utf-8', 'utf-16', or 'utf-16be'."); |
| + if (name != "UTF-8" && name != "utf-8") { |
| + exceptionState.throwRangeError("The encoding provided ('" + utfLabel + "') is not 'utf-8'."); |
| return 0; |
| } |
| - if (name == "UTF-16LE" || name == "UTF-16BE") |
| - UseCounter::count(context, UseCounter::TextEncoderUTF16); |
| - |
| return new TextEncoder(encoding); |
|
jsbell
2016/04/06 18:03:22
The TextEncoding construction can even be done inl
lpan
2016/04/09 03:25:16
Acknowledged.
|
| } |
| @@ -72,7 +69,7 @@ TextEncoder::~TextEncoder() |
| String TextEncoder::encoding() const |
| { |
| String name = String(m_encoding.name()).lower(); |
| - ASSERT(name == "utf-8" || name == "utf-16le" || name == "utf-16be"); |
| + ASSERT(name == "utf-8"); |
| return name; |
| } |