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

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

Issue 143943017: Added Base64 support in TextEncoder and TextDecoder. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 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: Source/modules/encoding/TextEncoder.cpp
diff --git a/Source/modules/encoding/TextEncoder.cpp b/Source/modules/encoding/TextEncoder.cpp
index 1a26de62da91172943bc0777b555554af6340709..5047b11e91b93f9b9644e91f32b6d4ad5dc68d41 100644
--- a/Source/modules/encoding/TextEncoder.cpp
+++ b/Source/modules/encoding/TextEncoder.cpp
@@ -50,8 +50,8 @@ PassRefPtr<TextEncoder> TextEncoder::create(const String& utfLabel, ExceptionSta
}
String name(encoding.name());
- if (name != "UTF-8" && name != "UTF-16LE" && name != "UTF-16BE") {
- exceptionState.throwTypeError("The encoding provided ('" + encodingLabel + "') is not one of 'utf-8', 'utf-16', or 'utf-16be'.");
+ if (name != "UTF-8" && name != "UTF-16LE" && name != "UTF-16BE" && name != "Base64") {
+ exceptionState.throwTypeError("The encoding provided ('" + encodingLabel + "') is not one of 'utf-8', 'utf-16', 'utf-16be', or 'base64'.");
return 0;
}
@@ -71,7 +71,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" || name == "utf-16le" || name == "utf-16be" || name == "base64");
return name;
}

Powered by Google App Engine
This is Rietveld 408576698