Remove obsolete invalidations prefs
After https://crrev.com/c/1989750, a few invalidations-related prefs are
not used anymore. This CL adds code to clean them up.
Bug: 1029481
Change-Id: I56b75b442fed2275d502ba63370e48f006bc9bbc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2050591
Commit-Queue: Marc Treib <[email protected]>
Reviewed-by: Mikel Astiz <[email protected]>
Reviewed-by: David Roger <[email protected]>
Cr-Commit-Position: refs/heads/master@{#741104}
diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browser_prefs.cc
index f5d8150..520432b737 100644
--- a/chrome/browser/prefs/browser_prefs.cc
+++ b/chrome/browser/prefs/browser_prefs.cc
@@ -531,6 +531,11 @@
const char kGCMChannelPollIntervalSeconds[] = "gcm.poll_interval";
const char kGCMChannelLastCheckTime[] = "gcm.check_time";
+// Deprecated 2/2020
+const char kInvalidatorClientId[] = "invalidator.client_id";
+const char kInvalidatorInvalidationState[] = "invalidator.invalidation_state";
+const char kInvalidatorSavedInvalidations[] = "invalidator.saved_invalidations";
+
// Register prefs used only for migration (clearing or moving to a new key).
void RegisterProfilePrefsForMigration(
user_prefs::PrefRegistrySyncable* registry) {
@@ -622,6 +627,10 @@
registry->RegisterBooleanPref(kGCMChannelStatus, true);
registry->RegisterIntegerPref(kGCMChannelPollIntervalSeconds, 0);
registry->RegisterInt64Pref(kGCMChannelLastCheckTime, 0);
+
+ registry->RegisterListPref(kInvalidatorSavedInvalidations);
+ registry->RegisterStringPref(kInvalidatorInvalidationState, std::string());
+ registry->RegisterStringPref(kInvalidatorClientId, std::string());
}
} // namespace
@@ -795,6 +804,11 @@
registry->RegisterBooleanPref(kGCMChannelStatus, true);
registry->RegisterIntegerPref(kGCMChannelPollIntervalSeconds, 0);
registry->RegisterInt64Pref(kGCMChannelLastCheckTime, 0);
+
+ // Obsolete. See MigrateObsoleteBrowserPrefs().
+ registry->RegisterListPref(kInvalidatorSavedInvalidations);
+ registry->RegisterStringPref(kInvalidatorInvalidationState, std::string());
+ registry->RegisterStringPref(kInvalidatorClientId, std::string());
}
// Register prefs applicable to all profiles.
@@ -1117,6 +1131,11 @@
local_state->ClearPref(kGCMChannelStatus);
local_state->ClearPref(kGCMChannelPollIntervalSeconds);
local_state->ClearPref(kGCMChannelLastCheckTime);
+
+ // Added 2/2020.
+ local_state->ClearPref(kInvalidatorSavedInvalidations);
+ local_state->ClearPref(kInvalidatorInvalidationState);
+ local_state->ClearPref(kInvalidatorClientId);
}
// This method should be periodically pruned of year+ old migrations.
@@ -1260,4 +1279,9 @@
profile_prefs->ClearPref(kGCMChannelStatus);
profile_prefs->ClearPref(kGCMChannelPollIntervalSeconds);
profile_prefs->ClearPref(kGCMChannelLastCheckTime);
+
+ // Added 2/2020.
+ profile_prefs->ClearPref(kInvalidatorSavedInvalidations);
+ profile_prefs->ClearPref(kInvalidatorInvalidationState);
+ profile_prefs->ClearPref(kInvalidatorClientId);
}