Index: sync/notifier/p2p_notifier.cc |
diff --git a/sync/notifier/p2p_notifier.cc b/sync/notifier/p2p_notifier.cc |
index 5d5aeffc04bd33bdd50a1251e96620ff928d4794..307bc3002da16dec418695d0bbd80d718a2b5973 100644 |
--- a/sync/notifier/p2p_notifier.cc |
+++ b/sync/notifier/p2p_notifier.cc |
@@ -157,10 +157,20 @@ P2PNotifier::~P2PNotifier() { |
push_client_->RemoveObserver(this); |
} |
-void P2PNotifier::UpdateRegisteredIds(SyncNotifierObserver* handler, |
+void P2PNotifier::SetHandler(const std::string& handler_name, |
+ SyncNotifierObserver* handler) { |
+ DCHECK(thread_checker_.CalledOnValidThread()); |
+ helper_.SetHandler(handler_name, handler); |
+} |
+ |
+void P2PNotifier::UpdateRegisteredIds(const std::string& handler_name, |
const ObjectIdSet& ids) { |
- const ModelTypeSet enabled_types = ObjectIdSetToModelTypeSet( |
- helper_.UpdateRegisteredIds(handler, ids)); |
+ // TODO(akalin): Handle arbitrary object IDs |
+ // (http://crbug.com/140411). |
+ DCHECK(thread_checker_.CalledOnValidThread()); |
+ helper_.UpdateRegisteredIds(handler_name, ids); |
+ const ModelTypeSet enabled_types = |
+ ObjectIdSetToModelTypeSet(helper_.GetAllRegisteredIds()); |
const ModelTypeSet new_enabled_types = |
Difference(enabled_types, enabled_types_); |
const P2PNotificationData notification_data( |