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

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

Issue 13305002: Remove redundant DevToolsManager methods and clean up its clients. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments Created 7 years, 9 months 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_http_handler_impl.cc
diff --git a/content/browser/devtools/devtools_http_handler_impl.cc b/content/browser/devtools/devtools_http_handler_impl.cc
index cc436820d074254aa63b14b134f4a14af3e5e749..414785e62a02b00caf9742ba09740b53b54f80cb 100644
--- a/content/browser/devtools/devtools_http_handler_impl.cc
+++ b/content/browser/devtools/devtools_http_handler_impl.cc
@@ -604,8 +604,7 @@ void DevToolsHttpHandlerImpl::OnWebSocketRequestUI(
return;
}
- DevToolsManager* manager = DevToolsManager::GetInstance();
- if (manager->GetDevToolsClientHostFor(agent)) {
+ if (agent->IsAttached()) {
Send500(connection_id,
"Target with given id is being inspected: " + page_id);
return;
@@ -617,7 +616,8 @@ void DevToolsHttpHandlerImpl::OnWebSocketRequestUI(
connection_id);
connection_to_client_host_ui_[connection_id] = client_host;
- manager->RegisterDevToolsClientHostFor(agent, client_host);
+ DevToolsManager::GetInstance()->
+ RegisterDevToolsClientHostFor(agent, client_host);
AcceptWebSocket(connection_id, request);
}
@@ -814,7 +814,7 @@ base::DictionaryValue* DevToolsHttpHandlerImpl::SerializePageInfo(
dictionary->SetString(kTargetDescriptionField,
delegate_->GetViewDescription(rvh));
- if (!DevToolsManager::GetInstance()->GetDevToolsClientHostFor(agent))
+ if (!agent->IsAttached())
SerializeDebuggerURLs(dictionary, id, host);
return dictionary;
}
@@ -837,7 +837,7 @@ base::DictionaryValue* DevToolsHttpHandlerImpl::SerializeWorkerInfo(
dictionary->SetString(kTargetDescriptionField,
base::StringPrintf("Worker pid:%d", base::GetProcId(worker.handle)));
- if (!DevToolsManager::GetInstance()->GetDevToolsClientHostFor(agent))
+ if (!agent->IsAttached())
SerializeDebuggerURLs(dictionary, id, host);
return dictionary;
}
« no previous file with comments | « content/browser/devtools/devtools_external_agent_proxy_impl.cc ('k') | content/browser/devtools/devtools_manager_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698