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

Issue 2559153002: PaymentApp: Make the PaymentAppFactory asynchronous (Closed)

Created:
4 years ago by tommyt
Modified:
4 years ago
CC:
chromium-reviews, rouslan+payments_chromium.org, sebsg+paymentswatch_chromium.org, gogerald+paymentswatch_chromium.org, agrieve+watch_chromium.org, Rob Buis, pals, Ted C
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

PaymentApp: Make the PaymentAppFactory asynchronous The code for fetching and filtering payment instruments in PaymentRequestImpl is asynchronous anyway, so this change is not too intrusive. The main thing is to insert an extra asynchronous step to populate the mApps list before payment instrument filtering starts. If we want to take this further, a good next step would be to start showing apps as they are discovered, instead of waiting until we have received all the payment apps. It would also be a good thing to refactor some of this functionality out of the PaymentRequestImpl, as it is growing quite complex. Other changes that went into this commit: * Change the PaymentAppFactory into a singleton, rather than being a holder class for static functions. * Extend the AdditionalPaymentFactory functionality, so that the PaymentAppFactory can have many additional factories. This lets us make the ServiceWorkerPaymentAppBridge an additional factory, and normalize the relationship between the two classes. * Add two unit tests for testing delayed payment app creation. BUG=661608 Committed: https://crrev.com/b1a60e9fbe21734a3567c7cf10f9eea6570f9655 Cr-Commit-Position: refs/heads/master@{#437843}

Patch Set 1 #

Total comments: 34

Patch Set 2 : Address review comments #

Total comments: 2

Patch Set 3 : Fix native initialization and remove the workaround from PaymentAppFactory #

Patch Set 4 : Get rid of mWebContents #

Total comments: 2

Patch Set 5 : Address final review comment #

Patch Set 6 : Rebase onto latest master #

Messages

Total messages: 32 (19 generated)
tommyt
PTAL
4 years ago (2016-12-08 12:57:54 UTC) #2
please use gerrit instead
Great job! Thank you for looking into this. https://codereview.chromium.org/2559153002/diff/1/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentAppFactory.java File chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentAppFactory.java (right): https://codereview.chromium.org/2559153002/diff/1/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentAppFactory.java#newcode29 chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentAppFactory.java:29: private ...
4 years ago (2016-12-08 13:45:57 UTC) #3
tommyt
https://codereview.chromium.org/2559153002/diff/1/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentAppFactory.java File chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentAppFactory.java (right): https://codereview.chromium.org/2559153002/diff/1/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentAppFactory.java#newcode29 chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentAppFactory.java:29: private List<PaymentAppFactoryAddition> mAdditionalFactories; On 2016/12/08 13:45:56, rouslan wrote: > ...
4 years ago (2016-12-08 15:06:10 UTC) #6
please use gerrit instead
Ted, is this UnsatisifedLinkError a known problem? Does not seem right. https://codereview.chromium.org/2559153002/diff/1/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentAppFactory.java File chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentAppFactory.java (right): ...
4 years ago (2016-12-08 15:24:54 UTC) #8
Ted C
https://codereview.chromium.org/2559153002/diff/1/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentAppFactory.java File chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentAppFactory.java (right): https://codereview.chromium.org/2559153002/diff/1/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentAppFactory.java#newcode55 chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentAppFactory.java:55: // Don't call ChromeFeatureList.isEnabled() while running unit tests. On ...
4 years ago (2016-12-08 15:43:17 UTC) #10
please use gerrit instead
On 2016/12/08 15:43:17, Ted C (OOO 12.8.16) wrote: > That looks like you haven't initialized ...
4 years ago (2016-12-08 16:10:00 UTC) #11
please use gerrit instead
https://codereview.chromium.org/2559153002/diff/20001/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestServiceWorkerPaymentAppTest.java File chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestServiceWorkerPaymentAppTest.java (right): https://codereview.chromium.org/2559153002/diff/20001/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestServiceWorkerPaymentAppTest.java#newcode84 chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestServiceWorkerPaymentAppTest.java:84: openPageAndClickBuyAndWait(mShowFailed); I see what's going on. Line 83 needs ...
4 years ago (2016-12-08 16:13:48 UTC) #12
tommyt
https://codereview.chromium.org/2559153002/diff/1/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentAppFactory.java File chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentAppFactory.java (right): https://codereview.chromium.org/2559153002/diff/1/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentAppFactory.java#newcode55 chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentAppFactory.java:55: // Don't call ChromeFeatureList.isEnabled() while running unit tests. On ...
4 years ago (2016-12-09 10:15:04 UTC) #14
please use gerrit instead
lgtm % comment https://codereview.chromium.org/2559153002/diff/60001/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java File chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java (right): https://codereview.chromium.org/2559153002/diff/60001/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java#newcode525 chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java:525: } No need to separate this ...
4 years ago (2016-12-09 13:58:27 UTC) #15
tommyt
https://codereview.chromium.org/2559153002/diff/60001/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java File chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java (right): https://codereview.chromium.org/2559153002/diff/60001/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java#newcode525 chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java:525: } On 2016/12/09 13:58:27, rouslan wrote: > No need ...
4 years ago (2016-12-09 15:06:20 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2559153002/100001
4 years ago (2016-12-12 10:36:46 UTC) #27
commit-bot: I haz the power
Committed patchset #6 (id:100001)
4 years ago (2016-12-12 10:40:46 UTC) #30
commit-bot: I haz the power
4 years ago (2016-12-12 15:11:24 UTC) #32
Message was sent while issue was closed.
Patchset 6 (id:??) landed as
https://crrev.com/b1a60e9fbe21734a3567c7cf10f9eea6570f9655
Cr-Commit-Position: refs/heads/master@{#437843}

Powered by Google App Engine
This is Rietveld 408576698