diff options
author | Qijiang Fan <fqj@google.com> | 2020-07-31 05:26:13 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2020-07-31 05:26:13 +0000 |
commit | 34cc0826b29cf9c6ca1f957ea96f2e9d6c59dbfb (patch) | |
tree | e4b17bc1760497f672b09416be3e1a34c08a7604 | |
parent | 35d33c2abd0f6b51d7569afc119cb0a85c430dba (diff) | |
parent | 830b8b038f60039b54eb661c52a22fe35460ff8c (diff) | |
download | platform_external_libbrillo-34cc0826b29cf9c6ca1f957ea96f2e9d6c59dbfb.tar.gz platform_external_libbrillo-34cc0826b29cf9c6ca1f957ea96f2e9d6c59dbfb.tar.bz2 platform_external_libbrillo-34cc0826b29cf9c6ca1f957ea96f2e9d6c59dbfb.zip |
Revert "libbrillo: rename base::JSONReader methods" am: 830b8b038f
Original change: https://android-review.googlesource.com/c/platform/external/libbrillo/+/1371780
Change-Id: I6a625a8d35f0522756099781eacc72e374ef57e8
-rw-r--r-- | brillo/http/http_transport_fake.cc | 4 | ||||
-rw-r--r-- | brillo/http/http_utils.cc | 6 | ||||
-rw-r--r-- | brillo/value_conversion_test.cc | 6 | ||||
-rw-r--r-- | policy/device_policy_impl.cc | 7 |
4 files changed, 8 insertions, 15 deletions
diff --git a/brillo/http/http_transport_fake.cc b/brillo/http/http_transport_fake.cc index 8fd9d2c..c4757f9 100644 --- a/brillo/http/http_transport_fake.cc +++ b/brillo/http/http_transport_fake.cc @@ -180,9 +180,7 @@ ServerRequestResponseBase::GetDataAsJson() const { if (brillo::mime::RemoveParameters( GetHeader(request_header::kContentType)) == brillo::mime::application::kJson) { - // TODO(crbug.com/1054279): use base::JSONReader::Read after uprev to - // r680000. - auto value = base::JSONReader::ReadDeprecated(GetDataAsString()); + auto value = base::JSONReader::Read(GetDataAsString()); result = base::DictionaryValue::From(std::move(value)); } return result; diff --git a/brillo/http/http_utils.cc b/brillo/http/http_utils.cc index 55e0bf3..6132d11 100644 --- a/brillo/http/http_utils.cc +++ b/brillo/http/http_utils.cc @@ -396,10 +396,8 @@ std::unique_ptr<base::DictionaryValue> ParseJsonResponse( std::string json = response->ExtractDataAsString(); std::string error_message; - // TODO(crbug.com/1054279): use base::JSONReader::ReadAndReturnValueWithError - // after uprev to r680000. - auto value = base::JSONReader::ReadAndReturnErrorDeprecated( - json, base::JSON_PARSE_RFC, nullptr, &error_message); + auto value = base::JSONReader::ReadAndReturnError(json, base::JSON_PARSE_RFC, + nullptr, &error_message); if (!value) { brillo::Error::AddToPrintf(error, FROM_HERE, brillo::errors::json::kDomain, brillo::errors::json::kParseError, diff --git a/brillo/value_conversion_test.cc b/brillo/value_conversion_test.cc index 2cf6d00..fec4052 100644 --- a/brillo/value_conversion_test.cc +++ b/brillo/value_conversion_test.cc @@ -31,10 +31,8 @@ namespace { std::unique_ptr<base::Value> ParseValue(std::string json) { std::replace(json.begin(), json.end(), '\'', '"'); std::string message; - // TODO(crbug.com/1054279): use base::JSONReader::ReadAndReturnValueWithError - // after uprev to r680000. - auto value = base::JSONReader::ReadAndReturnErrorDeprecated( - json, base::JSON_PARSE_RFC, nullptr, &message); + auto value = base::JSONReader::ReadAndReturnError(json, base::JSON_PARSE_RFC, + nullptr, &message); CHECK(value) << "Failed to load JSON: " << message << ", " << json; return value; } diff --git a/policy/device_policy_impl.cc b/policy/device_policy_impl.cc index de082bf..54ea1f9 100644 --- a/policy/device_policy_impl.cc +++ b/policy/device_policy_impl.cc @@ -154,11 +154,10 @@ bool DecodeWeeklyTimeFromValue(const base::DictionaryValue& dict_value, std::unique_ptr<base::ListValue> DecodeListValueFromJSON( const std::string& json_string) { std::string error; - // TODO(crbug.com/1054279): use base::JSONReader::ReadAndReturnValueWithError - // after uprev to r680000. std::unique_ptr<base::Value> decoded_json = - base::JSONReader::ReadAndReturnErrorDeprecated( - json_string, base::JSON_ALLOW_TRAILING_COMMAS, nullptr, &error); + base::JSONReader::ReadAndReturnError(json_string, + base::JSON_ALLOW_TRAILING_COMMAS, + nullptr, &error); if (!decoded_json) { LOG(ERROR) << "Invalid JSON string: " << error; return nullptr; |