Commit 86a40c4a authored by Marc Treib's avatar Marc Treib Committed by Commit Bot

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 <treib@chromium.org>
Reviewed-by: default avatarMikel Astiz <mastiz@chromium.org>
Reviewed-by: default avatarDavid Roger <droger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#741104}
parent f46a0ef8
......@@ -531,6 +531,11 @@ const char kGCMChannelStatus[] = "gcm.channel_status";
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 @@ void RegisterProfilePrefsForMigration(
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 @@ void RegisterLocalState(PrefRegistrySimple* registry) {
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 @@ void MigrateObsoleteBrowserPrefs(Profile* profile, PrefService* local_state) {
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 @@ void MigrateObsoleteProfilePrefs(Profile* profile) {
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);
}
......@@ -7,17 +7,6 @@
namespace invalidation {
namespace prefs {
// An ID to uniquely identify this client to the invalidator service.
const char kInvalidatorClientId[] = "invalidator.client_id";
// Opaque state from the invalidation subsystem that is persisted via prefs.
// The value is base 64 encoded.
const char kInvalidatorInvalidationState[] = "invalidator.invalidation_state";
// List of received invalidations that have not been acted on by any clients
// yet. Used to keep invalidation clients in sync in case of a restart.
const char kInvalidatorSavedInvalidations[] = "invalidator.saved_invalidations";
// The prefference for storing client ID for the invalidator.
const char kFCMInvalidationClientIDCacheDeprecated[] =
"fcm.invalidation.client_id_cache";
......
......@@ -8,12 +8,6 @@
namespace invalidation {
namespace prefs {
extern const char kInvalidatorClientId[];
extern const char kInvalidatorInvalidationState[];
extern const char kInvalidatorSavedInvalidations[];
extern const char kFCMInvalidationClientIDCacheDeprecated[];
extern const char kInvalidationClientIDCache[];
......
......@@ -80,6 +80,11 @@ const char kGoogleServicesUserAccountId[] = "google.services.user_account_id";
const char kGCMChannelStatus[] = "gcm.channel_status";
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";
}
void RegisterLocalStatePrefs(PrefRegistrySimple* registry) {
......@@ -120,6 +125,10 @@ void RegisterLocalStatePrefs(PrefRegistrySimple* registry) {
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());
}
void RegisterBrowserStatePrefs(user_prefs::PrefRegistrySyncable* registry) {
......@@ -198,6 +207,10 @@ void RegisterBrowserStatePrefs(user_prefs::PrefRegistrySyncable* registry) {
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());
}
// This method should be periodically pruned of year+ old migrations.
......@@ -206,6 +219,11 @@ void MigrateObsoleteLocalStatePrefs(PrefService* prefs) {
prefs->ClearPref(kGCMChannelStatus);
prefs->ClearPref(kGCMChannelPollIntervalSeconds);
prefs->ClearPref(kGCMChannelLastCheckTime);
// Added 2/2020.
prefs->ClearPref(kInvalidatorSavedInvalidations);
prefs->ClearPref(kInvalidatorInvalidationState);
prefs->ClearPref(kInvalidatorClientId);
}
// This method should be periodically pruned of year+ old migrations.
......@@ -242,4 +260,9 @@ void MigrateObsoleteBrowserStatePrefs(PrefService* prefs) {
prefs->ClearPref(kGCMChannelStatus);
prefs->ClearPref(kGCMChannelPollIntervalSeconds);
prefs->ClearPref(kGCMChannelLastCheckTime);
// Added 2/2020.
prefs->ClearPref(kInvalidatorSavedInvalidations);
prefs->ClearPref(kInvalidatorInvalidationState);
prefs->ClearPref(kInvalidatorClientId);
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment