• Hitoshi Yoshida's avatar
    WebTest: Remove RenderViewHost for main window · c6edb33a
    Hitoshi Yoshida authored
    A flag to check if a new RenderFrameHost is really new in
    WebTestControlHost::HandleNewRenderFrameHost(),
    we check if its RenderViewHost is already contained in
    |main_window_render_view_hosts_|.
    
    This detection is based on our past design that we don't
    delete RenderViewHosts in a web test, and we don't erase
    entries of |main_window_render_view_hosts_|.
    But it can happen if we start to swap RenderFrameHosts and
    RenderViewHosts with Browsing Instance Swap and/or
    Back-Forward Cache.
    
    After deleting an old RenderViewHost, a new RenderViewHost
    can be created on the address where the old one was allocated.
    This address conflict can lead a misjudge of the check of
    new RenderFrameHosts.
    
    This CL handles delete events of RenderViewHosts for main
    windows on WebTestControlHost, and removes their addresses
    from the list.
    
    
    Bug: 1136383, 1132180
    Change-Id: I442ad67d2207a822dec37fb676d623dd035f0b9d
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2462997
    Commit-Queue: Hitoshi Yoshida <peria@chromium.org>
    Reviewed-by: default avatarRakina Zata Amni <rakina@chromium.org>
    Reviewed-by: default avatardanakj <danakj@chromium.org>
    Reviewed-by: default avatarFergal Daly <fergal@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#816630}
    c6edb33a
web_test_control_host.h 15.4 KB