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

Unified Diff: sync/notifier/p2p_notifier.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 | « sync/notifier/p2p_notifier.h ('k') | sync/notifier/p2p_notifier_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/notifier/p2p_notifier.cc
===================================================================
--- sync/notifier/p2p_notifier.cc (revision 150991)
+++ sync/notifier/p2p_notifier.cc (working copy)
@@ -157,18 +157,10 @@
push_client_->RemoveObserver(this);
}
-void P2PNotifier::RegisterHandler(SyncNotifierObserver* handler) {
- DCHECK(thread_checker_.CalledOnValidThread());
- registrar_.RegisterHandler(handler);
-}
-
void P2PNotifier::UpdateRegisteredIds(SyncNotifierObserver* handler,
const ObjectIdSet& ids) {
- // TODO(akalin): Handle arbitrary object IDs (http://crbug.com/140411).
- DCHECK(thread_checker_.CalledOnValidThread());
- registrar_.UpdateRegisteredIds(handler, ids);
- const ModelTypeSet enabled_types =
- ObjectIdSetToModelTypeSet(registrar_.GetAllRegisteredIds());
+ const ModelTypeSet enabled_types = ObjectIdSetToModelTypeSet(
+ helper_.UpdateRegisteredIds(handler, ids));
const ModelTypeSet new_enabled_types =
Difference(enabled_types, enabled_types_);
const P2PNotificationData notification_data(
@@ -177,11 +169,6 @@
enabled_types_ = enabled_types;
}
-void P2PNotifier::UnregisterHandler(SyncNotifierObserver* handler) {
- DCHECK(thread_checker_.CalledOnValidThread());
- registrar_.UnregisterHandler(handler);
-}
-
void P2PNotifier::SetUniqueId(const std::string& unique_id) {
DCHECK(thread_checker_.CalledOnValidThread());
unique_id_ = unique_id;
@@ -220,7 +207,7 @@
DCHECK(thread_checker_.CalledOnValidThread());
bool just_turned_on = (notifications_enabled_ == false);
notifications_enabled_ = true;
- registrar_.EmitOnNotificationsEnabled();
+ helper_.EmitOnNotificationsEnabled();
if (just_turned_on) {
const P2PNotificationData notification_data(
unique_id_, NOTIFY_SELF, enabled_types_);
@@ -231,7 +218,7 @@
void P2PNotifier::OnNotificationsDisabled(
notifier::NotificationsDisabledReason reason) {
DCHECK(thread_checker_.CalledOnValidThread());
- registrar_.EmitOnNotificationsDisabled(FromNotifierReason(reason));
+ helper_.EmitOnNotificationsDisabled(FromNotifierReason(reason));
}
void P2PNotifier::OnIncomingNotification(
@@ -270,7 +257,7 @@
}
const ModelTypePayloadMap& type_payloads = ModelTypePayloadMapFromEnumSet(
notification_data.GetChangedTypes(), std::string());
- registrar_.DispatchInvalidationsToHandlers(
+ helper_.DispatchInvalidationsToHandlers(
ModelTypePayloadMapToObjectIdPayloadMap(type_payloads),
REMOTE_NOTIFICATION);
}
« no previous file with comments | « sync/notifier/p2p_notifier.h ('k') | sync/notifier/p2p_notifier_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698