• Erik Chen's avatar
    Tentative fix for LoginHandler leak. · 470ff7ff
    Erik Chen authored
    The ownership semantics for LoginHandler are very confusing. The class is
    self-owned, and is only destroyed when LoginHandler::ReleaseSoon() is called.
    But this relies on the assumption that the LoginHandlerView is shown, which isn't
    always the case. This CL adds tracking for whether the LoginHandlerView has been
    shown, and if it has never been shown but CancelAuth() is called, then
    LoginHandler::ReleaseSoon() will also be called.
    
    This relies on the assumption that all codes paths must either show the
    LoginHandlerView or else call CancelAuth().
    
    Ideally, the whole class should be refactored to have saner ownership
    semantics.
    
    Bug: 814334
    Change-Id: I28085ca948a5629f11e6263153938e5c87f42518
    Reviewed-on: https://chromium-review.googlesource.com/957283Reviewed-by: default avatarMustafa Emre Acer <meacer@chromium.org>
    Commit-Queue: Erik Chen <erikchen@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#542305}
    470ff7ff
login_handler.cc 25.2 KB