Commit 4c79cd0d authored by Sylvain Defresne's avatar Sylvain Defresne Committed by Commit Bot

Convert CloudDeviceDescription to use base::JSONReader::Read

Bug: 925165
Change-Id: Idcd84485128c8239d3cd811bf0309e1c3c2b8c0c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1736353
Commit-Queue: Lei Zhang <thestig@chromium.org>
Auto-Submit: Sylvain Defresne <sdefresne@chromium.org>
Reviewed-by: default avatarLei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#684113}
parent c153c517
...@@ -22,11 +22,11 @@ CloudDeviceDescription::CloudDeviceDescription() ...@@ -22,11 +22,11 @@ CloudDeviceDescription::CloudDeviceDescription()
CloudDeviceDescription::~CloudDeviceDescription() = default; CloudDeviceDescription::~CloudDeviceDescription() = default;
bool CloudDeviceDescription::InitFromString(const std::string& json) { bool CloudDeviceDescription::InitFromString(const std::string& json) {
std::unique_ptr<base::Value> value = base::JSONReader::ReadDeprecated(json); base::Optional<base::Value> value = base::JSONReader::Read(json);
if (!value) if (!value)
return false; return false;
return InitFromValue(base::Value::FromUniquePtrValue(std::move(value))); return InitFromValue(std::move(*value));
} }
bool CloudDeviceDescription::InitFromValue(base::Value ticket) { bool CloudDeviceDescription::InitFromValue(base::Value ticket) {
......
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