Commit e2e1a18d authored by Nigel Tao's avatar Nigel Tao Committed by Commit Bot

Upgrade indexed_db from deprecated base::JSONReader API

Bug: 1070409
Change-Id: I32807d7e13c9347b9c214eac7168649e4a8bbd1b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2212115Reviewed-by: default avatarDaniel Murphy <dmurph@chromium.org>
Commit-Queue: Nigel Tao <nigeltao@chromium.org>
Cr-Commit-Position: refs/heads/master@{#772041}
parent 92758ce6
......@@ -122,11 +122,12 @@ std::string ReadCorruptionInfo(const base::FilePath& path_base,
if (file.IsValid()) {
std::string input_js(file_size, '\0');
if (file_size == file.Read(0, base::data(input_js), file_size)) {
base::JSONReader reader;
std::unique_ptr<base::DictionaryValue> val(
base::DictionaryValue::From(reader.ReadToValueDeprecated(input_js)));
if (val)
val->GetString("message", &message);
base::Optional<base::Value> val = base::JSONReader::Read(input_js);
if (val && val->is_dict()) {
std::string* s = val->FindStringKey("message");
if (s)
message = *s;
}
}
file.Close();
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment