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

Side by Side Diff: content/shell/browser/shell_devtools_frontend.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 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 unified diff | Download patch
« no previous file with comments | « content/renderer/render_view_impl.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/shell/browser/shell_devtools_frontend.h" 5 #include "content/shell/browser/shell_devtools_frontend.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/json/json_reader.h" 8 #include "base/json/json_reader.h"
9 #include "base/json/json_writer.h" 9 #include "base/json/json_writer.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 frontend_shell_(frontend_shell), 70 frontend_shell_(frontend_shell),
71 agent_host_(agent_host) { 71 agent_host_(agent_host) {
72 } 72 }
73 73
74 ShellDevToolsFrontend::~ShellDevToolsFrontend() { 74 ShellDevToolsFrontend::~ShellDevToolsFrontend() {
75 } 75 }
76 76
77 void ShellDevToolsFrontend::RenderViewCreated( 77 void ShellDevToolsFrontend::RenderViewCreated(
78 RenderViewHost* render_view_host) { 78 RenderViewHost* render_view_host) {
79 if (!frontend_host_) { 79 if (!frontend_host_) {
80 frontend_host_.reset(DevToolsFrontendHost::Create(render_view_host, this)); 80 frontend_host_.reset(DevToolsFrontendHost::Create(web_contents(), this));
81 agent_host_->AttachClient(this); 81 agent_host_->AttachClient(this);
82 } 82 }
83 } 83 }
84 84
85 void ShellDevToolsFrontend::WebContentsDestroyed() { 85 void ShellDevToolsFrontend::WebContentsDestroyed() {
86 agent_host_->DetachClient(); 86 agent_host_->DetachClient();
87 delete this; 87 delete this;
88 } 88 }
89 89
90 void ShellDevToolsFrontend::HandleMessageFromDevToolsFrontend( 90 void ShellDevToolsFrontend::HandleMessageFromDevToolsFrontend(
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 base::string16 javascript = base::UTF8ToUTF16(code); 135 base::string16 javascript = base::UTF8ToUTF16(code);
136 web_contents()->GetMainFrame()->ExecuteJavaScript(javascript); 136 web_contents()->GetMainFrame()->ExecuteJavaScript(javascript);
137 } 137 }
138 138
139 void ShellDevToolsFrontend::AgentHostClosed( 139 void ShellDevToolsFrontend::AgentHostClosed(
140 DevToolsAgentHost* agent_host, bool replaced) { 140 DevToolsAgentHost* agent_host, bool replaced) {
141 frontend_shell_->Close(); 141 frontend_shell_->Close();
142 } 142 }
143 143
144 } // namespace content 144 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/render_view_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698