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

Unified Diff: chrome/common/extensions/extension.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
Index: chrome/common/extensions/extension.cc
diff --git a/chrome/common/extensions/extension.cc b/chrome/common/extensions/extension.cc
index bdbb33a356d17b0eb01be622b90e7d42f34a48bf..5d7e1d2fd549877fd667eb174d26da3c47a1f37c 100644
--- a/chrome/common/extensions/extension.cc
+++ b/chrome/common/extensions/extension.cc
@@ -1253,8 +1253,7 @@ bool Extension::InitFromValue(const DictionaryValue& source, bool require_key,
}
// Make a copy of the manifest so we can store it in prefs.
- manifest_value_.reset(
- static_cast<DictionaryValue*>(source.DeepCopy()));
+ manifest_value_.reset(source.DeepCopy());
// Initialize the URL.
extension_url_ =
@@ -1426,8 +1425,7 @@ bool Extension::InitFromValue(const DictionaryValue& source, bool require_key,
return false;
}
}
- theme_images_.reset(
- static_cast<DictionaryValue*>(images_value->DeepCopy()));
+ theme_images_.reset(images_value->DeepCopy());
}
DictionaryValue* colors_value;
@@ -1455,8 +1453,7 @@ bool Extension::InitFromValue(const DictionaryValue& source, bool require_key,
return false;
}
}
- theme_colors_.reset(
- static_cast<DictionaryValue*>(colors_value->DeepCopy()));
+ theme_colors_.reset(colors_value->DeepCopy());
}
DictionaryValue* tints_value;
@@ -1476,15 +1473,14 @@ bool Extension::InitFromValue(const DictionaryValue& source, bool require_key,
return false;
}
}
- theme_tints_.reset(
- static_cast<DictionaryValue*>(tints_value->DeepCopy()));
+ theme_tints_.reset(tints_value->DeepCopy());
}
DictionaryValue* display_properties_value;
if (theme_value->GetDictionary(keys::kThemeDisplayProperties,
&display_properties_value)) {
theme_display_properties_.reset(
- static_cast<DictionaryValue*>(display_properties_value->DeepCopy()));
+ display_properties_value->DeepCopy());
}
return true;
@@ -2296,8 +2292,7 @@ ExtensionInfo::ExtensionInfo(const DictionaryValue* manifest,
extension_path(path),
extension_location(location) {
if (manifest)
- extension_manifest.reset(
- static_cast<DictionaryValue*>(manifest->DeepCopy()));
+ extension_manifest.reset(manifest->DeepCopy());
}
ExtensionInfo::~ExtensionInfo() {}
« no previous file with comments | « chrome/browser/sync/glue/preference_model_associator.cc ('k') | chrome/common/extensions/extension_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698