fido: fix lifetime issue with MaybeAddPlatformAuthenticatorCallback
Currently, |AuthenticatorImpl| is binding |CreatePlatformAuthenticatorIfAvailable| with |base::Unretained| for the |MaybeAddPlatformAuthenticatorCallback| argument to the |FidoRequestHandlerBase| ctor. The callback was originally invoked synchronously from the ctor, but then recently changed to async invocation to account for observer registration (crrev.com/c/1175418). This is a potential callback lifetime issue because the AuthenticatorImpl and its request handler can now theoretically get destroyed before the callback gets invoked. To work around this issue, replace the callback with a method on the request handler invoked by the AuthenticatorImpl. Bug: 875338 Change-Id: I089f0783a46791ae8d9d6bac5f0e663e52075b86 Reviewed-on: https://chromium-review.googlesource.com/1179081 Commit-Queue: Martin Kreichgauer <martinkr@google.com> Reviewed-by:Balazs Engedy <engedy@chromium.org> Reviewed-by:
Jun Choi <hongjunchoi@chromium.org> Cr-Commit-Position: refs/heads/master@{#584288}
Showing
Please register or sign in to comment