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

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

Issue 2629883004: [Payment Request] Update the CurrencyStringFormatter to call the native impl. (Closed)
Patch Set: addressed comments Created 3 years, 11 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
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 0070b15e67ec7fe5fa2eb600c16e12cd09be90df..f4586fc22f1be909a4e86d1ec7883c1ebddbfc0a 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
@@ -326,6 +326,14 @@ public class PaymentRequestImpl
recordSuccessFunnelHistograms("Initiated");
}
+ protected void finalize() throws Throwable {
+ super.finalize();
+ if (mFormatter != null) {
+ // Ensures the native implementation of currency formatter does not leak.
+ mFormatter.destroy();
+ }
+ }
+
/**
* Called by the merchant website to initialize the payment request data.
*/
@@ -597,7 +605,7 @@ public class PaymentRequestImpl
if (mFormatter == null) {
mFormatter = new CurrencyStringFormatter(details.total.amount.currency,
- Locale.getDefault());
+ details.total.amount.currencySystem, Locale.getDefault());
}
// Total is never pending.

Powered by Google App Engine
This is Rietveld 408576698