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

Unified Diff: Source/modules/encoding/TextDecoder.cpp

Issue 356703002: Use IDL argument default values in modules/encoding/ (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 6 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
« no previous file with comments | « no previous file | Source/modules/encoding/TextDecoder.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/encoding/TextDecoder.cpp
diff --git a/Source/modules/encoding/TextDecoder.cpp b/Source/modules/encoding/TextDecoder.cpp
index 59e5e2603d55acf79e50a07ef99bdde965994d4b..2de005cffaa1dcc2a297ea2e57727f0a8cc0a0e2 100644
--- a/Source/modules/encoding/TextDecoder.cpp
+++ b/Source/modules/encoding/TextDecoder.cpp
@@ -41,13 +41,11 @@ namespace WebCore {
TextDecoder* TextDecoder::create(const String& label, const Dictionary& options, ExceptionState& exceptionState)
{
- const String& encodingLabel = label.isNull() ? String("utf-8") : label;
-
- WTF::TextEncoding encoding(encodingLabel);
+ WTF::TextEncoding encoding(label);
// The replacement encoding is not valid, but the Encoding API also
// rejects aliases of the replacement encoding.
if (!encoding.isValid() || !strcasecmp(encoding.name(), "replacement")) {
- exceptionState.throwTypeError("The encoding label provided ('" + encodingLabel + "') is invalid.");
+ exceptionState.throwTypeError("The encoding label provided ('" + label + "') is invalid.");
return 0;
}
« no previous file with comments | « no previous file | Source/modules/encoding/TextDecoder.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698