[base] Use CheckedContiguousRange in Value

This change modifies the const overload of
base::Value::GetList() to return the newly introduced
base::CheckedContiguousRange() instead of base::span.

Furthermore this change updates callers to use this
new return value and performs some minor simplifications.

TBR=treib,stevenjb,blundell,benwells,noyau,agl

Bug: 990059
Change-Id: Iaf4577820fc579872d12d403cf8dd1aa9425b939
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1915759
Commit-Queue: Jan Wilken Dörrie <[email protected]>
Reviewed-by: Daniel Cheng <[email protected]>
Cr-Commit-Position: refs/heads/master@{#719972}
diff --git a/components/sync_device_info/device_info_prefs.cc b/components/sync_device_info/device_info_prefs.cc
index c86d062..2f47a346 100644
--- a/components/sync_device_info/device_info_prefs.cc
+++ b/components/sync_device_info/device_info_prefs.cc
@@ -60,7 +60,7 @@
 // static
 void DeviceInfoPrefs::MigrateRecentLocalCacheGuidsPref(
     PrefService* pref_service) {
-  base::span<const base::Value> obsolete_cache_guids =
+  base::Value::ConstListView obsolete_cache_guids =
       pref_service->GetList(kObsoleteDeviceInfoRecentGUIDs)->GetList();
   DeviceInfoPrefs prefs(pref_service, base::DefaultClock::GetInstance());
 
@@ -86,7 +86,7 @@
 
 bool DeviceInfoPrefs::IsRecentLocalCacheGuid(
     const std::string& cache_guid) const {
-  base::span<const base::Value> recent_local_cache_guids =
+  base::Value::ConstListView recent_local_cache_guids =
       pref_service_->GetList(kDeviceInfoRecentGUIDsWithTimestamps)->GetList();
 
   for (const auto& v : recent_local_cache_guids) {