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; |
harkness
2017/04/20 12:25:16
dtrainor: This is ugly, but I threw it in there to
Peter Beverloo
2017/04/20 16:27:55
There's a race condition there. If the OCA would s
David Trainor- moved to gerrit
2017/04/25 03:24:42
It actually does queue them up and flush them once
|
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( |