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

Unified Diff: components/payments/content/payment_request_spec.h

Issue 2757523002: [Payments] Use PaymentInstrument/AutofillPaymentInstrument throughout. (Closed)
Patch Set: remove instrument cache Created 3 years, 9 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: components/payments/content/payment_request_spec.h
diff --git a/components/payments/content/payment_request_spec.h b/components/payments/content/payment_request_spec.h
index d205a1bb4abaa69943b93f04c2b67a8eb0f9a344..819ecfb92e59d76142d7845f43870494e9ec270f 100644
--- a/components/payments/content/payment_request_spec.h
+++ b/components/payments/content/payment_request_spec.h
@@ -5,6 +5,7 @@
#ifndef COMPONENTS_PAYMENTS_CONTENT_PAYMENT_REQUEST_SPEC_H_
#define COMPONENTS_PAYMENTS_CONTENT_PAYMENT_REQUEST_SPEC_H_
+#include <set>
#include <string>
#include <vector>
@@ -49,6 +50,9 @@ class PaymentRequestSpec {
const std::vector<std::string>& supported_card_networks() {
return supported_card_networks_;
}
+ const std::set<std::string>& supported_card_networks_set() {
please use gerrit instead 2017/03/16 14:27:03 These methods should be const.
Mathieu 2017/03/16 14:57:04 Done.
+ return supported_card_networks_set_;
+ }
// Uses CurrencyFormatter to format |amount| with the currency symbol for this
// request's currency. Will use currency of the "total" display item, because
@@ -85,9 +89,11 @@ class PaymentRequestSpec {
const std::string app_locale_;
std::unique_ptr<CurrencyFormatter> currency_formatter_;
- // A list of supported basic card networks, in order that they were specified
- // by the merchant.
+ // A list/set of supported basic card networks. The list is used to keep the
+ // order in which they were specified by the merchant. The set is used for
+ // fast lookup of supported methods.
std::vector<std::string> supported_card_networks_;
+ std::set<std::string> supported_card_networks_set_;
base::ObserverList<Observer> observers_;

Powered by Google App Engine
This is Rietveld 408576698