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

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

Issue 2757773002: Support providers with two namespaces (Closed)
Patch Set: Created 3 years, 9 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.h
diff --git a/components/offline_items_collection/core/offline_content_aggregator.h b/components/offline_items_collection/core/offline_content_aggregator.h
index 8863760754c739889e4f82229e8586a87fde5596..f794afcc3a791206673f63e2526074e62bce7a5d 100644
--- a/components/offline_items_collection/core/offline_content_aggregator.h
+++ b/components/offline_items_collection/core/offline_content_aggregator.h
@@ -56,6 +56,17 @@ class OfflineContentAggregator : public OfflineContentProvider,
// |name_space|. UI actions taken on OfflineItems with |name_space| will be
// routed to |provider|. |provider| is expected to only expose OfflineItems
// with |name_space| set.
+ // It is okay to register the same provider with multiple unique namespaces.
+ // The class will work as expected with a few caveats. These are fixable if
+ // they are necessary for proper operation. Contact dtrainor@ if changes to
+ // this behavior is needed.
+ // 1. Unregistering the first namespace won't remove any pending actions
+ // that are queued for this provider. That means the provider might
+ // still get actions for the removed namespace once it is done
+ // initializing itself. This case must be handled by the individual
+ // provider for now.
+ // 2. The provider needs to handle calls to GetAllItems properly (not return
+ // any items for a namespace that it didn't register.
fgorski 2017/03/17 04:15:15 nit: close )
David Trainor- moved to gerrit 2017/03/22 00:12:45 Done.
void RegisterProvider(const std::string& name_space,
OfflineContentProvider* provider);

Powered by Google App Engine
This is Rietveld 408576698