diff options
author | viettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-14 03:32:17 +0000 |
---|---|---|
committer | viettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-14 03:32:17 +0000 |
commit | 8b6e84a68798718a3dd66bc82bdbed50cff79f00 (patch) | |
tree | f69809fda4ad0423d8d5ac9d7f2030efbd8ab4f2 | |
parent | a60153f0ada9823286a54b8b8852526e3e21a5a1 (diff) | |
download | chromium_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
-rw-r--r-- | base/json/json_reader.cc | 2 | ||||
-rw-r--r-- | base/json/json_writer_unittest.cc | 12 | ||||
-rw-r--r-- | base/values.cc | 6 | ||||
-rw-r--r-- | base/values.h | 2 | ||||
-rw-r--r-- | base/values_unittest.cc | 18 | ||||
-rw-r--r-- | chrome/browser/background_contents_service.cc | 2 | ||||
-rw-r--r-- | chrome/browser/chromeos/login/user_manager.cc | 3 | ||||
-rw-r--r-- | chrome/browser/geolocation/access_token_store.cc | 3 | ||||
-rw-r--r-- | chrome/browser/tab_contents/tab_contents.cc | 2 |
9 files changed, 12 insertions, 38 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()); diff --git a/chrome/browser/background_contents_service.cc b/chrome/browser/background_contents_service.cc index 6a61112..2bf2239 100644 --- a/chrome/browser/background_contents_service.cc +++ b/chrome/browser/background_contents_service.cc @@ -221,7 +221,7 @@ void BackgroundContentsService::RegisterBackgroundContents( DictionaryValue* dict = new DictionaryValue(); dict->SetString(kUrlKey, background_contents->GetURL().spec()); dict->SetString(kFrameNameKey, contents_map_[appid].frame_name); - pref->SetWithoutPathExpansion(UTF16ToWide(appid), dict); + pref->SetWithoutPathExpansion(UTF16ToUTF8(appid), dict); prefs_->ScheduleSavePersistentPrefs(); } diff --git a/chrome/browser/chromeos/login/user_manager.cc b/chrome/browser/chromeos/login/user_manager.cc index ca8cb5a..0974dbb 100644 --- a/chrome/browser/chromeos/login/user_manager.cc +++ b/chrome/browser/chromeos/login/user_manager.cc @@ -48,8 +48,7 @@ void save_path_to_local_state(const std::string& username, PrefService* local_state = g_browser_process->local_state(); DictionaryValue* images = local_state->GetMutableDictionary(kUserImages); - images->SetWithoutPathExpansion(UTF8ToWide(username), - new StringValue(image_path)); + images->SetWithoutPathExpansion(username, new StringValue(image_path)); LOG(INFO) << "Saving path to user image in Local State."; local_state->SavePersistentPrefs(); } diff --git a/chrome/browser/geolocation/access_token_store.cc b/chrome/browser/geolocation/access_token_store.cc index 7252506..7f376ce 100644 --- a/chrome/browser/geolocation/access_token_store.cc +++ b/chrome/browser/geolocation/access_token_store.cc @@ -70,8 +70,7 @@ void SetAccessTokenOnUIThread(const GURL& server_url, const string16& token) { g_browser_process->local_state()->GetMutableDictionary( prefs::kGeolocationAccessToken); access_token_dictionary->SetWithoutPathExpansion( - UTF8ToWide(server_url.spec()), - Value::CreateStringValue(token)); + server_url.spec(), Value::CreateStringValue(token)); } void ChromePrefsAccessTokenStore::SaveAccessToken( diff --git a/chrome/browser/tab_contents/tab_contents.cc b/chrome/browser/tab_contents/tab_contents.cc index 3b12242..dbcf1dd 100644 --- a/chrome/browser/tab_contents/tab_contents.cc +++ b/chrome/browser/tab_contents/tab_contents.cc @@ -2472,7 +2472,7 @@ void TabContents::UpdateInspectorSetting(const std::string& key, DictionaryValue* inspector_settings = profile()->GetPrefs()->GetMutableDictionary( prefs::kWebKitInspectorSettings); - inspector_settings->SetWithoutPathExpansion(UTF8ToWide(key), + inspector_settings->SetWithoutPathExpansion(key, Value::CreateStringValue(value)); } |