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

Unified Diff: chrome/browser/webdata/web_data_service.cc

Issue 7633011: Added WebIntents GetAll support (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Created 9 years, 4 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/webdata/web_data_service.cc
diff --git a/chrome/browser/webdata/web_data_service.cc b/chrome/browser/webdata/web_data_service.cc
index 80d75f1d9b3d405cb45116c139469d2f13ce987a..5f5215458e6c93ac4c7e471cec63e3c31092896b 100644
--- a/chrome/browser/webdata/web_data_service.cc
+++ b/chrome/browser/webdata/web_data_service.cc
@@ -250,6 +250,18 @@ WebDataService::Handle WebDataService::GetWebIntents(const string16& action,
return request->GetHandle();
}
+WebDataService::Handle WebDataService::GetAllWebIntents(
+ WebDataServiceConsumer* consumer) {
+ DCHECK(consumer);
+ GenericRequest<std::string>* request = new GenericRequest<std::string>(
+ this, GetNextRequestHandle(), consumer, std::string());
+ RegisterRequest(request);
+ ScheduleTask(
Greg Billock 2011/08/12 17:34:25 Do these need to schedule on the DB thread or File
groby-ooo-7-16 2011/08/12 19:51:38 They're scheduled on the DB thread - see http://go
+ NewRunnableMethod(this,
+ &WebDataService::GetAllWebIntentsImpl,
+ request));
+ return request->GetHandle();
+}
////////////////////////////////////////////////////////////////////////////////
//
@@ -861,6 +873,18 @@ void WebDataService::GetWebIntentsImpl(GenericRequest<string16>* request) {
request->RequestComplete();
}
+void WebDataService::GetAllWebIntentsImpl(
+ GenericRequest<std::string>* request) {
+ InitializeDatabaseIfNecessary();
+ if (db_ && !request->IsCancelled()) {
+ std::vector<WebIntentData> result;
+ db_->GetWebIntentsTable()->GetAllWebIntents(&result);
+ request->SetResult(
+ new WDResult<std::vector<WebIntentData> >(WEB_INTENTS_RESULT, result));
+ }
+ request->RequestComplete();
+}
+
////////////////////////////////////////////////////////////////////////////////
//
// Token Service implementation.

Powered by Google App Engine
This is Rietveld 408576698