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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java

Issue 2874883002: Fix chrome crash issue when payment modifiers are enabled on android. (Closed)
Patch Set: fix a crash issue caused by trying to change unmodifiable set, and a subsquent issue where mUI is r… Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java b/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java
index 61164ab434b43ec87f4695ee7747a9ce85f940bc..31caa2e0f473b527095309872c0f045ac11d6346 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java
@@ -857,13 +857,13 @@ public class PaymentRequestImpl implements PaymentRequest, PaymentRequestUI.Clie
formatter.format(total.amount.value), false /* isPending */));
mUiShoppingCart.setAdditionalContents(
modifier == null ? null : getLineItems(modifier.additionalDisplayItems));
- mUI.updateOrderSummarySection(mUiShoppingCart);
gogerald1 2017/05/11 20:11:20 why is this redundant? we have to update UI if mUi
wuandy1 2017/05/12 01:34:28 what i meant was it looked like at the end of upda
gogerald1 2017/05/12 14:23:04 This is also called when selected payment option i
}
/** @return The first modifier that matches the given instrument, or null. */
@Nullable private PaymentDetailsModifier getModifier(@Nullable PaymentInstrument instrument) {
if (mModifiers == null || instrument == null) return null;
- Set<String> methodNames = instrument.getInstrumentMethodNames();
+ // make a copy to ensure it is modifiable.
+ Set<String> methodNames = new HashSet<>(instrument.getInstrumentMethodNames());
methodNames.retainAll(mModifiers.keySet());
return methodNames.isEmpty() ? null : mModifiers.get(methodNames.iterator().next());
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698