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

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

Issue 2572183002: PaymentApp: Introduce PaymentAppDatabase class. (Closed)
Patch Set: 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.h
diff --git a/content/browser/payments/payment_app_context_impl.h b/content/browser/payments/payment_app_context_impl.h
index f3af23a95a6415023f3934a7789b67998aecd295..ba47129e12894dc8c1e12eae4cf9bb27bfd9f37c 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"
#include "content/common/content_export.h"
#include "content/public/browser/payment_app_context.h"
@@ -23,8 +24,11 @@ class CONTENT_EXPORT PaymentAppContextImpl
: NON_EXPORTED_BASE(public PaymentAppContext),
public base::RefCountedThreadSafe<PaymentAppContextImpl> {
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,7 @@ class CONTENT_EXPORT PaymentAppContextImpl
// be deleted. Call on the IO thread.
void ServiceHadConnectionError(PaymentAppManager* service);
- ServiceWorkerContextWrapper* service_worker_context() const;
+ PaymentAppDatabase* payment_app_database() const;
void GetAllManifests(const GetAllManifestsCallback& callback) override;
@@ -48,12 +52,16 @@ class CONTENT_EXPORT PaymentAppContextImpl
virtual ~PaymentAppContextImpl();
private:
+ void CreatePaymentAppDatabaseOnIO(
+ scoped_refptr<ServiceWorkerContextWrapper> service_worker_context);
+
void CreateServiceOnIOThread(
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

Powered by Google App Engine
This is Rietveld 408576698