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

Unified Diff: content/browser/payments/payment_app_database.h

Issue 2806133002: PaymentHandler: Implement set/get methods in PaymentInstruments (content) (Closed)
Patch Set: rebase 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
« no previous file with comments | « content/browser/payments/payment_app.proto ('k') | content/browser/payments/payment_app_database.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/payments/payment_app_database.h
diff --git a/content/browser/payments/payment_app_database.h b/content/browser/payments/payment_app_database.h
index 2e6ec55fd4c029ad80fc2ab209a975102b1c4e7f..bac4c9ca8f9eb4b16936c3599a36d540f17e64c2 100644
--- a/content/browser/payments/payment_app_database.h
+++ b/content/browser/payments/payment_app_database.h
@@ -32,6 +32,11 @@ class CONTENT_EXPORT PaymentAppDatabase {
std::pair<int64_t, payments::mojom::PaymentAppManifestPtr>;
using Manifests = std::vector<ManifestWithID>;
using ReadAllManifestsCallback = base::Callback<void(Manifests)>;
+ using ReadPaymentInstrumentCallback =
+ base::OnceCallback<void(payments::mojom::PaymentInstrumentPtr,
+ payments::mojom::PaymentHandlerStatus)>;
+ using WritePaymentInstrumentCallback =
+ base::OnceCallback<void(payments::mojom::PaymentHandlerStatus)>;
explicit PaymentAppDatabase(
scoped_refptr<ServiceWorkerContextWrapper> service_worker_context);
@@ -42,6 +47,13 @@ class CONTENT_EXPORT PaymentAppDatabase {
const WriteManifestCallback& callback);
void ReadManifest(const GURL& scope, const ReadManifestCallback& callback);
void ReadAllManifests(const ReadAllManifestsCallback& callback);
+ void ReadPaymentInstrument(const GURL& scope,
+ const std::string& instrumentKey,
+ ReadPaymentInstrumentCallback callback);
+ void WritePaymentInstrument(const GURL& scope,
+ const std::string& instrumentKey,
+ payments::mojom::PaymentInstrumentPtr instrument,
+ WritePaymentInstrumentCallback callback);
private:
// WriteManifest callbacks
@@ -68,6 +80,26 @@ class CONTENT_EXPORT PaymentAppDatabase {
const std::vector<std::pair<int64_t, std::string>>& raw_data,
ServiceWorkerStatusCode status);
+ // ReadPaymentInstrument callbacks
+ void DidFindRegistrationToReadPaymentInstrument(
+ const std::string& instrumentKey,
+ ReadPaymentInstrumentCallback callback,
+ ServiceWorkerStatusCode status,
+ scoped_refptr<ServiceWorkerRegistration> registration);
+ void DidReadPaymentInstrument(ReadPaymentInstrumentCallback callback,
+ const std::vector<std::string>& data,
+ ServiceWorkerStatusCode status);
+
+ // WritePaymentInstrument callbacks
+ void DidFindRegistrationToWritePaymentInstrument(
+ const std::string& instrumentKey,
+ payments::mojom::PaymentInstrumentPtr instrument,
+ WritePaymentInstrumentCallback callback,
+ ServiceWorkerStatusCode status,
+ scoped_refptr<ServiceWorkerRegistration> registration);
+ void DidWritePaymentInstrument(WritePaymentInstrumentCallback callback,
+ ServiceWorkerStatusCode status);
+
scoped_refptr<ServiceWorkerContextWrapper> service_worker_context_;
base::WeakPtrFactory<PaymentAppDatabase> weak_ptr_factory_;
« no previous file with comments | « content/browser/payments/payment_app.proto ('k') | content/browser/payments/payment_app_database.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698