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

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: Address comments 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
Index: sync/notifier/p2p_notifier.cc
diff --git a/sync/notifier/p2p_notifier.cc b/sync/notifier/p2p_notifier.cc
index 5d5aeffc04bd33bdd50a1251e96620ff928d4794..6e6d8918122c19485e3dad8fed629168c35c7e87 100644
--- a/sync/notifier/p2p_notifier.cc
+++ b/sync/notifier/p2p_notifier.cc
@@ -157,10 +157,19 @@ 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 =
msw 2012/08/07 20:09:30 ditto nit: comment why |ids| != |enabled_types|?
akalin 2012/08/07 23:38:05 ditto
+ 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