• danakj@chromium.org's avatar
    aura: Ensure OwnedMailbox not used with invalid or destroyed GLHelper. · 387e526a
    danakj@chromium.org authored
    There are 2 scenarios when the GLHelper becomes invalid:
    
    1. On lost context. In this case, the OwnedMailbox is reset and the
    pointer is destroyed. However, the copy request result code would
    continue trying to use the OwnedMailbox regardless. Instead we can
    use this as a hint that the mailbox is no longer valid and abort the
    readback.
    
    2. On shutdown. Once the RenderWidgetHostViewAura is shutdown, there
    is no way to easily tell if the GLHelper attached to the OwnedMailbox
    being stored in copy request callbacks is still alive. Since a readback
    on the RenderWidgetHostViewAura can not complete once the RWHVA class
    is destroyed anyways, we can destroy the contents of the OwnedMailboxes
    in flight at that time. This way when the readback is later aborted,
    the OwnedMailbox does not try to clean itself up with a potentially
    destroyed GLHelper.
    
    R=piman@chromium.org
    BUG=270918
    
    Review URL: https://codereview.chromium.org/120913004
    
    git-svn-id: svn://svn.chromium.org/chrome/trunk/src@243971 0039d316-1c4b-4281-b951-d872f2087c98
    387e526a
owned_mailbox.h 1.23 KB