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

Upgrade google_logo_api from deprecated base::JSONReader API

Bug: 1070409
Change-Id: Ia7308b7a93552e118225d323084af66122a1340d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2212193Reviewed-by: default avatarMarc Treib <treib@chromium.org>
Commit-Queue: Nigel Tao <nigeltao@chromium.org>
Cr-Commit-Position: refs/heads/master@{#771534}
parent 785313b4
...@@ -189,20 +189,16 @@ std::unique_ptr<EncodedLogo> ParseDoodleLogoResponse( ...@@ -189,20 +189,16 @@ std::unique_ptr<EncodedLogo> ParseDoodleLogoResponse(
// Default parsing failure to be true. // Default parsing failure to be true.
*parsing_failed = true; *parsing_failed = true;
int error_code; base::JSONReader::ValueWithError parsed_json =
std::string error_string; base::JSONReader::ReadAndReturnValueWithError(response_sp);
int error_line; if (!parsed_json.value) {
int error_col; LOG(WARNING) << parsed_json.error_message << " at "
std::unique_ptr<base::Value> value = << parsed_json.error_line << ":" << parsed_json.error_column;
base::JSONReader::ReadAndReturnErrorDeprecated(
response_sp, 0, &error_code, &error_string, &error_line, &error_col);
if (!value) {
LOG(WARNING) << error_string << " at " << error_line << ":" << error_col;
return nullptr; return nullptr;
} }
std::unique_ptr<base::DictionaryValue> config = std::unique_ptr<base::DictionaryValue> config = base::DictionaryValue::From(
base::DictionaryValue::From(std::move(value)); base::Value::ToUniquePtrValue(std::move(*parsed_json.value)));
if (!config) if (!config)
return nullptr; return nullptr;
......
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