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

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

Issue 10824252: Revert 150990 - [Sync] Avoid unregistering object IDs on shutdown (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: 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
« no previous file with comments | « chrome/browser/sync/profile_sync_service.h ('k') | chrome/browser/sync/profile_sync_service_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/profile_sync_service.cc
===================================================================
--- chrome/browser/sync/profile_sync_service.cc (revision 150991)
+++ chrome/browser/sync/profile_sync_service.cc (working copy)
@@ -428,8 +428,7 @@
// TODO(akalin): Fix this horribly non-intuitive behavior (see
// http://crbug.com/140354).
if (backend_.get()) {
- backend_->UpdateRegisteredInvalidationIds(
- notifier_registrar_.GetAllRegisteredIds());
+ backend_->UpdateRegisteredInvalidationIds(all_registered_ids_);
}
if (!sync_global_error_.get()) {
@@ -442,29 +441,17 @@
}
}
-void ProfileSyncService::RegisterInvalidationHandler(
- syncer::SyncNotifierObserver* handler) {
- notifier_registrar_.RegisterHandler(handler);
-}
-
void ProfileSyncService::UpdateRegisteredInvalidationIds(
syncer::SyncNotifierObserver* handler,
const syncer::ObjectIdSet& ids) {
- notifier_registrar_.UpdateRegisteredIds(handler, ids);
-
+ all_registered_ids_ = notifier_helper_.UpdateRegisteredIds(handler, ids);
// If |backend_| is NULL, its registered IDs will be updated when
// it's created and initialized.
if (backend_.get()) {
- backend_->UpdateRegisteredInvalidationIds(
- notifier_registrar_.GetAllRegisteredIds());
+ backend_->UpdateRegisteredInvalidationIds(all_registered_ids_);
}
}
-void ProfileSyncService::UnregisterInvalidationHandler(
- syncer::SyncNotifierObserver* handler) {
- notifier_registrar_.UnregisterHandler(handler);
-}
-
void ProfileSyncService::Shutdown() {
ShutdownImpl(false);
}
@@ -477,6 +464,7 @@
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
@@ -671,18 +659,18 @@
}
void ProfileSyncService::OnNotificationsEnabled() {
- notifier_registrar_.EmitOnNotificationsEnabled();
+ notifier_helper_.EmitOnNotificationsEnabled();
}
void ProfileSyncService::OnNotificationsDisabled(
syncer::NotificationsDisabledReason reason) {
- notifier_registrar_.EmitOnNotificationsDisabled(reason);
+ notifier_helper_.EmitOnNotificationsDisabled(reason);
}
void ProfileSyncService::OnIncomingNotification(
const syncer::ObjectIdPayloadMap& id_payloads,
syncer::IncomingNotificationSource source) {
- notifier_registrar_.DispatchInvalidationsToHandlers(id_payloads, source);
+ notifier_helper_.DispatchInvalidationsToHandlers(id_payloads, source);
}
void ProfileSyncService::OnBackendInitialized(
« no previous file with comments | « chrome/browser/sync/profile_sync_service.h ('k') | chrome/browser/sync/profile_sync_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698