Commit 1e593a37 authored by Manas Verma's avatar Manas Verma Committed by Commit Bot

[Autofill Auth] Only connecting to authenticator if not bound already.

Adding a check for whether or not the authenticator is bound before attempting
to connect to it. Otherwise this may cause crashes if IsUserVerifiable() is
called multiple times.

Bug: 949269
Change-Id: Ic67218581d8a72b96cbdf1cf24427651d598e13a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1849128Reviewed-by: default avatarJared Saul <jsaul@google.com>
Commit-Queue: Manas Verma <manasverma@google.com>
Cr-Commit-Position: refs/heads/master@{#704380}
parent dad62746
...@@ -127,8 +127,10 @@ void CreditCardFIDOAuthenticator::IsUserVerifiable( ...@@ -127,8 +127,10 @@ void CreditCardFIDOAuthenticator::IsUserVerifiable(
base::OnceCallback<void(bool)> callback) { base::OnceCallback<void(bool)> callback) {
if (base::FeatureList::IsEnabled( if (base::FeatureList::IsEnabled(
features::kAutofillCreditCardAuthentication)) { features::kAutofillCreditCardAuthentication)) {
autofill_driver_->ConnectToAuthenticator( if (!authenticator_.is_bound()) {
authenticator_.BindNewPipeAndPassReceiver()); autofill_driver_->ConnectToAuthenticator(
authenticator_.BindNewPipeAndPassReceiver());
}
authenticator_->IsUserVerifyingPlatformAuthenticatorAvailable( authenticator_->IsUserVerifyingPlatformAuthenticatorAvailable(
std::move(callback)); std::move(callback));
} else { } else {
......
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