• carlosk's avatar
    This CL is basically a 3 fixes in 1. I started off fixing the fact that · 1ae0930d
    carlosk authored
    WebUIs were not properly being created when reusing the current
    RenderFrameHost. But while doing that I found an issue in
    RenderFrameHostManager::CreateSpeculativeRenderFrameHost where instead
    of setting an instance member I was mistakenly shadowing it with a
    same-named function member.
    
    This last fix caused another test to crash because the WebUI reuse logic
    was incorrect. Instead of checking if it should be reused when the
    navigation SiteInstance matched the current one, it was being done when
    they were different (what doesn't even makes sense).
    
    Due to these changes I also had to update how RFHM::CleanUpNavigation
    and UnsetSpeculativeRenderFrameHost work,so that the speculative WebUI
    member is always cleaned up even if a speculative RFH does not exist.
    
    Also renamed the speculative WebUI getter as it's not test-only anymore.
    
    With these changes these tests were fixed when PlzNavigate is enabled:
        RenderFrameHostManagerTest.EnableWebUIWithSwappedOutOpener
        RenderFrameHostManagerTest.WebUIInNewTab
    
    BUG=439423
    
    Review URL: https://codereview.chromium.org/877343010
    
    Cr-Commit-Position: refs/heads/master@{#315006}
    1ae0930d
render_frame_host_manager.h 32 KB