summaryrefslogtreecommitdiff
path: root/chromium/fuchsia/base/config_reader.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/fuchsia/base/config_reader.cc')
-rw-r--r--chromium/fuchsia/base/config_reader.cc16
1 files changed, 8 insertions, 8 deletions
diff --git a/chromium/fuchsia/base/config_reader.cc b/chromium/fuchsia/base/config_reader.cc
index 87eaab8e48c..0c73357e93a 100644
--- a/chromium/fuchsia/base/config_reader.cc
+++ b/chromium/fuchsia/base/config_reader.cc
@@ -29,14 +29,14 @@ base::Optional<base::Value> ReadPackageConfig() {
return base::nullopt;
}
- base::JSONReader reader;
- base::Optional<base::Value> parsed = reader.Read(file_content);
- CHECK(parsed) << "Failed to parse " << path.value() << ": "
- << reader.GetErrorMessage();
- CHECK(parsed->is_dict()) << "Config is not a JSON dictinary: "
- << path.value();
-
- return std::move(parsed.value());
+ base::JSONReader::ValueWithError parsed =
+ base::JSONReader::ReadAndReturnValueWithError(file_content);
+ CHECK(parsed.value) << "Failed to parse " << path.value() << ": "
+ << parsed.error_message;
+ CHECK(parsed.value->is_dict())
+ << "Config is not a JSON dictionary: " << path.value();
+
+ return std::move(parsed.value);
}
} // namespace