Make WebContentsImpl aware of all of its RWHs.
It used to be that WebContentsImpl only knew about the RWHs created through WebContentsImpl::CreateNewWidget() and stored them in WCI::created_widgets_. However, widgets created through FrameTree::CreateRenderViewHost() used to be left out. This made RenderWidgetHostImpl::WasResized() to incorrectly send ViewMsg_Resize while the WebContents was being torn down. WasResized() has a check for !delegate_ but |delegate_| never became nullptr during WebContentsImpl shutdown. Adding all widgets to WCI::created_widgets_ will ensure that we notify RWHs about the delegate's (WC) destruction via DetachDelegate and do not send ViewMsg_Resize while a the delegate (WC) is shutting down. BUG=523644, 523451 Test=See https://code.google.com/p/chromium/issues/detail?id=523644#c16 for repro steps. Ensure the renderer does not crash. Review URL: https://codereview.chromium.org/1457203002 Cr-Commit-Position: refs/heads/master@{#361169}
Showing
Please register or sign in to comment