summaryrefslogtreecommitdiffstats
path: root/base
diff options
context:
space:
mode:
authorviettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-14 03:32:17 +0000
committerviettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-14 03:32:17 +0000
commit8b6e84a68798718a3dd66bc82bdbed50cff79f00 (patch)
treef69809fda4ad0423d8d5ac9d7f2030efbd8ab4f2 /base
parenta60153f0ada9823286a54b8b8852526e3e21a5a1 (diff)
downloadchromium_src-8b6e84a68798718a3dd66bc82bdbed50cff79f00.zip
chromium_src-8b6e84a68798718a3dd66bc82bdbed50cff79f00.tar.gz
chromium_src-8b6e84a68798718a3dd66bc82bdbed50cff79f00.tar.bz2
Remove deprecated wstring DictionaryValue::SetWithoutPathExpansion().
BUG=23581 TEST=builds and passes tests Review URL: http://codereview.chromium.org/3121017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@56128 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r--base/json/json_reader.cc2
-rw-r--r--base/json/json_writer_unittest.cc12
-rw-r--r--base/values.cc6
-rw-r--r--base/values.h2
-rw-r--r--base/values_unittest.cc18
5 files changed, 8 insertions, 32 deletions
diff --git a/base/json/json_reader.cc b/base/json/json_reader.cc
index 0d6abc4..0818f93 100644
--- a/base/json/json_reader.cc
+++ b/base/json/json_reader.cc
@@ -295,7 +295,7 @@ Value* JSONReader::BuildValue(bool is_root) {
return NULL;
// Convert the key into a wstring.
- std::wstring dict_key;
+ std::string dict_key;
bool success = dict_key_value->GetAsString(&dict_key);
DCHECK(success);
diff --git a/base/json/json_writer_unittest.cc b/base/json/json_writer_unittest.cc
index e7d0f05..7d8db69 100644
--- a/base/json/json_writer_unittest.cc
+++ b/base/json/json_writer_unittest.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -79,18 +79,18 @@ TEST(JSONWriterTest, Writing) {
// Test keys with periods
DictionaryValue period_dict;
- period_dict.SetWithoutPathExpansion(L"a.b", Value::CreateIntegerValue(3));
- period_dict.SetWithoutPathExpansion(L"c", Value::CreateIntegerValue(2));
+ period_dict.SetWithoutPathExpansion("a.b", Value::CreateIntegerValue(3));
+ period_dict.SetWithoutPathExpansion("c", Value::CreateIntegerValue(2));
DictionaryValue* period_dict2 = new DictionaryValue;
- period_dict2->SetWithoutPathExpansion(L"g.h.i.j",
+ period_dict2->SetWithoutPathExpansion("g.h.i.j",
Value::CreateIntegerValue(1));
- period_dict.SetWithoutPathExpansion(L"d.e.f", period_dict2);
+ period_dict.SetWithoutPathExpansion("d.e.f", period_dict2);
JSONWriter::Write(&period_dict, false, &output_js);
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.SetWithoutPathExpansion(L"a.b", Value::CreateIntegerValue(1));
+ 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 1a1695c..d4b01c8 100644
--- a/base/values.cc
+++ b/base/values.cc
@@ -497,12 +497,6 @@ void DictionaryValue::SetWithoutPathExpansion(const std::string& key,
dictionary_[key] = in_value;
}
-// TODO(viettrungluu): Deprecated and to be removed:
-void DictionaryValue::SetWithoutPathExpansion(const std::wstring& key,
- Value* in_value) {
- SetWithoutPathExpansion(WideToUTF8(key), in_value);
-}
-
bool DictionaryValue::Get(const std::string& path, Value** out_value) const {
DCHECK(IsStringUTF8(path));
std::string current_path(path);
diff --git a/base/values.h b/base/values.h
index 54230c9..b4e0892 100644
--- a/base/values.h
+++ b/base/values.h
@@ -268,8 +268,6 @@ class DictionaryValue : public Value {
// Like Set(), but without special treatment of '.'. This allows e.g. URLs to
// be used as paths.
void SetWithoutPathExpansion(const std::string& key, Value* in_value);
- /*DEPRECATED*/void SetWithoutPathExpansion(const std::wstring& key,
- Value* in_value);
// Gets the Value associated with the given path starting from this object.
// A path has the form "<key>" or "<key>.<key>.[...]", where "." indexes
diff --git a/base/values_unittest.cc b/base/values_unittest.cc
index 81bd675..a3e7353 100644
--- a/base/values_unittest.cc
+++ b/base/values_unittest.cc
@@ -494,22 +494,6 @@ TEST_F(ValuesTest, DictionaryWithoutPathExpansion) {
EXPECT_EQ(Value::TYPE_NULL, value4->GetType());
}
-// TODO(viettrungluu): deprecate:
-TEST_F(ValuesTest, DictionaryWithoutPathExpansionDeprecated) {
- DictionaryValue dict;
- dict.Set(L"this.is.expanded", Value::CreateNullValue());
- dict.SetWithoutPathExpansion(L"this.isnt.expanded", Value::CreateNullValue());
-
- EXPECT_FALSE(dict.HasKey(L"this.is.expanded"));
- EXPECT_TRUE(dict.HasKey(L"this"));
- Value* value1;
- EXPECT_TRUE(dict.Get(L"this", &value1));
-
- EXPECT_TRUE(dict.HasKey(L"this.isnt.expanded"));
- Value* value3;
- EXPECT_FALSE(dict.Get(L"this.isnt.expanded", &value3));
-}
-
TEST_F(ValuesTest, DeepCopy) {
DictionaryValue original_dict;
Value* original_null = Value::CreateNullValue();
@@ -936,7 +920,7 @@ TEST_F(ValuesTest, RemoveEmptyChildrenDeprecated) {
// Remove empty lists and dictionaries.
root->Set(L"empty_dict", new DictionaryValue);
root->Set(L"empty_list", new ListValue);
- root->SetWithoutPathExpansion(L"a.b.c.d.e", new DictionaryValue);
+ root->SetWithoutPathExpansion("a.b.c.d.e", new DictionaryValue);
root.reset(root->DeepCopyWithoutEmptyChildren());
EXPECT_TRUE(root->empty());