Chromium Code Reviews| 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..1fb5ad2c1d20f657045fcf627af2f9798bc9c25e 100644 |
| --- a/content/browser/devtools/devtools_frontend_host_impl.cc |
| +++ b/content/browser/devtools/devtools_frontend_host_impl.cc |
| @@ -6,32 +6,33 @@ |
| #include "content/common/devtools_messages.h" |
| #include "content/public/browser/navigation_entry.h" |
| -#include "content/public/browser/render_view_host.h" |
| +#include "content/public/browser/render_frame_host.h" |
| #include "content/public/browser/web_contents.h" |
| 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) { |
|
Charlie Reis
2014/11/24 17:46:26
Would it make sense to return early from this if r
yurys
2014/11/25 09:47:20
Yes, that makes sense to me. Added an early return
|
| bool handled = true; |
| IPC_BEGIN_MESSAGE_MAP(DevToolsFrontendHostImpl, message) |
| IPC_MESSAGE_HANDLER(DevToolsAgentMsg_DispatchOnInspectorBackend, |