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

Unified Diff: sync/notifier/invalidation_notifier.cc

Issue 10824161: [Sync] Avoid unregistering object IDs on shutdown (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Work around brittle unit test 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 | « sync/notifier/invalidation_notifier.h ('k') | sync/notifier/invalidation_notifier_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/notifier/invalidation_notifier.cc
diff --git a/sync/notifier/invalidation_notifier.cc b/sync/notifier/invalidation_notifier.cc
index 4e67208f65d5e2dfb70dd2d8b821be127c750984..1b7ac8641a0ff5865b2987fc649a7789276bab40 100644
--- a/sync/notifier/invalidation_notifier.cc
+++ b/sync/notifier/invalidation_notifier.cc
@@ -36,12 +36,21 @@ InvalidationNotifier::~InvalidationNotifier() {
DCHECK(CalledOnValidThread());
}
+void InvalidationNotifier::RegisterHandler(SyncNotifierObserver* handler) {
+ DCHECK(CalledOnValidThread());
+ registrar_.RegisterHandler(handler);
+}
+
void InvalidationNotifier::UpdateRegisteredIds(SyncNotifierObserver* handler,
const ObjectIdSet& ids) {
DCHECK(CalledOnValidThread());
- const ObjectIdSet& all_registered_ids =
- helper_.UpdateRegisteredIds(handler, ids);
- invalidation_client_.UpdateRegisteredIds(all_registered_ids);
+ registrar_.UpdateRegisteredIds(handler, ids);
+ invalidation_client_.UpdateRegisteredIds(registrar_.GetAllRegisteredIds());
+}
+
+void InvalidationNotifier::UnregisterHandler(SyncNotifierObserver* handler) {
+ DCHECK(CalledOnValidThread());
+ registrar_.UnregisterHandler(handler);
}
void InvalidationNotifier::SetUniqueId(const std::string& unique_id) {
@@ -93,18 +102,18 @@ void InvalidationNotifier::SendNotification(ModelTypeSet changed_types) {
void InvalidationNotifier::OnInvalidate(const ObjectIdPayloadMap& id_payloads) {
DCHECK(CalledOnValidThread());
- helper_.DispatchInvalidationsToHandlers(id_payloads, REMOTE_NOTIFICATION);
+ registrar_.DispatchInvalidationsToHandlers(id_payloads, REMOTE_NOTIFICATION);
}
void InvalidationNotifier::OnNotificationsEnabled() {
DCHECK(CalledOnValidThread());
- helper_.EmitOnNotificationsEnabled();
+ registrar_.EmitOnNotificationsEnabled();
}
void InvalidationNotifier::OnNotificationsDisabled(
NotificationsDisabledReason reason) {
DCHECK(CalledOnValidThread());
- helper_.EmitOnNotificationsDisabled(reason);
+ registrar_.EmitOnNotificationsDisabled(reason);
}
} // namespace syncer
« no previous file with comments | « sync/notifier/invalidation_notifier.h ('k') | sync/notifier/invalidation_notifier_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698