Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(41)

Unified Diff: chrome/browser/sync/glue/preference_model_associator.cc

Issue 6324004: Made return types of various Value::DeepCopy() implementations more specific (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add test for covariant return types Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/policy/device_management_policy_cache.cc ('k') | chrome/common/extensions/extension.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/glue/preference_model_associator.cc
diff --git a/chrome/browser/sync/glue/preference_model_associator.cc b/chrome/browser/sync/glue/preference_model_associator.cc
index e9fcfdf8e268eb9a0c953e62fe9d8c906261fb19..929b3dd0ef7c9ecf622378ceb5182fbc814ec901 100644
--- a/chrome/browser/sync/glue/preference_model_associator.cc
+++ b/chrome/browser/sync/glue/preference_model_associator.cc
@@ -263,7 +263,7 @@ Value* PreferenceModelAssociator::MergeListValues(const Value& from_value,
DCHECK(to_value.GetType() == Value::TYPE_LIST);
const ListValue& from_list_value = static_cast<const ListValue&>(from_value);
const ListValue& to_list_value = static_cast<const ListValue&>(to_value);
- ListValue* result = static_cast<ListValue*>(to_list_value.DeepCopy());
+ ListValue* result = to_list_value.DeepCopy();
for (ListValue::const_iterator i = from_list_value.begin();
i != from_list_value.end(); ++i) {
@@ -288,8 +288,7 @@ Value* PreferenceModelAssociator::MergeDictionaryValues(
static_cast<const DictionaryValue&>(from_value);
const DictionaryValue& to_dict_value =
static_cast<const DictionaryValue&>(to_value);
- DictionaryValue* result =
- static_cast<DictionaryValue*>(to_dict_value.DeepCopy());
+ DictionaryValue* result = to_dict_value.DeepCopy();
for (DictionaryValue::key_iterator key = from_dict_value.begin_keys();
key != from_dict_value.end_keys(); ++key) {
« no previous file with comments | « chrome/browser/policy/device_management_policy_cache.cc ('k') | chrome/common/extensions/extension.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698