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

Unified Diff: chromeos/tools/onc_validator/onc_validator.cc

Issue 1394993004: Make ValueDeserializer::Deserialize return scoped_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix and add todo about not failed trybot Created 5 years, 2 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/system/statistics_provider.cc ('k') | components/bookmarks/browser/bookmark_codec.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/tools/onc_validator/onc_validator.cc
diff --git a/chromeos/tools/onc_validator/onc_validator.cc b/chromeos/tools/onc_validator/onc_validator.cc
index 14ed8919b87b91f13f87985fb4981a0b4ba1ff33..a4ec9bd8b1d20ff2cf80a950a16f952ba7f16768 100644
--- a/chromeos/tools/onc_validator/onc_validator.cc
+++ b/chromeos/tools/onc_validator/onc_validator.cc
@@ -14,6 +14,9 @@
#include "chromeos/network/onc/onc_signature.h"
#include "chromeos/network/onc/onc_validator.h"
+// TODO Check why this file do not fail on default trybots
+// http://crbug.com/543919
+
// Command line switches.
const char kSwitchErrorOnUnknownField[] = "error-on-unknown-field";
const char kSwitchErrorOnWrongRecommended[] = "error-on-wrong-recommended";
@@ -90,7 +93,8 @@ scoped_ptr<base::DictionaryValue> ReadDictionary(const std::string& filename) {
base::DictionaryValue* dict = NULL;
std::string json_error;
- base::Value* value = deserializer.Deserialize(NULL, &json_error);
+ base::Value* value = deserializer.Deserialize(NULL, &json_error).release();
+ // TODO(Olli Raula) possible memory leak http://crbug.com/543015
if (!value) {
LOG(ERROR) << "Couldn't json-deserialize file '" << filename
<< "': " << json_error;
« no previous file with comments | « chromeos/system/statistics_provider.cc ('k') | components/bookmarks/browser/bookmark_codec.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698