diff options
author | viettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-17 16:24:25 +0000 |
---|---|---|
committer | viettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-17 16:24:25 +0000 |
commit | 99922661cbee0b313a07115912316f93b2cd5c95 (patch) | |
tree | 0036de373dc2d878d2a3f2280054b1477c358bc5 /base | |
parent | dbba57ffa3c2f14bf5a3b16a47307188539df0b6 (diff) | |
download | chromium_src-99922661cbee0b313a07115912316f93b2cd5c95.zip chromium_src-99922661cbee0b313a07115912316f93b2cd5c95.tar.gz chromium_src-99922661cbee0b313a07115912316f93b2cd5c95.tar.bz2 |
Remove remaining deprecated wstring methods from base/values.{cc,h}.
BUG=23581
TEST=builds and passes tests
Review URL: http://codereview.chromium.org/3109025
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@56362 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r-- | base/json/json_writer_unittest.cc | 6 | ||||
-rw-r--r-- | base/values.cc | 63 | ||||
-rw-r--r-- | base/values.h | 21 |
3 files changed, 3 insertions, 87 deletions
diff --git a/base/json/json_writer_unittest.cc b/base/json/json_writer_unittest.cc index 7d8db69..937d083 100644 --- a/base/json/json_writer_unittest.cc +++ b/base/json/json_writer_unittest.cc @@ -50,10 +50,10 @@ TEST(JSONWriterTest, Writing) { // list list nesting, etc. DictionaryValue root_dict; ListValue* list = new ListValue; - root_dict.Set(L"list", list); + root_dict.Set("list", list); DictionaryValue* inner_dict = new DictionaryValue; list->Append(inner_dict); - inner_dict->SetInteger(L"inner int", 10); + inner_dict->SetInteger("inner int", 10); ListValue* inner_list = new ListValue; list->Append(inner_list); list->Append(Value::CreateBooleanValue(true)); @@ -89,7 +89,7 @@ TEST(JSONWriterTest, Writing) { ASSERT_EQ("{\"a.b\":3,\"c\":2,\"d.e.f\":{\"g.h.i.j\":1}}", output_js); DictionaryValue period_dict3; - period_dict3.Set(L"a.b", Value::CreateIntegerValue(2)); + period_dict3.Set("a.b", Value::CreateIntegerValue(2)); period_dict3.SetWithoutPathExpansion("a.b", Value::CreateIntegerValue(1)); JSONWriter::Write(&period_dict3, false, &output_js); ASSERT_EQ("{\"a\":{\"b\":2},\"a.b\":1}", output_js); diff --git a/base/values.cc b/base/values.cc index 20e6175..926202e 100644 --- a/base/values.cc +++ b/base/values.cc @@ -224,14 +224,6 @@ StringValue::StringValue(const string16& in_value) value_(UTF16ToUTF8(in_value)) { } -#if !defined(WCHAR_T_IS_UTF16) -// TODO(viettrungluu): Deprecated and to be removed: -StringValue::StringValue(const std::wstring& in_value) - : Value(TYPE_STRING), - value_(WideToUTF8(in_value)) { -} -#endif - StringValue::~StringValue() { } @@ -360,11 +352,6 @@ bool DictionaryValue::HasKey(const std::string& key) const { return current_entry != dictionary_.end(); } -// TODO(viettrungluu): Deprecated and to be removed: -bool DictionaryValue::HasKey(const std::wstring& key) const { - return HasKey(WideToUTF8(key)); -} - void DictionaryValue::Clear() { ValueMap::iterator dict_iterator = dictionary_.begin(); while (dict_iterator != dictionary_.end()) { @@ -399,11 +386,6 @@ void DictionaryValue::Set(const std::string& path, Value* in_value) { current_dictionary->SetWithoutPathExpansion(current_path, in_value); } -// TODO(viettrungluu): Deprecated and to be removed: -void DictionaryValue::Set(const std::wstring& path, Value* in_value) { - Set(WideToUTF8(path), in_value); -} - void DictionaryValue::SetBoolean(const std::string& path, bool in_value) { Set(path, CreateBooleanValue(in_value)); } @@ -426,41 +408,6 @@ void DictionaryValue::SetString(const std::string& path, Set(path, CreateStringValue(in_value)); } -// TODO(viettrungluu): Deprecated and to be removed: -void DictionaryValue::SetBoolean(const std::wstring& path, bool in_value) { - Set(path, CreateBooleanValue(in_value)); -} - -// TODO(viettrungluu): Deprecated and to be removed: -void DictionaryValue::SetInteger(const std::wstring& path, int in_value) { - Set(path, CreateIntegerValue(in_value)); -} - -// TODO(viettrungluu): Deprecated and to be removed: -void DictionaryValue::SetReal(const std::wstring& path, double in_value) { - Set(path, CreateRealValue(in_value)); -} - -// TODO(viettrungluu): Deprecated and to be removed: -void DictionaryValue::SetString(const std::wstring& path, - const std::string& in_value) { - Set(path, CreateStringValue(in_value)); -} - -// TODO(viettrungluu): Deprecated and to be removed: -void DictionaryValue::SetString(const std::wstring& path, - const string16& in_value) { - Set(path, CreateStringValue(in_value)); -} - -#if !defined(WCHAR_T_IS_UTF16) -// TODO(viettrungluu): Deprecated and to be removed: -void DictionaryValue::SetString(const std::wstring& path, - const std::wstring& in_value) { - Set(WideToUTF8(path), CreateStringValue(WideToUTF8(in_value))); -} -#endif - void DictionaryValue::SetWithoutPathExpansion(const std::string& key, Value* in_value) { // If there's an existing value here, we need to delete it, because @@ -492,11 +439,6 @@ bool DictionaryValue::Get(const std::string& path, Value** out_value) const { return current_dictionary->GetWithoutPathExpansion(current_path, out_value); } -// TODO(viettrungluu): Deprecated and to be removed: -bool DictionaryValue::Get(const std::wstring& path, Value** out_value) const { - return Get(WideToUTF8(path), out_value); -} - bool DictionaryValue::GetBoolean(const std::string& path, bool* bool_value) const { Value* value; @@ -681,11 +623,6 @@ bool DictionaryValue::Remove(const std::string& path, Value** out_value) { out_value); } -// TODO(viettrungluu): Deprecated and to be removed: -bool DictionaryValue::Remove(const std::wstring& path, Value** out_value) { - return Remove(WideToUTF8(path), out_value); -} - bool DictionaryValue::RemoveWithoutPathExpansion(const std::string& key, Value** out_value) { DCHECK(IsStringUTF8(key)); diff --git a/base/values.h b/base/values.h index 479e0fc..b729b52 100644 --- a/base/values.h +++ b/base/values.h @@ -146,11 +146,6 @@ class StringValue : public Value { // Initializes a StringValue with a string16. explicit StringValue(const string16& in_value); -#if !defined(WCHAR_T_IS_UTF16) - // Initializes a StringValue with a wide character string. - /*DEPRECATED*/explicit StringValue(const std::wstring& in_value); -#endif - ~StringValue(); // Subclassed methods @@ -202,7 +197,6 @@ class BinaryValue: public Value { // DictionaryValue provides a key-value dictionary with (optional) "path" // parsing for recursive access; see the comment at the top of the file. Keys // are |std::string|s and should be UTF-8 encoded. -// TODO(viettrungluu): Things marked DEPRECATED will be removed. crbug.com/23581 class DictionaryValue : public Value { public: DictionaryValue(); @@ -214,7 +208,6 @@ class DictionaryValue : public Value { // Returns true if the current dictionary has a value for the given key. bool HasKey(const std::string& key) const; - /*DEPRECATED*/bool HasKey(const std::wstring& key) const; // Returns the number of Values in this dictionary. size_t size() const { return dictionary_.size(); } @@ -235,7 +228,6 @@ class DictionaryValue : public Value { // Note that the dictionary takes ownership of the value referenced by // |in_value|, and therefore |in_value| must be non-NULL. void Set(const std::string& path, Value* in_value); - /*DEPRECATED*/void Set(const std::wstring& path, Value* in_value); // Convenience forms of Set(). These methods will replace any existing // value at that path, even if it has a different type. @@ -244,17 +236,6 @@ class DictionaryValue : public Value { void SetReal(const std::string& path, double in_value); void SetString(const std::string& path, const std::string& 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); -#endif // Like Set(), but without special treatment of '.'. This allows e.g. URLs to // be used as paths. @@ -268,7 +249,6 @@ class DictionaryValue : public Value { // Otherwise, it will return false and |out_value| will be untouched. // Note that the dictionary always owns the value that's returned. bool Get(const std::string& path, Value** out_value) const; - /*DEPRECATED*/bool Get(const std::wstring& path, Value** out_value) const; // These are convenience forms of Get(). The value will be retrieved // and the return value will be true if the path is valid and the value at @@ -306,7 +286,6 @@ class DictionaryValue : public Value { // be deleted. This method returns true if |path| is a valid path; otherwise // it will return false and the DictionaryValue object will be unchanged. bool Remove(const std::string& path, Value** out_value); - /*DEPRECATED*/bool Remove(const std::wstring& path, Value** out_value); // Like Remove(), but without special treatment of '.'. This allows e.g. URLs // to be used as paths. |