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

Unified Diff: base/string_util.cc

Issue 113606: Add JSON-specific escaping, which has different rules from JS escaping. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 7 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 | « base/string_util.h ('k') | chrome/common/json_value_serializer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/string_util.cc
===================================================================
--- base/string_util.cc (revision 16481)
+++ base/string_util.cc (working copy)
@@ -37,35 +37,6 @@
const string16 s16;
};
-// Hack to convert any char-like type to its unsigned counterpart.
-// For example, it will convert char, signed char and unsigned char to unsigned
-// char.
-template<typename T>
-struct ToUnsigned {
- typedef T Unsigned;
-};
-
-template<>
-struct ToUnsigned<char> {
- typedef unsigned char Unsigned;
-};
-template<>
-struct ToUnsigned<signed char> {
- typedef unsigned char Unsigned;
-};
-template<>
-struct ToUnsigned<wchar_t> {
-#if defined(WCHAR_T_IS_UTF16)
- typedef unsigned short Unsigned;
-#elif defined(WCHAR_T_IS_UTF32)
- typedef uint32 Unsigned;
-#endif
-};
-template<>
-struct ToUnsigned<short> {
- typedef unsigned short Unsigned;
-};
-
// Used by ReplaceStringPlaceholders to track the position in the string of
// replaced parameters.
struct ReplacementOffset {
« no previous file with comments | « base/string_util.h ('k') | chrome/common/json_value_serializer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698