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

Unified Diff: chromeos/network/onc/onc_utils.cc

Issue 1328233002: Ramove use of JSONReader::DeprecatedRead from chromeos/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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: chromeos/network/onc/onc_utils.cc
diff --git a/chromeos/network/onc/onc_utils.cc b/chromeos/network/onc/onc_utils.cc
index 85c2b9d7152f92541a11bf5085c8bfab53ade064..ce693ecea68ba32139285e2e1bcc70b71406cba8 100644
--- a/chromeos/network/onc/onc_utils.cc
+++ b/chromeos/network/onc/onc_utils.cc
@@ -48,13 +48,12 @@ const char kEmptyUnencryptedConfiguration[] =
scoped_ptr<base::DictionaryValue> ReadDictionaryFromJson(
const std::string& json) {
std::string error;
- base::Value* root = base::JSONReader::DeprecatedReadAndReturnError(
+ scoped_ptr<base::Value> root = base::JSONReader::ReadAndReturnError(
json, base::JSON_ALLOW_TRAILING_COMMAS, nullptr, &error);
base::DictionaryValue* dict_ptr = nullptr;
- if (!root || !root->GetAsDictionary(&dict_ptr)) {
+ if (!root.get() || !root.release()->GetAsDictionary(&dict_ptr)) {
pneubeck (no reviews) 2015/09/09 11:49:51 it's common to drop the ".get()" for boolean check
NET_LOG(ERROR) << "Invalid JSON Dictionary: " << error;
- delete root;
}
return make_scoped_ptr(dict_ptr);

Powered by Google App Engine
This is Rietveld 408576698