Use WeakPtr when getting ports in SerialChooserController
As of r626853 SerialChooserController no longer owners its own connection to the SerialPortManager. Since this connection can now outlive the controller instance it is not safe to bind an raw pointer to |this|. This patch adds a WeakPtrFactory so that callbacks arriving after the controller has been destroyed are safely discarded. Bug: 952709 Change-Id: I1994b0aa3e7514bb200c304e70accce4b17e0b9b Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1606588Reviewed-by:Elly Fong-Jones <ellyjones@chromium.org> Commit-Queue: Reilly Grant <reillyg@chromium.org> Cr-Commit-Position: refs/heads/master@{#659725}
Showing
Please register or sign in to comment