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

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: Add ignore_result's 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
« no previous file with comments | « chromeos/network/onc/onc_translator_shill_to_onc.cc ('k') | chromeos/timezone/timezone_request.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..771c51b057963d324c0b3a5669cf86303a51b34b 100644
--- a/chromeos/network/onc/onc_utils.cc
+++ b/chromeos/network/onc/onc_utils.cc
@@ -7,6 +7,7 @@
#include "base/base64.h"
#include "base/json/json_reader.h"
#include "base/logging.h"
+#include "base/macros.h"
#include "base/metrics/histogram.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
@@ -48,15 +49,15 @@ 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)) {
NET_LOG(ERROR) << "Invalid JSON Dictionary: " << error;
- delete root;
+ return nullptr;
}
-
+ ignore_result(root.release());
return make_scoped_ptr(dict_ptr);
}
« no previous file with comments | « chromeos/network/onc/onc_translator_shill_to_onc.cc ('k') | chromeos/timezone/timezone_request.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698