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

Unified Diff: content/browser/payments/payment_app_context_impl.cc

Issue 2556433002: PaymentApp: Implement GetAllManifests() in PaymentAppContext. (Closed)
Patch Set: addressed comments Created 4 years 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: content/browser/payments/payment_app_context_impl.cc
diff --git a/content/browser/payments/payment_app_context_impl.cc b/content/browser/payments/payment_app_context_impl.cc
index 37a3fcbf4bdefeb7366d0a38c75f728eb33b4f10..eb5a9556667d237c234cd4b9596c4344d16d932e 100644
--- a/content/browser/payments/payment_app_context_impl.cc
+++ b/content/browser/payments/payment_app_context_impl.cc
@@ -9,7 +9,6 @@
#include "base/bind.h"
#include "base/memory/ptr_util.h"
#include "base/stl_util.h"
-#include "content/browser/payments/payment_app_database.h"
#include "content/browser/payments/payment_app_manager.h"
#include "content/public/browser/browser_thread.h"
@@ -64,7 +63,10 @@ PaymentAppDatabase* PaymentAppContextImpl::payment_app_database() const {
void PaymentAppContextImpl::GetAllManifests(
const GetAllManifestsCallback& callback) {
- NOTIMPLEMENTED();
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
+ BrowserThread::PostTask(
+ BrowserThread::IO, FROM_HERE,
+ base::Bind(&PaymentAppContextImpl::GetAllManifestsOnIO, this, callback));
}
PaymentAppContextImpl::~PaymentAppContextImpl() {
@@ -101,4 +103,21 @@ void PaymentAppContextImpl::DidShutdown() {
is_shutdown_ = true;
}
+void PaymentAppContextImpl::GetAllManifestsOnIO(
+ const GetAllManifestsCallback& callback) {
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
+ payment_app_database()->ReadAllManifests(base::Bind(
+ &PaymentAppContextImpl::DidGetAllManifestsOnIO, this, callback));
+}
+
+void PaymentAppContextImpl::DidGetAllManifestsOnIO(
+ const GetAllManifestsCallback& callback,
+ Manifests manifests) {
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
+
+ BrowserThread::PostTask(
+ BrowserThread::UI, FROM_HERE,
+ base::Bind(callback, base::Passed(std::move(manifests))));
+}
+
} // namespace content
« no previous file with comments | « content/browser/payments/payment_app_context_impl.h ('k') | content/browser/payments/payment_app_context_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698