DescriptionPaymentApp: Add PaymentAppProvider class.
The purpose of this class is to expose the following APIs to the chrome layer:
- GetAllManifests(): query all stored payment app manifests.
- InvokePaymentApp(): activate service worker and dispatch a payment event.
This has several advantages. First, the role of each class will be clearer.
After this patch, each role is as follows:
- PaymentAppProvider: Expose the APIs for use in chrome layer.
- PaymentAppContext: Manage requests coming from Blink and Chrome
(PaymentAppManager and PaymentAppProvider) to store/query manifest data.
- PaymentAppDatabase: It's owned by PaymentAppContext. Write or read the
manifest data of payment app to associated service worker DB.
Second, no longer consider to query each storage partition iteratively in the
chrome layer. So, we can share the logic in all implementation.
(e.g. android and desktop in chrome layer)
This patch modified many files, but it can be summarized as follows:
- Write a PaymentAppProvider class as singleton.
- Move GetAllManifests() method from PaymentAppContext to PaymentAppProvider.
- Move the logic that queries the manifest data from the payment app context
per storage partition, from the chrome layer to content layer.
- Rename payment_app_context_impl_unittest.cc with
payment_app_provider_impl_unittest.cc
BUG=661608
TEST=payment_app_provider_impl_unittest.cc
Review-Url: https://codereview.chromium.org/2609103002
Cr-Commit-Position: refs/heads/master@{#441639}
Committed: https://chromium.googlesource.com/chromium/src/+/ac34b3a3ff3cbe7b56d7e5b840eccf1efcb7ff2e
Patch Set 1 #Patch Set 2 : fix the test #Patch Set 3 : app_bridge.cc #Patch Set 4 : fix bot error #Patch Set 5 : PaymentApp: Add PaymentAppProvider class. #Patch Set 6 : PaymentApp: Add PaymentAppProvider class. #
Total comments: 13
Patch Set 7 : addressed rouslan's comment #Patch Set 8 : Remove override keyword #Messages
Total messages: 46 (33 generated)
|