 Chromium Code Reviews
 Chromium Code Reviews Issue 744653002:
  Ignore DevTools messages from the old inspected RVH after navigation  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/src.git@master
    
  
    Issue 744653002:
  Ignore DevTools messages from the old inspected RVH after navigation  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/src.git@master| Index: content/browser/devtools/devtools_frontend_host_impl.cc | 
| diff --git a/content/browser/devtools/devtools_frontend_host_impl.cc b/content/browser/devtools/devtools_frontend_host_impl.cc | 
| index a73e88cb50ad525de728a8d2228d75afb2d3b773..f14853441c28cc98e6ce52f055dc7792fc6d9d58 100644 | 
| --- a/content/browser/devtools/devtools_frontend_host_impl.cc | 
| +++ b/content/browser/devtools/devtools_frontend_host_impl.cc | 
| @@ -6,6 +6,7 @@ | 
| #include "content/common/devtools_messages.h" | 
| #include "content/public/browser/navigation_entry.h" | 
| +#include "content/public/browser/render_frame_host.h" | 
| #include "content/public/browser/render_view_host.h" | 
| 
dgozman
2014/11/24 13:32:13
nit: this is not used anymore.
 
yurys
2014/11/24 14:08:54
Done.
 | 
| #include "content/public/browser/web_contents.h" | 
| @@ -13,25 +14,26 @@ namespace content { | 
| // static | 
| DevToolsFrontendHost* DevToolsFrontendHost::Create( | 
| - RenderViewHost* frontend_rvh, | 
| + WebContents* frontend_web_contents, | 
| DevToolsFrontendHost::Delegate* delegate) { | 
| - return new DevToolsFrontendHostImpl(frontend_rvh, delegate); | 
| + return new DevToolsFrontendHostImpl(frontend_web_contents, delegate); | 
| } | 
| DevToolsFrontendHostImpl::DevToolsFrontendHostImpl( | 
| - RenderViewHost* frontend_rvh, | 
| + WebContents* frontend_web_contents, | 
| DevToolsFrontendHost::Delegate* delegate) | 
| - : WebContentsObserver(WebContents::FromRenderViewHost(frontend_rvh)), | 
| - delegate_(delegate) { | 
| - frontend_rvh->Send(new DevToolsMsg_SetupDevToolsClient( | 
| - frontend_rvh->GetRoutingID())); | 
| + : WebContentsObserver(frontend_web_contents), delegate_(delegate) { | 
| + RenderFrameHost* main_frame_host = web_contents()->GetMainFrame(); | 
| + main_frame_host->Send( | 
| + new DevToolsMsg_SetupDevToolsClient(main_frame_host->GetRoutingID())); | 
| } | 
| DevToolsFrontendHostImpl::~DevToolsFrontendHostImpl() { | 
| } | 
| bool DevToolsFrontendHostImpl::OnMessageReceived( | 
| - const IPC::Message& message) { | 
| + const IPC::Message& message, | 
| + RenderFrameHost* render_frame_host) { | 
| bool handled = true; | 
| IPC_BEGIN_MESSAGE_MAP(DevToolsFrontendHostImpl, message) | 
| IPC_MESSAGE_HANDLER(DevToolsAgentMsg_DispatchOnInspectorBackend, |