Index: content/browser/payments/payment_app_context_impl.h |
diff --git a/content/browser/payments/payment_app_context_impl.h b/content/browser/payments/payment_app_context_impl.h |
index e3fd583411246f14e923d58e5ef95e23f0cd6b8e..82b39519a6c68576cc87dada59e91aca392e1bd6 100644 |
--- a/content/browser/payments/payment_app_context_impl.h |
+++ b/content/browser/payments/payment_app_context_impl.h |
@@ -11,6 +11,7 @@ |
#include "base/macros.h" |
#include "base/memory/ref_counted.h" |
#include "components/payments/payment_app.mojom.h" |
+#include "content/browser/payments/payment_app_database.h" |
please use gerrit instead
2016/12/14 19:44:00
Forward-declare instead?
zino
2016/12/15 17:56:52
Done.
|
#include "content/common/content_export.h" |
#include "content/public/browser/payment_app_context.h" |
@@ -23,8 +24,11 @@ class CONTENT_EXPORT PaymentAppContextImpl |
: public base::RefCountedThreadSafe<PaymentAppContextImpl>, |
NON_EXPORTED_BASE(public PaymentAppContext) { |
public: |
- explicit PaymentAppContextImpl( |
- scoped_refptr<ServiceWorkerContextWrapper> service_worker_context); |
+ PaymentAppContextImpl(); |
+ |
+ // Init and Shutdown are for use on the UI thread when the |
+ // StoragePartition is being setup and torn down. |
+ void Init(scoped_refptr<ServiceWorkerContextWrapper> service_worker_context); |
// Shutdown must be called before deleting this. Call on the UI thread. |
void Shutdown(); |
@@ -38,7 +42,8 @@ class CONTENT_EXPORT PaymentAppContextImpl |
// be deleted. Call on the IO thread. |
void ServiceHadConnectionError(PaymentAppManager* service); |
- ServiceWorkerContextWrapper* service_worker_context() const; |
+ // Should be accessed only on the IO thread. |
+ PaymentAppDatabase* payment_app_database() const; |
// PaymentAppContext implementation: |
void GetAllManifests(const GetAllManifestsCallback& callback) override; |
@@ -50,12 +55,16 @@ class CONTENT_EXPORT PaymentAppContextImpl |
friend class base::RefCountedThreadSafe<PaymentAppContextImpl>; |
~PaymentAppContextImpl() override; |
- void CreateServiceOnIOThread( |
+ void CreatePaymentAppDatabaseOnIO( |
+ scoped_refptr<ServiceWorkerContextWrapper> service_worker_context); |
+ |
+ void CreateServiceOnIO( |
mojo::InterfaceRequest<payments::mojom::PaymentAppManager> request); |
void ShutdownOnIO(); |
- scoped_refptr<ServiceWorkerContextWrapper> service_worker_context_; |
+ // Only accessed on the IO thread. |
+ std::unique_ptr<PaymentAppDatabase> payment_app_database_; |
// The services are owned by this. They're either deleted |
// during ShutdownOnIO or when the channel is closed via |