Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(654)

Unified Diff: content/browser/devtools/devtools_frontend_host_impl.cc

Issue 744653002: Ignore DevTools messages from the old inspected RVH after navigation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comment Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..315ebbd68963c0252e2e084d6876afe0e649d9ca 100644
--- a/content/browser/devtools/devtools_frontend_host_impl.cc
+++ b/content/browser/devtools/devtools_frontend_host_impl.cc
@@ -6,32 +6,35 @@
#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) {
+ if (render_frame_host != web_contents()->GetMainFrame())
+ return false;
bool handled = true;
IPC_BEGIN_MESSAGE_MAP(DevToolsFrontendHostImpl, message)
IPC_MESSAGE_HANDLER(DevToolsAgentMsg_DispatchOnInspectorBackend,
« no previous file with comments | « content/browser/devtools/devtools_frontend_host_impl.h ('k') | content/browser/devtools/render_view_devtools_agent_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698