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

Unified Diff: chrome/browser/intents/web_intents_registry.h

Issue 10827056: Use IntentsQuery as the WDS consumer. By unencumbering WebIntentsRegistry of this responsibility we… (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 5 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: chrome/browser/intents/web_intents_registry.h
diff --git a/chrome/browser/intents/web_intents_registry.h b/chrome/browser/intents/web_intents_registry.h
index 581693d30d943318aecb569dcffd793118435cc7..218be42742ec8a33bbea2bdc4cf5ab8c1c5f0de9 100644
--- a/chrome/browser/intents/web_intents_registry.h
+++ b/chrome/browser/intents/web_intents_registry.h
@@ -21,9 +21,7 @@ class Extension;
// Handles storing and retrieving of web intents services in the web database.
// The registry provides filtering logic to retrieve specific types of services.
-class WebIntentsRegistry
- : public WebDataServiceConsumer,
- public ProfileKeyedService {
+class WebIntentsRegistry : public ProfileKeyedService {
public:
typedef std::vector<webkit_glue::WebIntentServiceData> IntentServiceList;
@@ -110,21 +108,20 @@ class WebIntentsRegistry
void CollapseIntents(IntentServiceList* services);
private:
- const extensions::Extension* ExtensionForURL(const std::string& url);
+ const extensions::Extension* ExtensionForURL(const std::string& url);
- struct IntentsQuery;
+ struct IntentsQuery;
+ typedef std::vector<IntentsQuery*> QueryVector;
- // Maps web data requests to intents queries.
- // Allows OnWebDataServiceRequestDone to forward to appropriate consumer.
- typedef base::hash_map<WebDataService::Handle, IntentsQuery*> QueryMap;
-
- // WebDataServiceConsumer implementation.
- virtual void OnWebDataServiceRequestDone(
+ // Handles services loaded
+ void OnWebIntentsResultReceived(
+ IntentsQuery* query,
WebDataService::Handle h,
- const WDTypedResult* result) OVERRIDE;
+ const WDTypedResult* result);
- // Delegate for defaults requests from OnWebDataServiceRequestDone.
- virtual void OnWebDataServiceDefaultsRequestDone(
+ // Handles default services loaded
+ void OnWebIntentsDefaultsResultReceived(
+ IntentsQuery* query,
WebDataService::Handle h,
const WDTypedResult* result);
@@ -132,8 +129,15 @@ class WebIntentsRegistry
void DoGetIntentServicesForExtensionFilter(scoped_ptr<IntentsQuery> query,
const std::string& extension_id);
+ // Adds a query to the list of pending queries.
+ void TrackQuery(IntentsQuery* query);
+
+ // Takes ownership of a query. This removes a query from the list
+ // of pending queries.
+ bool ClaimQuery(IntentsQuery* query);
Greg Billock 2012/07/27 00:41:29 How about UntrackQuery?
+
// Map for all in-flight web data requests/intent queries.
- QueryMap queries_;
+ QueryVector pending_queries_;
groby-ooo-7-16 2012/07/27 00:11:26 Why no map?
Steve McKay 2012/07/27 00:54:46 The map only existed to associate wds handles with
// Local reference to Web Data Service.
scoped_refptr<WebDataService> wds_;
« no previous file with comments | « no previous file | chrome/browser/intents/web_intents_registry.cc » ('j') | chrome/browser/intents/web_intents_registry.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698