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

Unified Diff: components/payments/content/payment_manifest_parser_host.cc

Issue 2809193002: Fix crash in release mode of payment manifest parser. (Closed)
Patch Set: Fix crash. Created 3 years, 8 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 | « components/payments/content/android/payment_manifest_parser_android.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/payments/content/payment_manifest_parser_host.cc
diff --git a/components/payments/content/payment_manifest_parser_host.cc b/components/payments/content/payment_manifest_parser_host.cc
index 97cead1597e0667d6cc10d319c75fd9300689d56..0af9a38c23b3b6edcec3713ecef62b66e7de6e9f 100644
--- a/components/payments/content/payment_manifest_parser_host.cc
+++ b/components/payments/content/payment_manifest_parser_host.cc
@@ -82,9 +82,6 @@ void PaymentManifestParserHost::OnPaymentMethodParse(
return;
}
- PaymentMethodCallback callback = std::move(pending_callback_it->second);
- pending_payment_method_callbacks_.erase(pending_callback_it);
-
const size_t kMaximumNumberOfWebAppUrls = 100U;
if (web_app_manifest_urls.size() > kMaximumNumberOfWebAppUrls) {
// If more than 100 items, then something went wrong in the utility
@@ -102,6 +99,9 @@ void PaymentManifestParserHost::OnPaymentMethodParse(
}
}
+ PaymentMethodCallback callback = std::move(pending_callback_it->second);
+ pending_payment_method_callbacks_.erase(pending_callback_it);
+
// Can trigger synchronous deletion of this object, so can't access any of
// the member variables after this block.
std::move(callback).Run(web_app_manifest_urls);
« no previous file with comments | « components/payments/content/android/payment_manifest_parser_android.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698