• Keren Zhu's avatar
    ui_devtools: Sends node remove request to frontend only it exists in DOM · fd5b3024
    Keren Zhu authored
    DOMAgent’s OnUIElementRemoved() DCHECKs if the UIElement to be removed
    exists. Yet, elements of a bubble are currently being removed twice,
    breaking this DCHECK.
    
    The first removal is in WidgetElement::OnWidgetDestroyed(). The second
    is in WidgetDelegate::DeleteDelegate(), where eventually
    ViewElement::OnChildViewRemoved() is called. Because the whole DOM tree
    is removed in the first call, the DCHECK fails in the second call.
    
    This change removes the above DCHECK and sends the removal request only
    when the node exists in the DOM.
    
    
    Bug: 1167240
    Change-Id: Ia6fc327a8fc5004dce7333f232b323f7b677fbfe
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2639134
    Commit-Queue: Keren Zhu <kerenzhu@chromium.org>
    Reviewed-by: default avatarWei Li <weili@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#845799}
    fd5b3024
dom_agent.cc 13.6 KB