|
|
Chromium Code Reviews|
Created:
3 years, 10 months ago by please use gerrit instead Modified:
3 years, 9 months ago Reviewers:
gogerald1 CC:
chromium-reviews, mahmadi+paymentswatch_chromium.org, rouslan+payments_chromium.org, sebsg+paymentswatch_chromium.org, gogerald+paymentswatch_chromium.org, agrieve+watch_chromium.org Target Ref:
refs/pending/heads/master Project:
chromium Visibility:
Public. |
DescriptionDon't cache canMakePayment results.
If a merchant calls PaymentRequest.canMakePayment() for the same method
names and method data multiple times, then the method should return the
most up-to-date result every time. This enables the merchant to prompt
the use to setup their payment instrument. Note that different payment
method data will trigger query quota exceeded error instead of returning
cached result from a prior query with different payment method data.
BUG=695931
Review-Url: https://codereview.chromium.org/2711263003
Cr-Commit-Position: refs/heads/master@{#453376}
Committed: https://chromium.googlesource.com/chromium/src/+/7085ee86276c0f53f36e89ef5372493b621c9374
Patch Set 1 #Patch Set 2 : Fixup #Patch Set 3 : Fix up #
Total comments: 10
Patch Set 4 : Addressed comments #
Messages
Total messages: 28 (19 generated)
The CQ bit was checked by rouslan@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Patchset #1 (id:1) has been deleted
rouslan@chromium.org changed reviewers: + gogerald@chromium.org
Ganggui, ptal.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: linux_android_rel_ng on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/linux_androi...)
Actually, this is not ready for review yet. I need to prevent the issue of querying for 'basic-card' multiple times, but with different data.supportedNetworks.
Description was changed from ========== Don't cache canMakePayment results. If a merchant calls PaymentRequest.canMakePayment() for the same method names, multiple times, then the method should return the most up-to-date result every time. This enables the merchant to prompt the use to setup their payment instrument. BUG=695931 ========== to ========== [DO NOT REVIEW] Don't cache canMakePayment results. If a merchant calls PaymentRequest.canMakePayment() for the same method names, multiple times, then the method should return the most up-to-date result every time. This enables the merchant to prompt the use to setup their payment instrument. BUG=695931 ==========
The CQ bit was checked by rouslan@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Description was changed from ========== [DO NOT REVIEW] Don't cache canMakePayment results. If a merchant calls PaymentRequest.canMakePayment() for the same method names, multiple times, then the method should return the most up-to-date result every time. This enables the merchant to prompt the use to setup their payment instrument. BUG=695931 ========== to ========== Don't cache canMakePayment results. If a merchant calls PaymentRequest.canMakePayment() for the same method names and method data multiple times, then the method should return the most up-to-date result every time. This enables the merchant to prompt the use to setup their payment instrument. Note that different payment method data will trigger query quota exceeded error instead of returning cached result from a prior query with different payment method data. BUG=695931 ==========
The CQ bit was checked by rouslan@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Description was changed from ========== Don't cache canMakePayment results. If a merchant calls PaymentRequest.canMakePayment() for the same method names and method data multiple times, then the method should return the most up-to-date result every time. This enables the merchant to prompt the use to setup their payment instrument. Note that different payment method data will trigger query quota exceeded error instead of returning cached result from a prior query with different payment method data. BUG=695931 ========== to ========== Don't cache canMakePayment results. If a merchant calls PaymentRequest.canMakePayment() for the same method names and method data multiple times, then the method should return the most up-to-date result every time. This enables the merchant to prompt the use to setup their payment instrument. Note that different payment method data will trigger query quota exceeded error instead of returning cached result from a prior query with different payment method data. BUG=695931 ==========
Ganggui, ptal patch 3. It's ready for review now.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
lgtm with comments https://codereview.chromium.org/2711263003/diff/60001/chrome/android/java/src... File chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java (right): https://codereview.chromium.org/2711263003/diff/60001/chrome/android/java/src... chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java:130: * @param methods The payment methods that are being queried. Map of the payment methods that are being queried and their data? https://codereview.chromium.org/2711263003/diff/60001/chrome/android/java/src... chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java:144: * @param methods The payment methods that are being queried. ditto https://codereview.chromium.org/2711263003/diff/60001/chrome/android/java/src... chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java:1247: if (!query.matchesPaymentMethods(Collections.unmodifiableMap(mMethodData))) { Might only do this match in above else statement. Or return in "if(query == null)" No need to change it in this CL though, https://codereview.chromium.org/2711263003/diff/60001/chrome/android/java/src... chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java:1256: if (isFinishedQueryingPaymentApps()) query.notifyObserversOfResponse(mCanMakePayment); Move above two sentences to "if(query == null)" bracket?
https://codereview.chromium.org/2711263003/diff/60001/chrome/android/java/src... File chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java (right): https://codereview.chromium.org/2711263003/diff/60001/chrome/android/java/src... chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java:130: * @param methods The payment methods that are being queried. On 2017/02/27 22:02:19, gogerald1 wrote: > Map of the payment methods that are being queried and their data? Done. https://codereview.chromium.org/2711263003/diff/60001/chrome/android/java/src... chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java:144: * @param methods The payment methods that are being queried. On 2017/02/27 22:02:19, gogerald1 wrote: > ditto Done. https://codereview.chromium.org/2711263003/diff/60001/chrome/android/java/src... chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java:1247: if (!query.matchesPaymentMethods(Collections.unmodifiableMap(mMethodData))) { On 2017/02/27 22:02:19, gogerald1 wrote: > Might only do this match in above else statement. Or return in "if(query == > null)" > > No need to change it in this CL though, Done. https://codereview.chromium.org/2711263003/diff/60001/chrome/android/java/src... chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java:1256: if (isFinishedQueryingPaymentApps()) query.notifyObserversOfResponse(mCanMakePayment); On 2017/02/27 22:02:19, gogerald1 wrote: > Move above two sentences to "if(query == null)" bracket? That would not handle the case of multiple calls to PaymentRequest.canMakePayment() on the same object, so not going to change this.
The CQ bit was checked by rouslan@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from gogerald@chromium.org Link to the patchset: https://codereview.chromium.org/2711263003/#ps80001 (title: "Addressed comments")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
https://codereview.chromium.org/2711263003/diff/60001/chrome/android/java/src... File chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java (right): https://codereview.chromium.org/2711263003/diff/60001/chrome/android/java/src... chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java:1256: if (isFinishedQueryingPaymentApps()) query.notifyObserversOfResponse(mCanMakePayment); On 2017/02/27 22:12:41, rouslan wrote: > On 2017/02/27 22:02:19, gogerald1 wrote: > > Move above two sentences to "if(query == null)" bracket? > > That would not handle the case of multiple calls to > PaymentRequest.canMakePayment() on the same object, so not going to change > this. Just want to make sure I understand it correct. If the call is on the same object, then query.addObserver(this); has been set before, so we no need to do it again, right? And we also no need to check isFinishedQueryingPaymentApps() since notifyObserversOfResponse will be called in onInstrumentsReady. Assume all of these operations in PaymentRequestImpl are in UI thread.
https://codereview.chromium.org/2711263003/diff/60001/chrome/android/java/src... File chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java (right): https://codereview.chromium.org/2711263003/diff/60001/chrome/android/java/src... chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java:1256: if (isFinishedQueryingPaymentApps()) query.notifyObserversOfResponse(mCanMakePayment); On 2017/02/27 22:40:53, gogerald1 wrote: > On 2017/02/27 22:12:41, rouslan wrote: > > On 2017/02/27 22:02:19, gogerald1 wrote: > > > Move above two sentences to "if(query == null)" bracket? > > > > That would not handle the case of multiple calls to > > PaymentRequest.canMakePayment() on the same object, so not going to change > > this. > > Just want to make sure I understand it correct. > > If the call is on the same object, then query.addObserver(this); has been set > before, so we no need to do it again, right? > > And we also no need to check isFinishedQueryingPaymentApps() since > notifyObserversOfResponse will be called in onInstrumentsReady. > > Assume all of these operations in PaymentRequestImpl are in UI thread. > Ah, got your idea, the problem might be the merchant website might call canMakePayment again after get response,
CQ is committing da patch.
Bot data: {"patchset_id": 80001, "attempt_start_ts": 1488233572434690,
"parent_rev": "33e60b30fadf6d9b3b129a884e8b1b2eeec79988", "commit_rev":
"7085ee86276c0f53f36e89ef5372493b621c9374"}
Message was sent while issue was closed.
Description was changed from ========== Don't cache canMakePayment results. If a merchant calls PaymentRequest.canMakePayment() for the same method names and method data multiple times, then the method should return the most up-to-date result every time. This enables the merchant to prompt the use to setup their payment instrument. Note that different payment method data will trigger query quota exceeded error instead of returning cached result from a prior query with different payment method data. BUG=695931 ========== to ========== Don't cache canMakePayment results. If a merchant calls PaymentRequest.canMakePayment() for the same method names and method data multiple times, then the method should return the most up-to-date result every time. This enables the merchant to prompt the use to setup their payment instrument. Note that different payment method data will trigger query quota exceeded error instead of returning cached result from a prior query with different payment method data. BUG=695931 Review-Url: https://codereview.chromium.org/2711263003 Cr-Commit-Position: refs/heads/master@{#453376} Committed: https://chromium.googlesource.com/chromium/src/+/7085ee86276c0f53f36e89ef5372... ==========
Message was sent while issue was closed.
Committed patchset #4 (id:80001) as https://chromium.googlesource.com/chromium/src/+/7085ee86276c0f53f36e89ef5372... |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
