Commit 0f290a02 authored by Maksim Ivanov's avatar Maksim Ivanov Committed by Commit Bot

Fix use-after-move in //components/payments/content/

Fix use-after-move (potential) bugs found by the
"bugprone-use-after-move" clang-tidy check.

Bug: 1122844
Change-Id: I8efb8969075297d3ac604ad90f80c26f49fee8c4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2431967
Commit-Queue: Rouslan Solomakhin <rouslan@chromium.org>
Reviewed-by: default avatarRouslan Solomakhin <rouslan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#810931}
parent 98a502c4
...@@ -58,13 +58,14 @@ void PaymentCredential::StorePaymentCredential( ...@@ -58,13 +58,14 @@ void PaymentCredential::StorePaymentCredential(
return; return;
} }
const GURL icon_url = instrument->icon;
int request_id = web_contents()->DownloadImageInFrame( int request_id = web_contents()->DownloadImageInFrame(
initiator_frame_routing_id_, initiator_frame_routing_id_,
instrument->icon, // source URL icon_url, // source URL
true, // is_favicon true, // is_favicon
0, // no preferred size 0, // no preferred size
0, // no max size 0, // no max size
false, // normal cache policy (a.k.a. do not bypass cache) false, // normal cache policy (a.k.a. do not bypass cache)
base::BindOnce(&PaymentCredential::DidDownloadFavicon, base::BindOnce(&PaymentCredential::DidDownloadFavicon,
weak_ptr_factory_.GetWeakPtr(), std::move(instrument), weak_ptr_factory_.GetWeakPtr(), std::move(instrument),
credential_id, rp_id, std::move(callback))); credential_id, rp_id, std::move(callback)));
......
...@@ -130,8 +130,9 @@ void SecurePaymentConfirmationAppFactory::Create( ...@@ -130,8 +130,9 @@ void SecurePaymentConfirmationAppFactory::Create(
std::unique_ptr<autofill::InternalAuthenticator> authenticator = std::unique_ptr<autofill::InternalAuthenticator> authenticator =
delegate->CreateInternalAuthenticator(); delegate->CreateInternalAuthenticator();
auto* authenticator_ptr = authenticator.get();
authenticator->IsUserVerifyingPlatformAuthenticatorAvailable( authenticator_ptr->IsUserVerifyingPlatformAuthenticatorAvailable(
base::BindOnce(&SecurePaymentConfirmationAppFactory:: base::BindOnce(&SecurePaymentConfirmationAppFactory::
OnIsUserVerifyingPlatformAuthenticatorAvailable, OnIsUserVerifyingPlatformAuthenticatorAvailable,
weak_ptr_factory_.GetWeakPtr(), delegate, weak_ptr_factory_.GetWeakPtr(), delegate,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment