Use WeakPtr instead of Unretained in the image Annotator service.
Improper use of Unretained in asynchronous callbacks can lead to crashes or even UAF. In this particular case, it appears that we're using Annotator as a singleton, so Unretained might be okay - but just to be safe, and to prevent future issues, using a WeakPtr is super easy and provides some extra safety. Bug: none Change-Id: If01b73c142c8df3641b8112f62fe1e560f5d7d5d Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2161768Reviewed-by:Andrew Moylan <amoylan@chromium.org> Commit-Queue: Dominic Mazzoni <dmazzoni@chromium.org> Cr-Commit-Position: refs/heads/master@{#761951}
Showing
Please register or sign in to comment