• Xiaoqian Dai's avatar
    Add CHECKs to help investigate crbug.com/937381. · a6dcbb82
    Xiaoqian Dai authored
    From the crash stack, |Widget::widget_delegate_| has been deleted but
    not set to nullptr, thus caused the nullptr dereference crash. However,
    we did not find the equivalent number of crashes in
    WidgetDelegate::~WidgetDelegate().
    
    This CL does:
    
    1) Change DCHECK to CHECK in Widget::~Widget() when NATIVE_WIDGET_OWNS_WIDGET
    to see if we can get another crash stack to help investigate the bug.
    If crashes happen here, means Widget is destroyed while its native widget is
    still alive, thus Widget::OnNativeWidgetDestroyed() is not called, thus
    |widget_delegate_| is not set to nullptr.
    
    2) Besides that, it may be also possible that a window is destroyed while
    building up the mru window. We added a scoped window observer to observe
    window in IsWindowConsideredActivatable() and see if there is any window is
    destroyed out from the function.
    
    Bug: 937381
    Change-Id: I01172cc36fcb19078a5d416d7c87fb505f6304d7
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1615384
    Commit-Queue: Xiaoqian Dai <xdai@chromium.org>
    Reviewed-by: default avatarScott Violet <sky@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#661386}
    a6dcbb82
widget.cc 52.3 KB