• Josh Nohle's avatar
    [Multidevice] Bind SecureMessage delegate callbacks to weak pointers. · 69f3d01c
    Josh Nohle authored
    Previously, callbacks passed into SecureMessage delegate methods were
    being forwarded directly to the EasyUnlock dbus service, which the
    delegate does not own. So, these callbacks can still be invoked after
    the SecureMessage delegate object is destroyed.
    
    In this CL, we bind callbacks sent to the dbus client to weak pointers.
    This ensures that consumers of the SecureMessage delegate will not have
    their callbacks invoked after the delegate is destroyed.
    
    Manually tested CryptAuth Enrollment, DeviceSync, and SmartLock flows.
    
    Fixed: 1163335
    Change-Id: I69b24c675808312d4310f37ac830c7326c971275
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2616944
    Commit-Queue: Josh Nohle <nohle@chromium.org>
    Commit-Queue: Kyle Horimoto <khorimoto@chromium.org>
    Auto-Submit: Josh Nohle <nohle@chromium.org>
    Reviewed-by: default avatarKyle Horimoto <khorimoto@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#841674}
    69f3d01c
secure_message_delegate_impl.h 3.11 KB