| 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 21 matching lines...) Expand all Loading... |
| 32 // However, the PaymentAppDatabase that this class has internally should work on | 32 // However, the PaymentAppDatabase that this class has internally should work on |
| 33 // IO thread. So, this class has Init() and Shutdown() methods in addition to | 33 // IO thread. So, this class has Init() and Shutdown() methods in addition to |
| 34 // constructor and destructor. They should be called explicitly when creating | 34 // constructor and destructor. They should be called explicitly when creating |
| 35 // and destroying StoragePartitionImpl. | 35 // and destroying StoragePartitionImpl. |
| 36 // | 36 // |
| 37 // Expected order of lifetime calls: | 37 // Expected order of lifetime calls: |
| 38 // 1) Constructor | 38 // 1) Constructor |
| 39 // 2) Init() | 39 // 2) Init() |
| 40 // 3) Can now call other public methods in this class in any order. | 40 // 3) Can now call other public methods in this class in any order. |
| 41 // - Can call CreatePaymentManager() on UI thread. | 41 // - Can call CreatePaymentManager() on UI thread. |
| 42 // - Can call GetAllManifests() on UI thread. | 42 // - Can call GetAllPaymentApps() on UI thread. |
| 43 // - Can call PaymentManagerHadConnectionError() on IO thread. | 43 // - Can call PaymentManagerHadConnectionError() on IO thread. |
| 44 // - Can call payment_app_database() on IO thread. | 44 // - Can call payment_app_database() on IO thread. |
| 45 // 4) Shutdown() | 45 // 4) Shutdown() |
| 46 // 5) Destructor | 46 // 5) Destructor |
| 47 class CONTENT_EXPORT PaymentAppContextImpl | 47 class CONTENT_EXPORT PaymentAppContextImpl |
| 48 : public base::RefCountedThreadSafe<PaymentAppContextImpl> { | 48 : public base::RefCountedThreadSafe<PaymentAppContextImpl> { |
| 49 public: | 49 public: |
| 50 PaymentAppContextImpl(); | 50 PaymentAppContextImpl(); |
| 51 | 51 |
| 52 // Init and Shutdown are for use on the UI thread when the | 52 // Init and Shutdown are for use on the UI thread when the |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 | 92 |
| 93 // Only accessed on the UI thread. | 93 // Only accessed on the UI thread. |
| 94 bool is_shutdown_; | 94 bool is_shutdown_; |
| 95 | 95 |
| 96 DISALLOW_COPY_AND_ASSIGN(PaymentAppContextImpl); | 96 DISALLOW_COPY_AND_ASSIGN(PaymentAppContextImpl); |
| 97 }; | 97 }; |
| 98 | 98 |
| 99 } // namespace content | 99 } // namespace content |
| 100 | 100 |
| 101 #endif // CONTENT_BROWSER_PAYMENTS_PAYMENT_APP_CONTEXT_IMPL_H_ | 101 #endif // CONTENT_BROWSER_PAYMENTS_PAYMENT_APP_CONTEXT_IMPL_H_ |
| OLD | NEW |