Chromium Code Reviews| Index: chromeos/network/onc/onc_translator_shill_to_onc.cc |
| diff --git a/chromeos/network/onc/onc_translator_shill_to_onc.cc b/chromeos/network/onc/onc_translator_shill_to_onc.cc |
| index ad20482ace48a8a0b1383e5f8d016ff83e5c6415..558493431ae6be3d159dadd67703bf000b7e31e8 100644 |
| --- a/chromeos/network/onc/onc_translator_shill_to_onc.cc |
| +++ b/chromeos/network/onc/onc_translator_shill_to_onc.cc |
| @@ -31,18 +31,13 @@ namespace { |
| // returns NULL. |
| scoped_ptr<base::Value> ConvertStringToValue(const std::string& str, |
| base::Value::Type type) { |
| - base::Value* value; |
| + scoped_ptr<base::Value> value; |
| if (type == base::Value::TYPE_STRING) { |
| - value = new base::StringValue(str); |
| + value = make_scoped_ptr(new base::StringValue(str)); |
|
pneubeck (no reviews)
2015/09/09 11:49:51
shouldn't this be
value.reset(new ...)
?
|
| } else { |
| - value = base::JSONReader::DeprecatedRead(str); |
| + value = base::JSONReader::Read(str); |
| } |
| - |
| - if (value == NULL || value->GetType() != type) { |
| - delete value; |
| - value = NULL; |
| - } |
| - return make_scoped_ptr(value); |
| + return value; |
|
pneubeck (no reviews)
2015/09/09 11:49:51
this must keep the type check:
if (value && value
|
| } |
| // This class implements the translation of properties from the given |