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

Unified Diff: chrome/browser/devtools/devtools_ui_bindings.cc

Issue 2515903002: DevTools: webui receives document load message upon navigation, even for cross-domain navigations. … (Closed)
Patch Set: Created 4 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/scripts/chrome_debug_launcher/launch_chrome.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/devtools/devtools_ui_bindings.cc
diff --git a/chrome/browser/devtools/devtools_ui_bindings.cc b/chrome/browser/devtools/devtools_ui_bindings.cc
index 4ee015a5f0699bc0c72255e99a0e5f3d716d282a..718fce46eb02a9df0945a07b28be400a247d4f27 100644
--- a/chrome/browser/devtools/devtools_ui_bindings.cc
+++ b/chrome/browser/devtools/devtools_ui_bindings.cc
@@ -450,6 +450,8 @@ DevToolsUIBindings::~DevToolsUIBindings() {
// content::DevToolsFrontendHost::Delegate implementation ---------------------
void DevToolsUIBindings::HandleMessageFromDevToolsFrontend(
const std::string& message) {
+ if (!web_contents_->GetURL().SchemeIs(content::kChromeDevToolsScheme))
+ return;
std::string method;
base::ListValue empty_params;
base::ListValue* params = &empty_params;
@@ -478,6 +480,8 @@ void DevToolsUIBindings::HandleMessageFromDevToolsFrontend(
void DevToolsUIBindings::DispatchProtocolMessage(
content::DevToolsAgentHost* agent_host, const std::string& message) {
DCHECK(agent_host == agent_host_.get());
+ if (!web_contents_->GetURL().SchemeIs(content::kChromeDevToolsScheme))
+ return;
if (message.length() < kMaxMessageChunkSize) {
std::string param;
@@ -1135,6 +1139,8 @@ void DevToolsUIBindings::CallClientFunction(const std::string& function_name,
const base::Value* arg1,
const base::Value* arg2,
const base::Value* arg3) {
+ if (!web_contents_->GetURL().SchemeIs(content::kChromeDevToolsScheme))
+ return;
std::string javascript = function_name + "(";
if (arg1) {
std::string json;
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/scripts/chrome_debug_launcher/launch_chrome.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698