summaryrefslogtreecommitdiffstats
path: root/base
diff options
context:
space:
mode:
authorviettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-14 01:49:14 +0000
committerviettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-14 01:49:14 +0000
commit9001854dba5933cfd3cecb2e7a1bb73c50cb57d2 (patch)
tree6908aa44e120a3666e1ab824e69504d5ad65bcdd /base
parent67dd36a9a1022bc9a63f74740dff610536e536e8 (diff)
downloadchromium_src-9001854dba5933cfd3cecb2e7a1bb73c50cb57d2.zip
chromium_src-9001854dba5933cfd3cecb2e7a1bb73c50cb57d2.tar.gz
chromium_src-9001854dba5933cfd3cecb2e7a1bb73c50cb57d2.tar.bz2
Remove deprecated wstring DictionaryValue::Get{Dictionary,List}WithoutPathExpansion() overloads.
BUG=23581 TEST=builds and passes tests Review URL: http://codereview.chromium.org/3163015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@56121 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r--base/json/json_reader_unittest.cc24
-rw-r--r--base/values.cc13
-rw-r--r--base/values.h4
-rw-r--r--base/values_unittest.cc4
4 files changed, 12 insertions, 33 deletions
diff --git a/base/json/json_reader_unittest.cc b/base/json/json_reader_unittest.cc
index 71649df..c05fcda 100644
--- a/base/json/json_reader_unittest.cc
+++ b/base/json/json_reader_unittest.cc
@@ -302,10 +302,10 @@ TEST(JSONReaderTest, Reading) {
ASSERT_TRUE(root->IsType(Value::TYPE_DICTIONARY));
DictionaryValue* dict_val = static_cast<DictionaryValue*>(root.get());
real_val = 0.0;
- ASSERT_TRUE(dict_val->GetReal(L"number", &real_val));
+ ASSERT_TRUE(dict_val->GetReal("number", &real_val));
ASSERT_DOUBLE_EQ(9.87654321, real_val);
Value* null_val = NULL;
- ASSERT_TRUE(dict_val->Get(L"null", &null_val));
+ ASSERT_TRUE(dict_val->Get("null", &null_val));
ASSERT_TRUE(null_val->IsType(Value::TYPE_NULL));
str_val.clear();
ASSERT_TRUE(dict_val->GetString(L"S", &str_val));
@@ -342,15 +342,15 @@ TEST(JSONReaderTest, Reading) {
ASSERT_TRUE(root->IsType(Value::TYPE_DICTIONARY));
dict_val = static_cast<DictionaryValue*>(root.get());
DictionaryValue* inner_dict = NULL;
- ASSERT_TRUE(dict_val->GetDictionary(L"inner", &inner_dict));
+ ASSERT_TRUE(dict_val->GetDictionary("inner", &inner_dict));
ListValue* inner_array = NULL;
- ASSERT_TRUE(inner_dict->GetList(L"array", &inner_array));
+ ASSERT_TRUE(inner_dict->GetList("array", &inner_array));
ASSERT_EQ(1U, inner_array->GetSize());
bool_value = true;
- ASSERT_TRUE(dict_val->GetBoolean(L"false", &bool_value));
+ ASSERT_TRUE(dict_val->GetBoolean("false", &bool_value));
ASSERT_FALSE(bool_value);
inner_dict = NULL;
- ASSERT_TRUE(dict_val->GetDictionary(L"d", &inner_dict));
+ ASSERT_TRUE(dict_val->GetDictionary("d", &inner_dict));
root2.reset(JSONReader::Read(
"{\"inner\": {\"array\":[true] , },\"false\":false,\"d\":{},}", true));
@@ -363,15 +363,15 @@ TEST(JSONReaderTest, Reading) {
ASSERT_TRUE(root->IsType(Value::TYPE_DICTIONARY));
dict_val = static_cast<DictionaryValue*>(root.get());
int integer_value = 0;
- EXPECT_TRUE(dict_val->GetIntegerWithoutPathExpansion(L"a.b", &integer_value));
+ EXPECT_TRUE(dict_val->GetIntegerWithoutPathExpansion("a.b", &integer_value));
EXPECT_EQ(3, integer_value);
- EXPECT_TRUE(dict_val->GetIntegerWithoutPathExpansion(L"c", &integer_value));
+ EXPECT_TRUE(dict_val->GetIntegerWithoutPathExpansion("c", &integer_value));
EXPECT_EQ(2, integer_value);
inner_dict = NULL;
- ASSERT_TRUE(dict_val->GetDictionaryWithoutPathExpansion(L"d.e.f",
+ ASSERT_TRUE(dict_val->GetDictionaryWithoutPathExpansion("d.e.f",
&inner_dict));
ASSERT_EQ(1U, inner_dict->size());
- EXPECT_TRUE(inner_dict->GetIntegerWithoutPathExpansion(L"g.h.i.j",
+ EXPECT_TRUE(inner_dict->GetIntegerWithoutPathExpansion("g.h.i.j",
&integer_value));
EXPECT_EQ(1, integer_value);
@@ -379,9 +379,9 @@ TEST(JSONReaderTest, Reading) {
ASSERT_TRUE(root.get());
ASSERT_TRUE(root->IsType(Value::TYPE_DICTIONARY));
dict_val = static_cast<DictionaryValue*>(root.get());
- EXPECT_TRUE(dict_val->GetInteger(L"a.b", &integer_value));
+ EXPECT_TRUE(dict_val->GetInteger("a.b", &integer_value));
EXPECT_EQ(2, integer_value);
- EXPECT_TRUE(dict_val->GetIntegerWithoutPathExpansion(L"a.b", &integer_value));
+ EXPECT_TRUE(dict_val->GetIntegerWithoutPathExpansion("a.b", &integer_value));
EXPECT_EQ(1, integer_value);
// Invalid, no closing brace
diff --git a/base/values.cc b/base/values.cc
index b2e276e..82fdbed 100644
--- a/base/values.cc
+++ b/base/values.cc
@@ -782,19 +782,6 @@ bool DictionaryValue::GetStringWithoutPathExpansion(
return value->GetAsString(out_value);
}
-// TODO(viettrungluu): Deprecated and to be removed:
-bool DictionaryValue::GetDictionaryWithoutPathExpansion(
- const std::wstring& key,
- DictionaryValue** out_value) const {
- return GetDictionaryWithoutPathExpansion(WideToUTF8(key), out_value);
-}
-
-// TODO(viettrungluu): Deprecated and to be removed:
-bool DictionaryValue::GetListWithoutPathExpansion(const std::wstring& key,
- ListValue** out_value) const {
- return GetListWithoutPathExpansion(WideToUTF8(key), out_value);
-}
-
bool DictionaryValue::Remove(const std::string& path, Value** out_value) {
DCHECK(IsStringUTF8(path));
std::string current_path(path);
diff --git a/base/values.h b/base/values.h
index 1fbc568..005db96 100644
--- a/base/values.h
+++ b/base/values.h
@@ -332,10 +332,6 @@ class DictionaryValue : public Value {
const std::wstring& key, std::string* out_value) const;
/*DEPRECATED*/bool GetStringWithoutPathExpansion(
const std::wstring& key, std::wstring* out_value) const;
- /*DEPRECATED*/bool GetDictionaryWithoutPathExpansion(
- const std::wstring& key, DictionaryValue** out_value) const;
- /*DEPRECATED*/bool GetListWithoutPathExpansion(const std::wstring& key,
- ListValue** out_value) const;
// Removes the Value with the specified path from this dictionary (or one
// of its child dictionaries, if the path is more than just a local key).
diff --git a/base/values_unittest.cc b/base/values_unittest.cc
index d71280d..82d6082 100644
--- a/base/values_unittest.cc
+++ b/base/values_unittest.cc
@@ -504,10 +504,6 @@ TEST_F(ValuesTest, DictionaryWithoutPathExpansionDeprecated) {
EXPECT_TRUE(dict.HasKey(L"this"));
Value* value1;
EXPECT_TRUE(dict.Get(L"this", &value1));
- DictionaryValue* value2;
- ASSERT_TRUE(dict.GetDictionaryWithoutPathExpansion(L"this", &value2));
- EXPECT_EQ(value1, value2);
- EXPECT_EQ(1U, value2->size());
EXPECT_TRUE(dict.HasKey(L"this.isnt.expanded"));
Value* value3;