summaryrefslogtreecommitdiffstats
path: root/base
diff options
context:
space:
mode:
Diffstat (limited to 'base')
-rw-r--r--base/values.cc12
-rw-r--r--base/values.h8
-rw-r--r--base/values_unittest.cc2
3 files changed, 13 insertions, 9 deletions
diff --git a/base/values.cc b/base/values.cc
index 8fdd4ea..af801bc 100644
--- a/base/values.cc
+++ b/base/values.cc
@@ -448,8 +448,8 @@ void DictionaryValue::SetString(const std::string& path,
Set(path, CreateStringValue(in_value));
}
-void DictionaryValue::SetStringFromUTF16(const std::string& path,
- const string16& in_value) {
+void DictionaryValue::SetString(const std::string& path,
+ const string16& in_value) {
Set(path, CreateStringValue(in_value));
}
@@ -476,15 +476,17 @@ void DictionaryValue::SetString(const std::wstring& path,
// TODO(viettrungluu): Deprecated and to be removed:
void DictionaryValue::SetString(const std::wstring& path,
- const std::wstring& in_value) {
+ const string16& in_value) {
Set(path, CreateStringValue(in_value));
}
+#if !defined(WCHAR_T_IS_UTF16)
// TODO(viettrungluu): Deprecated and to be removed:
-void DictionaryValue::SetStringFromUTF16(const std::wstring& path,
- const string16& in_value) {
+void DictionaryValue::SetString(const std::wstring& path,
+ const std::wstring& in_value) {
Set(path, CreateStringValue(in_value));
}
+#endif
void DictionaryValue::SetWithoutPathExpansion(const std::string& key,
Value* in_value) {
diff --git a/base/values.h b/base/values.h
index 57139d8..39683a6 100644
--- a/base/values.h
+++ b/base/values.h
@@ -253,16 +253,18 @@ class DictionaryValue : public Value {
void SetInteger(const std::string& path, int in_value);
void SetReal(const std::string& path, double in_value);
void SetString(const std::string& path, const std::string& in_value);
- void SetStringFromUTF16(const std::string& path, const string16& in_value);
+ void SetString(const std::string& path, const string16& in_value);
/*DEPRECATED*/void SetBoolean(const std::wstring& path, bool in_value);
/*DEPRECATED*/void SetInteger(const std::wstring& path, int in_value);
/*DEPRECATED*/void SetReal(const std::wstring& path, double in_value);
/*DEPRECATED*/void SetString(const std::wstring& path,
const std::string& in_value);
/*DEPRECATED*/void SetString(const std::wstring& path,
+ const string16& in_value);
+#if !defined(WCHAR_T_IS_UTF16)
+ /*DEPRECATED*/void SetString(const std::wstring& path,
const std::wstring& in_value);
- /*DEPRECATED*/void SetStringFromUTF16(const std::wstring& path,
- const string16& in_value);
+#endif
// Like Set(), but without special treatment of '.'. This allows e.g. URLs to
// be used as paths.
diff --git a/base/values_unittest.cc b/base/values_unittest.cc
index 688e42b..d71280d 100644
--- a/base/values_unittest.cc
+++ b/base/values_unittest.cc
@@ -804,7 +804,7 @@ TEST_F(ValuesTest, Equals) {
dv.SetInteger("b", 2);
dv.SetReal("c", 2.5);
dv.SetString("d1", "string");
- dv.SetStringFromUTF16("d2", ASCIIToUTF16("http://google.com"));
+ dv.SetString("d2", ASCIIToUTF16("http://google.com"));
dv.Set("e", Value::CreateNullValue());
DictionaryValue* copy = static_cast<DictionaryValue*>(dv.DeepCopy());