From c30a6232df03e1efbd9f3b226777b07e087a1122 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Mon, 12 Oct 2020 14:27:29 +0200 Subject: BASELINE: Update Chromium to 85.0.4183.140 Change-Id: Iaa42f4680837c57725b1344f108c0196741f6057 Reviewed-by: Allan Sandfeld Jensen --- .../category_rankers/click_based_category_ranker.cc | 1 + .../category_rankers/constant_category_ranker.cc | 1 + .../reading_list/reading_list_suggestions_provider.cc | 1 + .../ntp_snippets/remote/json_request_unittest.cc | 19 ++++++++----------- .../remote_suggestions_fetcher_impl_unittest.cc | 10 +++++----- .../remote/remote_suggestions_status_service_impl.cc | 1 + .../ntp_snippets/remote/request_throttler.cc | 1 + chromium/components/ntp_snippets/user_classifier.cc | 1 + 8 files changed, 19 insertions(+), 16 deletions(-) (limited to 'chromium/components/ntp_snippets') diff --git a/chromium/components/ntp_snippets/category_rankers/click_based_category_ranker.cc b/chromium/components/ntp_snippets/category_rankers/click_based_category_ranker.cc index 70ea0f27c58..a8999ee4077 100644 --- a/chromium/components/ntp_snippets/category_rankers/click_based_category_ranker.cc +++ b/chromium/components/ntp_snippets/category_rankers/click_based_category_ranker.cc @@ -8,6 +8,7 @@ #include #include +#include "base/logging.h" #include "base/strings/string_number_conversions.h" #include "base/strings/string_util.h" #include "base/values.h" diff --git a/chromium/components/ntp_snippets/category_rankers/constant_category_ranker.cc b/chromium/components/ntp_snippets/category_rankers/constant_category_ranker.cc index b408bb6f824..f88d4d7fd91 100644 --- a/chromium/components/ntp_snippets/category_rankers/constant_category_ranker.cc +++ b/chromium/components/ntp_snippets/category_rankers/constant_category_ranker.cc @@ -4,6 +4,7 @@ #include "components/ntp_snippets/category_rankers/constant_category_ranker.h" +#include "base/logging.h" #include "base/stl_util.h" #include "base/strings/string_number_conversions.h" #include "base/strings/string_util.h" diff --git a/chromium/components/ntp_snippets/reading_list/reading_list_suggestions_provider.cc b/chromium/components/ntp_snippets/reading_list/reading_list_suggestions_provider.cc index de867fc914e..c4add3a5b75 100644 --- a/chromium/components/ntp_snippets/reading_list/reading_list_suggestions_provider.cc +++ b/chromium/components/ntp_snippets/reading_list/reading_list_suggestions_provider.cc @@ -9,6 +9,7 @@ #include #include "base/bind.h" +#include "base/logging.h" #include "base/strings/utf_string_conversions.h" #include "base/threading/thread_task_runner_handle.h" #include "base/time/time.h" diff --git a/chromium/components/ntp_snippets/remote/json_request_unittest.cc b/chromium/components/ntp_snippets/remote/json_request_unittest.cc index d6d4b77138a..85d2d1fa532 100644 --- a/chromium/components/ntp_snippets/remote/json_request_unittest.cc +++ b/chromium/components/ntp_snippets/remote/json_request_unittest.cc @@ -45,24 +45,21 @@ using testing::NotNull; using testing::StrEq; MATCHER_P(EqualsJSON, json, "equals JSON") { - std::unique_ptr expected = - base::JSONReader::ReadDeprecated(json); + base::Optional expected = base::JSONReader::Read(json); if (!expected) { *result_listener << "INTERNAL ERROR: couldn't parse expected JSON"; return false; } - std::string err_msg; - int err_line, err_col; - std::unique_ptr actual = - base::JSONReader::ReadAndReturnErrorDeprecated( - arg, base::JSON_PARSE_RFC, nullptr, &err_msg, &err_line, &err_col); - if (!actual) { - *result_listener << "input:" << err_line << ":" << err_col << ": " - << "parse error: " << err_msg; + base::JSONReader::ValueWithError actual = + base::JSONReader::ReadAndReturnValueWithError(arg); + if (!actual.value) { + *result_listener << "input:" << actual.error_line << ":" + << actual.error_column << ": " + << "parse error: " << actual.error_message; return false; } - return *expected == *actual; + return *expected == *actual.value; } } // namespace diff --git a/chromium/components/ntp_snippets/remote/remote_suggestions_fetcher_impl_unittest.cc b/chromium/components/ntp_snippets/remote/remote_suggestions_fetcher_impl_unittest.cc index a2193d5d03e..887545b23b6 100644 --- a/chromium/components/ntp_snippets/remote/remote_suggestions_fetcher_impl_unittest.cc +++ b/chromium/components/ntp_snippets/remote/remote_suggestions_fetcher_impl_unittest.cc @@ -150,12 +150,12 @@ class MockSnippetsAvailableCallback { void ParseJson(const std::string& json, SuccessCallback success_callback, ErrorCallback error_callback) { - base::JSONReader json_reader; - base::Optional value = json_reader.ReadToValue(json); - if (value) { - std::move(success_callback).Run(std::move(*value)); + base::JSONReader::ValueWithError parsed_json = + base::JSONReader::ReadAndReturnValueWithError(json); + if (parsed_json.value) { + std::move(success_callback).Run(std::move(*parsed_json.value)); } else { - std::move(error_callback).Run(json_reader.GetErrorMessage()); + std::move(error_callback).Run(std::move(parsed_json.error_message)); } } diff --git a/chromium/components/ntp_snippets/remote/remote_suggestions_status_service_impl.cc b/chromium/components/ntp_snippets/remote/remote_suggestions_status_service_impl.cc index a13b40000db..9198c84aad2 100644 --- a/chromium/components/ntp_snippets/remote/remote_suggestions_status_service_impl.cc +++ b/chromium/components/ntp_snippets/remote/remote_suggestions_status_service_impl.cc @@ -8,6 +8,7 @@ #include "base/bind.h" #include "base/feature_list.h" +#include "base/logging.h" #include "components/feed/core/shared_prefs/pref_names.h" #include "components/ntp_snippets/content_suggestions_metrics.h" #include "components/ntp_snippets/features.h" diff --git a/chromium/components/ntp_snippets/remote/request_throttler.cc b/chromium/components/ntp_snippets/remote/request_throttler.cc index efe56366ed9..86c2dc47051 100644 --- a/chromium/components/ntp_snippets/remote/request_throttler.cc +++ b/chromium/components/ntp_snippets/remote/request_throttler.cc @@ -8,6 +8,7 @@ #include #include +#include "base/logging.h" #include "base/metrics/histogram.h" #include "base/strings/string_number_conversions.h" #include "base/strings/string_split.h" diff --git a/chromium/components/ntp_snippets/user_classifier.cc b/chromium/components/ntp_snippets/user_classifier.cc index 3a0e8f12bdd..d9f4ea23814 100644 --- a/chromium/components/ntp_snippets/user_classifier.cc +++ b/chromium/components/ntp_snippets/user_classifier.cc @@ -8,6 +8,7 @@ #include #include +#include "base/logging.h" #include "base/metrics/histogram_macros.h" #include "base/numerics/ranges.h" #include "base/stl_util.h" -- cgit v1.2.1