Chromium Code Reviews| Index: components/invalidation/invalidator_registrar.cc |
| diff --git a/components/invalidation/invalidator_registrar.cc b/components/invalidation/invalidator_registrar.cc |
| index 9ee6a94fbdaff6dc14a02c9db2eef4f94e180bec..21df5bdfc91f9dc629ae39b151c80ff24c38d6b6 100644 |
| --- a/components/invalidation/invalidator_registrar.cc |
| +++ b/components/invalidation/invalidator_registrar.cc |
| @@ -28,9 +28,8 @@ void InvalidatorRegistrar::RegisterHandler(InvalidationHandler* handler) { |
| handlers_.AddObserver(handler); |
| } |
| -void InvalidatorRegistrar::UpdateRegisteredIds( |
| - InvalidationHandler* handler, |
| - const ObjectIdSet& ids) { |
| +bool InvalidatorRegistrar::UpdateRegisteredIds(InvalidationHandler* handler, |
| + const ObjectIdSet& ids) { |
| DCHECK(thread_checker_.CalledOnValidThread()); |
| CHECK(handler); |
| CHECK(handlers_.HasObserver(handler)); |
| @@ -47,11 +46,12 @@ void InvalidatorRegistrar::UpdateRegisteredIds( |
| ids.begin(), ids.end(), |
| std::inserter(intersection, intersection.end()), |
| ObjectIdLessThan()); |
| - CHECK(intersection.empty()) |
| - << "Duplicate registration: trying to register " |
| - << ObjectIdToString(*intersection.begin()) << " for " |
| - << handler << " when it's already registered for " |
| - << it->first; |
| + if (!intersection.empty()) { |
| + DVLOG(0) << "Duplicate registration: trying to register " |
|
maniscalco
2015/05/18 15:42:28
Can you walk me through the thought process on the
pavely
2015/05/18 18:38:04
I think LOG(ERROR) and DVLOG(0) have the same effe
maniscalco
2015/05/18 18:56:05
Cool. As we discussed offline, the V in DVLOG sta
|
| + << ObjectIdToString(*intersection.begin()) << " for " << handler |
| + << " when it's already registered for " << it->first; |
| + return false; |
| + } |
| } |
| if (ids.empty()) { |
| @@ -59,6 +59,7 @@ void InvalidatorRegistrar::UpdateRegisteredIds( |
| } else { |
| handler_to_ids_map_[handler] = ids; |
| } |
| + return true; |
| } |
| void InvalidatorRegistrar::UnregisterHandler(InvalidationHandler* handler) { |