Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTENT_BROWSER_PAYMENTS_PAYMENT_APP_CONTEXT_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_PAYMENTS_PAYMENT_APP_CONTEXT_IMPL_H_ |
| 6 #define CONTENT_BROWSER_PAYMENTS_PAYMENT_APP_CONTEXT_IMPL_H_ | 6 #define CONTENT_BROWSER_PAYMENTS_PAYMENT_APP_CONTEXT_IMPL_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 33 void Shutdown(); | 33 void Shutdown(); |
| 34 | 34 |
| 35 // Create a PaymentAppManager that is owned by this. Call on the UI | 35 // Create a PaymentAppManager that is owned by this. Call on the UI |
| 36 // thread. | 36 // thread. |
| 37 void CreateService( | 37 void CreateService( |
| 38 mojo::InterfaceRequest<payments::mojom::PaymentAppManager> request); | 38 mojo::InterfaceRequest<payments::mojom::PaymentAppManager> request); |
| 39 | 39 |
| 40 // Called by PaymentAppManager objects so that they can | 40 // Called by PaymentAppManager objects so that they can |
| 41 // be deleted. Call on the IO thread. | 41 // be deleted. Call on the IO thread. |
| 42 void ServiceHadConnectionError(PaymentAppManager* service); | 42 void ServiceHadConnectionError(PaymentAppManager* service); |
| 43 | 43 |
|
please use gerrit instead
2016/12/12 20:17:39
// Should be accessed only on the IO thread.
zino
2016/12/16 19:45:40
Done.
| |
| 44 PaymentAppDatabase* payment_app_database() const; | 44 PaymentAppDatabase* payment_app_database() const; |
| 45 | 45 |
| 46 // Call on the UI thread. | |
|
please use gerrit instead
2016/12/12 20:17:39
// Should be called on the UI thread.
zino
2016/12/16 19:45:40
Done.
| |
| 46 void GetAllManifests(const GetAllManifestsCallback& callback) override; | 47 void GetAllManifests(const GetAllManifestsCallback& callback) override; |
| 47 | 48 |
| 48 protected: | 49 protected: |
| 49 friend class base::RefCountedThreadSafe<PaymentAppContextImpl>; | 50 friend class base::RefCountedThreadSafe<PaymentAppContextImpl>; |
| 50 friend class PaymentAppManagerTest; | 51 friend class PaymentAppContentUnitTestBase; |
| 51 virtual ~PaymentAppContextImpl(); | 52 virtual ~PaymentAppContextImpl(); |
| 52 | 53 |
| 53 private: | 54 private: |
| 54 void CreatePaymentAppDatabaseOnIO( | 55 void CreatePaymentAppDatabaseOnIO( |
| 55 scoped_refptr<ServiceWorkerContextWrapper> service_worker_context); | 56 scoped_refptr<ServiceWorkerContextWrapper> service_worker_context); |
| 56 | 57 |
| 57 void CreateServiceOnIOThread( | 58 void CreateServiceOnIOThread( |
| 58 mojo::InterfaceRequest<payments::mojom::PaymentAppManager> request); | 59 mojo::InterfaceRequest<payments::mojom::PaymentAppManager> request); |
| 59 | 60 |
| 60 void ShutdownOnIO(); | 61 void ShutdownOnIO(); |
| 61 | 62 |
| 63 void GetAllManifestsOnIO(const GetAllManifestsCallback& callback); | |
| 64 // void DidGetAllManifestsOnIO(const PaymentAppDatabase::Manifests& | |
|
please use gerrit instead
2016/12/12 20:17:39
Seems you forgot to remove this.
zino
2016/12/16 19:45:40
Done.
| |
| 65 // manifests); | |
| 66 void DidGetAllManifestsOnIO(const GetAllManifestsCallback& callback, | |
| 67 PaymentAppDatabase::Manifests manifests); | |
| 68 | |
| 62 // Only accessed on the IO thread. | 69 // Only accessed on the IO thread. |
| 63 std::unique_ptr<PaymentAppDatabase> payment_app_database_; | 70 std::unique_ptr<PaymentAppDatabase> payment_app_database_; |
| 64 | 71 |
| 65 // The services are owned by this. They're either deleted | 72 // The services are owned by this. They're either deleted |
| 66 // during ShutdownOnIO or when the channel is closed via | 73 // during ShutdownOnIO or when the channel is closed via |
| 67 // ServiceHadConnectionError. Only accessed on the IO thread. | 74 // ServiceHadConnectionError. Only accessed on the IO thread. |
| 68 std::map<PaymentAppManager*, std::unique_ptr<PaymentAppManager>> services_; | 75 std::map<PaymentAppManager*, std::unique_ptr<PaymentAppManager>> services_; |
| 69 | 76 |
| 70 DISALLOW_COPY_AND_ASSIGN(PaymentAppContextImpl); | 77 DISALLOW_COPY_AND_ASSIGN(PaymentAppContextImpl); |
| 71 }; | 78 }; |
| 72 | 79 |
| 73 } // namespace content | 80 } // namespace content |
| 74 | 81 |
| 75 #endif // CONTENT_BROWSER_PAYMENTS_PAYMENT_APP_CONTEXT_IMPL_H_ | 82 #endif // CONTENT_BROWSER_PAYMENTS_PAYMENT_APP_CONTEXT_IMPL_H_ |
| OLD | NEW |