[Autofill Assistant] Fix crash when autostarting scripts.
Starting with https://chromium-review.googlesource.com/c/1319670 starting a script deletes the BatchElementChecker. Before this patch, this caused a crash when autostarting, because - BatchElementChecker calls the try_done callback set by the script_tracker - that callback autostarts a script - autostarting deletes the calling BatchElementChecker The crash happens right after calling try_done, when trying to access this to schedule a delayed task. With this patch, the callback is called after scheduling the delayed task. This way, there's no necessary usage of this after try_done is called. The weak pointer keeps track of dealing with the fact that the delayed task must not run. Bug: 806868 Change-Id: I1b907fcc96aecb66fc0b68fe2ea0f50532542100 Reviewed-on: https://chromium-review.googlesource.com/c/1323072 Commit-Queue: Stephane Zermatten <szermatt@chromium.org> Reviewed-by:Ganggui Tang <gogerald@chromium.org> Cr-Commit-Position: refs/heads/master@{#606054}
Showing
Please register or sign in to comment