Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6477)

Unified Diff: chrome/browser/sync/profile_sync_service.cc

Issue 10824161: [Sync] Avoid unregistering object IDs on shutdown (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove now-unneeded param Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/sync/profile_sync_service.cc
diff --git a/chrome/browser/sync/profile_sync_service.cc b/chrome/browser/sync/profile_sync_service.cc
index bc72dccfedc196a0bc60af76bf7b8da5b975e4c9..bb28de6a9bbdf8a079ba842fd14dbbca6fba76ba 100644
--- a/chrome/browser/sync/profile_sync_service.cc
+++ b/chrome/browser/sync/profile_sync_service.cc
@@ -428,7 +428,8 @@ void ProfileSyncService::StartUp() {
// TODO(akalin): Fix this horribly non-intuitive behavior (see
// http://crbug.com/140354).
if (backend_.get()) {
- backend_->UpdateRegisteredInvalidationIds(all_registered_ids_);
+ backend_->UpdateRegisteredInvalidationIds(
+ notifier_helper_.GetAllRegisteredIds());
}
if (!sync_global_error_.get()) {
@@ -441,14 +442,22 @@ void ProfileSyncService::StartUp() {
}
}
+void ProfileSyncService::SetInvalidationHandler(
+ const std::string& handler_name,
+ syncer::SyncNotifierObserver* handler) {
+ notifier_helper_.SetHandler(handler_name, handler);
+}
+
void ProfileSyncService::UpdateRegisteredInvalidationIds(
- syncer::SyncNotifierObserver* handler,
+ const std::string& handler_name,
const syncer::ObjectIdSet& ids) {
- all_registered_ids_ = notifier_helper_.UpdateRegisteredIds(handler, ids);
+ notifier_helper_.UpdateRegisteredIds(handler_name, ids);
+
// If |backend_| is NULL, its registered IDs will be updated when
// it's created and initialized.
if (backend_.get()) {
- backend_->UpdateRegisteredInvalidationIds(all_registered_ids_);
+ backend_->UpdateRegisteredInvalidationIds(
+ notifier_helper_.GetAllRegisteredIds());
}
}
@@ -464,7 +473,6 @@ void ProfileSyncService::ShutdownImpl(bool sync_disabled) {
base::Time shutdown_start_time = base::Time::Now();
if (backend_.get()) {
backend_->StopSyncingForShutdown();
- backend_->UpdateRegisteredInvalidationIds(syncer::ObjectIdSet());
}
// Stop all data type controllers, if needed. Note that until Stop

Powered by Google App Engine
This is Rietveld 408576698