From 5937064f2a628e3712f6b29f3d196fcd2b0a8444 Mon Sep 17 00:00:00 2001 From: Matt Menke Date: Thu, 30 Mar 2023 13:13:14 +0000 Subject: [PATCH] Migrate Value::Find*Path() calls in /google_apis Value::Find*Path() is deprecated in favor of Value::Dict::FindByDottedPath(), so swap out the former for the latter. Also switch callsites that were using a hard-coded path without dots to Value::Dict::Find() instead. Also, in some cases, migrate a couple other nearby deprecated base::Value methods as well. This CL was uploaded by git cl split. R=bsazonov@chromium.org Bug: 1187001 Change-Id: I6ecfd372d7cb0e1f6da26c868b0d07818f448824 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4383027 Reviewed-by: Boris Sazonov Auto-Submit: Matt Menke Commit-Queue: Boris Sazonov Cr-Commit-Position: refs/heads/main@{#1124153} --- google_apis/calendar/calendar_api_response_types.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/google_apis/calendar/calendar_api_response_types.cc b/google_apis/calendar/calendar_api_response_types.cc index a5ffcce61d1e46..94225d58926bfc 100644 --- a/google_apis/calendar/calendar_api_response_types.cc +++ b/google_apis/calendar/calendar_api_response_types.cc @@ -157,15 +157,15 @@ absl::optional CalculateSelfResponseStatus( // Pulls the video conference URI out of the conferenceData field, if there is // one on the event. Returns the first one it finds or an empty GURL if there is // none. -GURL GetConferenceDataUri(const base::Value& value) { - const auto* entry_points = value.FindListPath(kConferenceDataEntryPoints); +GURL GetConferenceDataUri(const base::Value::Dict& dict) { + const auto* entry_points = + dict.FindListByDottedPath(kConferenceDataEntryPoints); if (!entry_points) { return GURL(); } const auto video_conference_entry_point = base::ranges::find_if( - entry_points->GetList().begin(), entry_points->GetList().end(), - [](const auto& entry_point) { + entry_points->begin(), entry_points->end(), [](const auto& entry_point) { const std::string* entry_point_type = entry_point.GetDict().FindString(kEntryPointType); if (!entry_point_type) { @@ -174,7 +174,7 @@ GURL GetConferenceDataUri(const base::Value& value) { return *entry_point_type == kVideoConferenceValue; }); - if (video_conference_entry_point == entry_points->GetList().end()) { + if (video_conference_entry_point == entry_points->end()) { return GURL(); } @@ -210,7 +210,7 @@ bool ConvertResponseItems(const base::Value* value, CalendarEvent* event) { event->set_self_response_status(self_response_status.value()); } - GURL conference_data_uri = GetConferenceDataUri(*value); + GURL conference_data_uri = GetConferenceDataUri(value->GetDict()); event->set_conference_data_uri(conference_data_uri); return true;