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

Unified Diff: components/payments/payment_request.cc

Issue 2568933002: [WebPayments] Desktop: Adding validation and binding checks (Closed)
Patch Set: Missed line in rebase 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
« 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: components/payments/payment_request.cc
diff --git a/components/payments/payment_request.cc b/components/payments/payment_request.cc
index 538bea15975fec228e594a2756c94feea9b03955..98182c155672e0a96ae518de2a66c1702ffb3226 100644
--- a/components/payments/payment_request.cc
+++ b/components/payments/payment_request.cc
@@ -37,6 +37,7 @@ void PaymentRequest::Init(
if (!payments::validatePaymentDetails(details, &error)) {
LOG(ERROR) << error;
OnError();
+ client_.reset();
return;
}
client_ = std::move(client);
@@ -44,6 +45,10 @@ void PaymentRequest::Init(
}
void PaymentRequest::Show() {
+ if (!client_.is_bound() || !binding_.is_bound()) {
+ OnError();
+ return;
+ }
delegate_->ShowPaymentRequestDialog(this);
}
« 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