diff options
author | tim@chromium.org <tim@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-31 00:39:26 +0000 |
---|---|---|
committer | tim@chromium.org <tim@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-31 00:39:26 +0000 |
commit | 0857ae0b1f18f25141e28a7b7169f497f5cdb76b (patch) | |
tree | a4adc9a4518fd41976f040e7658c15610d2a2336 /sync/tools | |
parent | b790b20609a2cca60e8ab75e1f02af391c4970e0 (diff) | |
download | chromium_src-0857ae0b1f18f25141e28a7b7169f497f5cdb76b.zip chromium_src-0857ae0b1f18f25141e28a7b7169f497f5cdb76b.tar.gz chromium_src-0857ae0b1f18f25141e28a7b7169f497f5cdb76b.tar.bz2 |
sync: migrate invalidation state from syncable::Directory to InvalidationStorage
Deprecates SyncNotifier::SetState, as this is needed only to plumb notification state from the syncable::Directory to notifier. It is still in use to facilitate migration.
Migration for an existing sync setup works as follows:
1) normal SyncManager::Init occurs, which calls SetState on notifier.
2) The InvalidationNotifier takes the state received in SetState and echoes it back through the InvalidationStateTracker) which is the new store. It does this in addition to normal stashing, to hand to ChromeInvalidationClient when needed.
3) On a subsequent restart, the SyncNotifierFactory will see a non-empty initial invalidation state in the InvalidationStateTracker, and pass this down on creation to notifier components.
4) SetState calls will now be no-ops, as the invalidation state will be non-empty, and it can only be set once on this code path.
UMA tracks the number of "worthwhile" SetStateDeprecated calls for a rough global migration progress.
At some point in the future, once these bits have served all (statistically speaking) users, the SetStateDeprecated call can be removed entirely and the syncable::Directory schema updated to remove existing and unnecessary columns. I did not remove the column from DirectoryBackingStore::CreateTables, since the code doesn't really support a half-way migration and it's likely cleaner to do it in one fell swoop when we know it is safe. Open to suggestions.
Built on http://codereview.chromium.org/10451058/
BUG=124140
TEST=
Review URL: https://chromiumcodereview.appspot.com/10451060
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@139706 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sync/tools')
-rw-r--r-- | sync/tools/sync_listen_notifications.cc | 7 |
1 files changed, 0 insertions, 7 deletions
diff --git a/sync/tools/sync_listen_notifications.cc b/sync/tools/sync_listen_notifications.cc index 9e8948b..5e5f97a 100644 --- a/sync/tools/sync_listen_notifications.cc +++ b/sync/tools/sync_listen_notifications.cc @@ -56,12 +56,6 @@ class NotificationPrinter : public sync_notifier::SyncNotifierObserver { LOG(INFO) << "Notifications enabled: " << notifications_enabled; } - virtual void StoreState(const std::string& state) OVERRIDE { - std::string base64_state; - CHECK(base::Base64Encode(state, &base64_state)); - LOG(INFO) << "Got state to store: " << base64_state; - } - private: DISALLOW_COPY_AND_ASSIGN(NotificationPrinter); }; @@ -226,7 +220,6 @@ int main(int argc, char* argv[]) { const char kUniqueId[] = "fake_unique_id"; sync_notifier->SetUniqueId(kUniqueId); - sync_notifier->SetState(""); sync_notifier->UpdateCredentials(email, token); // Listen for notifications for all known types. sync_notifier->UpdateEnabledTypes(syncable::ModelTypeSet::All()); |