Use ScopedDictPrefUpdate in /components/origin_trials

DictionaryPrefUpdate is deprecated. ScopedDictPrefUpdate exposes
only a Value::Dict instead of a Value to discourage use of
deprecated Value APIs for reading/writing dictionaries.

ScopedDictPrefUpdate also exposes a Value::Dict& instead of a
Value*, since the pref system DCHECKs that the pref is
registered and of the right type, and returns the default value
if the pref isn't set, so there's no reason to null check the
result.

This CL was uploaded by git cl split.

R=peter@chromium.org

Bug: 1362719
Change-Id: If4be6a2666a5418068308c35fe3505b8a0e48789
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4105183
Reviewed-by: Peter Beverloo <peter@chromium.org>
Auto-Submit: Matt Menke <mmenke@chromium.org>
Commit-Queue: Peter Beverloo <peter@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1083008}
diff --git a/components/origin_trials/browser/prefservice_persistence_provider.cc b/components/origin_trials/browser/prefservice_persistence_provider.cc
index 79382e6..e3be106 100644
--- a/components/origin_trials/browser/prefservice_persistence_provider.cc
+++ b/components/origin_trials/browser/prefservice_persistence_provider.cc
@@ -75,9 +75,9 @@
     base::Time current_time) {
   PrefService* service = pref_service();
   DCHECK(service);
-  DictionaryPrefUpdate update(service, kOriginTrialPrefKey);
+  ScopedDictPrefUpdate update(service, kOriginTrialPrefKey);
 
-  base::Value::Dict& storage_dict = update->GetDict();
+  base::Value::Dict& storage_dict = update.Get();
 
   // Get the map keys to iterate over, so we avoid modifying the map while
   // iterating.
@@ -143,9 +143,9 @@
   DCHECK(!origin.opaque());
   PrefService* service = pref_service();
   DCHECK(service);
-  DictionaryPrefUpdate update(service, kOriginTrialPrefKey);
+  ScopedDictPrefUpdate update(service, kOriginTrialPrefKey);
 
-  base::Value::Dict& storage_dict = update->GetDict();
+  base::Value::Dict& storage_dict = update.Get();
   std::string origin_key = origin.Serialize();
   if (tokens.empty()) {
     if (storage_dict.contains(origin_key)) {