void WebContents::RenderFrameHostChanged(content::RenderFrameHost* old_host,
                                         content::RenderFrameHost* new_host) {
  // During cross-origin navigation, a FrameTreeNode will swap out its RFH.
  // If an instance of WebFrameMain exists, it will need to have its RFH
  // swapped as well.
  //
  // |old_host| can be a nullptr so we use |new_host| for looking up the
  // WebFrameMain instance.
  auto* web_frame =
      WebFrameMain::FromFrameTreeNodeId(new_host->GetFrameTreeNodeId());
  if (web_frame) {
    web_frame->UpdateRenderFrameHost(new_host);
  }
}
void WebContents::RenderFrameHostChanged(content::RenderFrameHost* old_host,
                                         content::RenderFrameHost* new_host) {
   
   
   
   
   
   
  auto* web_frame =
      WebFrameMain::FromFrameTreeNodeId(new_host->GetFrameTreeNodeId());
  if (web_frame) {
    web_frame->UpdateRenderFrameHost(new_host);
  }
}