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

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

Issue 2572183002: PaymentApp: Introduce PaymentAppDatabase class. (Closed)
Patch Set: rebase 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 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

Powered by Google App Engine
This is Rietveld 408576698