Commit 7a2b5ed0 authored by Lei Zhang's avatar Lei Zhang Committed by Commit Bot

Use base::JSONReader::ReadToValueDeprecated() in c/b/chromeos/policy/.

This is part of the process to help migrate
base::JSONReader::ReadToValue() to return base::Optional<base::Value>.

BUG=925165

Change-Id: I7754b1631a14bd3a30782fbbbb542e5cec897f0e
Reviewed-on: https://chromium-review.googlesource.com/c/1474515
Auto-Submit: Lei Zhang <thestig@chromium.org>
Reviewed-by: default avatarMaksim Ivanov <emaxx@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#632827}
parent 831acdda
...@@ -130,7 +130,7 @@ void DeviceCommandScreenshotJob::OnFailure(UploadJob::ErrorCode error_code) { ...@@ -130,7 +130,7 @@ void DeviceCommandScreenshotJob::OnFailure(UploadJob::ErrorCode error_code) {
bool DeviceCommandScreenshotJob::ParseCommandPayload( bool DeviceCommandScreenshotJob::ParseCommandPayload(
const std::string& command_payload) { const std::string& command_payload) {
std::unique_ptr<base::Value> root( std::unique_ptr<base::Value> root(
base::JSONReader().ReadToValue(command_payload)); base::JSONReader().ReadToValueDeprecated(command_payload));
if (!root.get()) if (!root.get())
return false; return false;
base::DictionaryValue* payload = nullptr; base::DictionaryValue* payload = nullptr;
......
...@@ -35,7 +35,7 @@ enterprise_management::RemoteCommand_Type DeviceCommandSetVolumeJob::GetType() ...@@ -35,7 +35,7 @@ enterprise_management::RemoteCommand_Type DeviceCommandSetVolumeJob::GetType()
bool DeviceCommandSetVolumeJob::ParseCommandPayload( bool DeviceCommandSetVolumeJob::ParseCommandPayload(
const std::string& command_payload) { const std::string& command_payload) {
std::unique_ptr<base::Value> root( std::unique_ptr<base::Value> root(
base::JSONReader().ReadToValue(command_payload)); base::JSONReader().ReadToValueDeprecated(command_payload));
if (!root.get()) if (!root.get())
return false; return false;
base::DictionaryValue* payload = nullptr; base::DictionaryValue* payload = nullptr;
......
...@@ -139,7 +139,7 @@ DeviceCommandStartCRDSessionJob::GetType() const { ...@@ -139,7 +139,7 @@ DeviceCommandStartCRDSessionJob::GetType() const {
bool DeviceCommandStartCRDSessionJob::ParseCommandPayload( bool DeviceCommandStartCRDSessionJob::ParseCommandPayload(
const std::string& command_payload) { const std::string& command_payload) {
std::unique_ptr<base::Value> root( std::unique_ptr<base::Value> root(
base::JSONReader().ReadToValue(command_payload)); base::JSONReader().ReadToValueDeprecated(command_payload));
if (!root) if (!root)
return false; return false;
if (!root->is_dict()) if (!root->is_dict())
......
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