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

Unified Diff: components/invalidation/p2p_invalidator.cc

Issue 1146533005: [Sync] InvalidationService shouldn't CHECK when registering ObjectId for more than one handler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments from Bartosz. Created 5 years, 7 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 | « components/invalidation/p2p_invalidator.h ('k') | components/invalidation/ticl_invalidation_service.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/invalidation/p2p_invalidator.cc
diff --git a/components/invalidation/p2p_invalidator.cc b/components/invalidation/p2p_invalidator.cc
index c583d440faabfa77ff4f48ea9e82e917d6b43282..9ab02fdb11c1cb12dbe2553fce62c23f275c9fef 100644
--- a/components/invalidation/p2p_invalidator.cc
+++ b/components/invalidation/p2p_invalidator.cc
@@ -159,7 +159,7 @@ void P2PInvalidator::RegisterHandler(InvalidationHandler* handler) {
registrar_.RegisterHandler(handler);
}
-void P2PInvalidator::UpdateRegisteredIds(InvalidationHandler* handler,
+bool P2PInvalidator::UpdateRegisteredIds(InvalidationHandler* handler,
const ObjectIdSet& ids) {
DCHECK(thread_checker_.CalledOnValidThread());
ObjectIdSet new_ids;
@@ -168,12 +168,14 @@ void P2PInvalidator::UpdateRegisteredIds(InvalidationHandler* handler,
old_ids.begin(), old_ids.end(),
std::inserter(new_ids, new_ids.end()),
ObjectIdLessThan());
- registrar_.UpdateRegisteredIds(handler, ids);
+ if (!registrar_.UpdateRegisteredIds(handler, ids))
+ return false;
const P2PNotificationData notification_data(
invalidator_client_id_,
send_notification_target_,
ObjectIdInvalidationMap::InvalidateAll(ids));
SendNotificationData(notification_data);
+ return true;
}
void P2PInvalidator::UnregisterHandler(InvalidationHandler* handler) {
« no previous file with comments | « components/invalidation/p2p_invalidator.h ('k') | components/invalidation/ticl_invalidation_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698