• James Cook's avatar
    Speculative fix for crash in ash::Shelf::SetAlignment() · 4a018235
    James Cook authored
    When disconnecting an external monitor the display manager shuts down
    the associated RootWindowController, but defers deletion of the
    RootWindowController via a posted task. This means an ash::Shelf
    can exist without a ShelfWidget.
    
    A similar code path exists for entering tablet mode, which turns on
    display mirroring, and shuts down the RootWindowController for the
    external display.
    
    If there's a pending task that changes session state (for example,
    the user's sign-in completes), then SessionController observers can
    fire and attempt to update the alignment of the shelf.
    
    Add null checks to ash::Shelf for shelf_widget_. I think we used to
    have these many years ago, and I think I removed them in 2016 when
    when cleaning up ash::Shelf. Sadly, they are still needed.
    
    Bug: 937495, 738011
    Test: ash_unittests
    Change-Id: I794c610ba1f56483dae49f49e6d955ccf15ce10d
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1542572Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
    Commit-Queue: James Cook <jamescook@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#645321}
    4a018235
shelf_locking_manager.h 1.53 KB