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

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: Use WebContents instead of RVH when creating DTFH 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..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,

Powered by Google App Engine
This is Rietveld 408576698