[Autofill Auth] Fix for the delayed task
Previously the post delayed task will cause crashes on Linux and Mac. Every time we post a delayed task, then we refresh/close the tap, it will crash when the delayed task executed. It might because the WaitableEvent can only be used within single address space for Non-Windows systems[1]. And when we refresh/close the tap, the credit_card_access_manager is reset when DidNavigateMainFrame [2]. In order to fix it, we replace the callback with CreditCardAccessManager::SignalCanFetchUnmaskDetails function together with weak_ptr of credit_card_access_manager. With the weak pointer, the BindOnce callback won't be executed when credit_card_access_manager is reset. [1] https://cs.chromium.org/chromium/src/base/synchronization/waitable_event.h?l=39-41&rcl=0b35f9e032c5ac21ef25df8d5cf113529ce2f4c3 [2] https://cs.chromium.org/chromium/src/components/autofill/core/browser/autofill_manager.cc?l=1450-1451&rcl=fd806bd17d805398213f349649276356c5616c6e Bug: 949269 Change-Id: I8e7acdb411e4421b55a685ff470b82fd954149d3 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1922913 Commit-Queue: Sujie Zhu <sujiezhu@google.com> Reviewed-by:Jared Saul <jsaul@google.com> Reviewed-by:
Gabriel Charette <gab@chromium.org> Cr-Commit-Position: refs/heads/master@{#716880}
Showing
Please register or sign in to comment