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

Unified Diff: sync/notifier/p2p_notifier.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, 5 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: 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(

Powered by Google App Engine
This is Rietveld 408576698