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

Unified Diff: components/offline_items_collection/core/offline_content_aggregator.cc

Issue 2833793002: Added AddDownload communication path and observers
Patch Set: Addressed comments and moved thrad jumps into the client proxy. Created 3 years, 8 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: 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(

Powered by Google App Engine
This is Rietveld 408576698