Index: components/offline_items_collection/core/offline_content_aggregator.cc |
diff --git a/components/offline_items_collection/core/offline_content_aggregator.cc b/components/offline_items_collection/core/offline_content_aggregator.cc |
index 19eaa574efe84bda5c98a87a569c7a2172fb004a..1ab86a3703e036c3c57329de6f069e69acf815f3 100644 |
--- a/components/offline_items_collection/core/offline_content_aggregator.cc |
+++ b/components/offline_items_collection/core/offline_content_aggregator.cc |
@@ -42,10 +42,14 @@ void OfflineContentAggregator::RegisterProvider( |
// Only set up the connection to the provider if the provider isn't associated |
// with any other namespace. |
+ bool need_add_observer = false; |
David Trainor- moved to gerrit
2017/04/25 03:24:43
needs_add_observer = !MapContainsValue(providers_,
|
if (!MapContainsValue(providers_, provider)) |
- provider->AddObserver(this); |
+ need_add_observer = true; |
providers_[name_space] = provider; |
+ |
+ if (need_add_observer) |
+ provider->AddObserver(this); |
} |
void OfflineContentAggregator::UnregisterProvider( |