Commit 464810d2 authored by Liquan (Max) Gu's avatar Liquan (Max) Gu Committed by Commit Bot

[WebLayer] onPaymentDetailsUpdated uses mSpec's details

PRService#updateWith() lets mSpec parse and save the updated details.
Now that the details have been saved to mSpec, we should use mSpec's
details instead using the original details. This would make the code
more logical and less error-prone as we use mSpec's details as the
single source of truth.

Bug: 1131059

Change-Id: Ib36e9a67880097ea6be14a2148b57b59b6c6bdb6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2533144
Commit-Queue: Liquan (Max) Gu <maxlg@chromium.org>
Reviewed-by: default avatarRouslan Solomakhin <rouslan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#826781}
parent 9325860b
......@@ -477,11 +477,10 @@ public class ChromePaymentRequestService implements BrowserPaymentRequest,
@Override
public void onPaymentDetailsUpdated(
PaymentDetails details, boolean hasNotifiedInvokedPaymentApp) {
if (mPaymentRequestService == null) return;
// mSpec.updateWith() can be used only when mSpec has not been destroyed.
assert !mSpec.isDestroyed();
// This method is only called from mPaymentRequestService.
assert mPaymentRequestService != null;
mPaymentUiService.updateDetailsOnPaymentRequestUI(mSpec.getPaymentDetails());
mPaymentUiService.updateDetailsOnPaymentRequestUI(details);
if (hasNotifiedInvokedPaymentApp) return;
......
......@@ -1017,7 +1017,8 @@ public class PaymentRequestService
PaymentDetailsConverter.convertToPaymentRequestDetailsUpdate(details,
/*methodChecker=*/this, mInvokedPaymentApp));
}
mBrowserPaymentRequest.onPaymentDetailsUpdated(details, hasNotifiedInvokedPaymentApp);
mBrowserPaymentRequest.onPaymentDetailsUpdated(
mSpec.getPaymentDetails(), hasNotifiedInvokedPaymentApp);
}
/**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment