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

Unified Diff: Source/wtf/text/Base64.h

Issue 22796004: Simplify WTF::base64Decode() after r154538 (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Restore the enum's original name Created 7 years, 4 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 | « Source/core/page/DOMWindowBase64.cpp ('k') | Source/wtf/text/Base64.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/wtf/text/Base64.h
diff --git a/Source/wtf/text/Base64.h b/Source/wtf/text/Base64.h
index 7ccd8d1c7c858a408dba87e4e8803375c3c1f77c..4ebebc82dcb691503bf98e0f6ee635f6e48e35c2 100644
--- a/Source/wtf/text/Base64.h
+++ b/Source/wtf/text/Base64.h
@@ -39,17 +39,13 @@ enum Base64EncodePolicy {
Base64InsertLFs
};
-enum Base64InvalidCharactersPolicy {
+enum Base64DecodePolicy {
+ Base64FailOnInvalidCharacterOrExcessPadding,
Base64FailOnInvalidCharacter,
Base64IgnoreWhitespace,
Base64IgnoreInvalidCharacters
};
-enum Base64PaddingValidationPolicy {
- Base64NoPaddingValidation,
- Base64StrictPaddingValidation
-};
-
WTF_EXPORT void base64Encode(const char*, unsigned, Vector<char>&, Base64EncodePolicy = Base64DoNotInsertLFs);
WTF_EXPORT void base64Encode(const Vector<char>&, Vector<char>&, Base64EncodePolicy = Base64DoNotInsertLFs);
WTF_EXPORT void base64Encode(const CString&, Vector<char>&, Base64EncodePolicy = Base64DoNotInsertLFs);
@@ -57,9 +53,9 @@ WTF_EXPORT String base64Encode(const char*, unsigned, Base64EncodePolicy = Base6
WTF_EXPORT String base64Encode(const Vector<char>&, Base64EncodePolicy = Base64DoNotInsertLFs);
WTF_EXPORT String base64Encode(const CString&, Base64EncodePolicy = Base64DoNotInsertLFs);
-WTF_EXPORT bool base64Decode(const String&, Vector<char>&, Base64InvalidCharactersPolicy = Base64FailOnInvalidCharacter, Base64PaddingValidationPolicy = Base64NoPaddingValidation);
-WTF_EXPORT bool base64Decode(const Vector<char>&, Vector<char>&, Base64InvalidCharactersPolicy = Base64FailOnInvalidCharacter, Base64PaddingValidationPolicy = Base64NoPaddingValidation);
-WTF_EXPORT bool base64Decode(const char*, unsigned, Vector<char>&, Base64InvalidCharactersPolicy = Base64FailOnInvalidCharacter, Base64PaddingValidationPolicy = Base64NoPaddingValidation);
+WTF_EXPORT bool base64Decode(const String&, Vector<char>&, Base64DecodePolicy = Base64FailOnInvalidCharacter);
+WTF_EXPORT bool base64Decode(const Vector<char>&, Vector<char>&, Base64DecodePolicy = Base64FailOnInvalidCharacter);
+WTF_EXPORT bool base64Decode(const char*, unsigned, Vector<char>&, Base64DecodePolicy = Base64FailOnInvalidCharacter);
inline void base64Encode(const Vector<char>& in, Vector<char>& out, Base64EncodePolicy policy)
{
@@ -86,13 +82,11 @@ inline String base64Encode(const CString& in, Base64EncodePolicy policy)
using WTF::Base64EncodePolicy;
using WTF::Base64DoNotInsertLFs;
using WTF::Base64InsertLFs;
-using WTF::Base64InvalidCharactersPolicy;
+using WTF::Base64DecodePolicy;
+using WTF::Base64FailOnInvalidCharacterOrExcessPadding;
using WTF::Base64FailOnInvalidCharacter;
using WTF::Base64IgnoreWhitespace;
using WTF::Base64IgnoreInvalidCharacters;
-using WTF::Base64PaddingValidationPolicy;
-using WTF::Base64NoPaddingValidation;
-using WTF::Base64StrictPaddingValidation;
using WTF::base64Encode;
using WTF::base64Decode;
« no previous file with comments | « Source/core/page/DOMWindowBase64.cpp ('k') | Source/wtf/text/Base64.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698