Chromium Code Reviews| 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 8e83b60aeba95726eaeebf63eacaff4a9cd4d91e..35366066f3e4141511943f47556bf288ef446fbc 100644 |
| --- a/content/browser/payments/payment_app_database.h |
| +++ b/content/browser/payments/payment_app_database.h |
| @@ -17,6 +17,10 @@ |
| #include "content/common/service_worker/service_worker_status_code.h" |
| #include "mojo/public/cpp/bindings/binding.h" |
| +using payments::mojom::PaymentHandlerStatus; |
|
please use gerrit instead
2017/04/12 19:11:31
Please don't put such "using" statements in header
zino
2017/04/15 05:18:09
Done.
|
| +using payments::mojom::PaymentInstrument; |
| +using payments::mojom::PaymentInstrumentPtr; |
| + |
| namespace content { |
| class ServiceWorkerRegistration; |
| @@ -32,6 +36,10 @@ 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(PaymentInstrumentPtr, PaymentHandlerStatus)>; |
| + using WritePaymentInstrumentCallback = |
| + base::OnceCallback<void(PaymentHandlerStatus)>; |
|
please use gerrit instead
2017/04/12 19:11:31
These "using" statements are OK, by the way.
|
| explicit PaymentAppDatabase( |
| scoped_refptr<ServiceWorkerContextWrapper> service_worker_context); |
| @@ -42,6 +50,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, |
| + PaymentInstrumentPtr instrument, |
| + WritePaymentInstrumentCallback callback); |
| private: |
| // WriteManifest callbacks |
| @@ -68,6 +83,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, |
| + 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_; |