Use base::JSONReader::ReadDeprecated() in components/.
This is part of the process to help migrate base::JSONReader::Read() to return base::Optional<base::Value>. Do the same for ReadAndReturnError() and ReadToValue(). BUG=925165 TBR=sdefresne@chromium.org Change-Id: I3a6b5b5d581ece4771f1525e465aae7af20afddf Reviewed-on: https://chromium-review.googlesource.com/c/1476093 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org> Cr-Commit-Position: refs/heads/master@{#632876}
This commit is contained in:
components
arc
autofill
core
ios
browser
autofill_assistant
browser
devtools
cast_channel
cloud_devices
content_settings
core
cronet
dom_distiller
domain_reliability
heap_profiling
history
core
browser
invalidation
language
core
mirroring
service
nacl
renderer
net_log
network_time
ntp_snippets
breaking_news
remote
ntp_tiles
omnibox
browser
password_manager
core
browser
site_affiliation
payments
content
utility
core
policy
core
quirks
safe_browsing
safe_search_api
search_engines
search_provider_logos
services
heap_profiling
signin
core
spellcheck
browser
subresource_filter
sync_preferences
tracing
translate
core
browser
viz
common
webcrypto
@@ -52,7 +52,8 @@ std::string BuildRequestData(const std::string& api_key,
|
||||
// Parses a SafeSearch API |response| and stores the result in |is_porn|.
|
||||
// On errors, returns false and doesn't set |is_porn|.
|
||||
bool ParseResponse(const std::string& response, bool* is_porn) {
|
||||
std::unique_ptr<base::Value> value = base::JSONReader::Read(response);
|
||||
std::unique_ptr<base::Value> value =
|
||||
base::JSONReader::ReadDeprecated(response);
|
||||
const base::DictionaryValue* dict = nullptr;
|
||||
if (!value || !value->GetAsDictionary(&dict)) {
|
||||
DLOG(WARNING) << "ParseResponse failed to parse global dictionary";
|
||||
|
Reference in New Issue
Block a user