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

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

Issue 2300703005: DevTools: merge devtools_http_handler into content - it is used in all the embedders anyways. (Closed)
Patch Set: for_landing! Created 4 years, 3 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_agent_host_impl.cc
diff --git a/content/browser/devtools/devtools_agent_host_impl.cc b/content/browser/devtools/devtools_agent_host_impl.cc
index 95dd03a3aeba68fa194a6588911af09f6d18b441..59e858b7a43405edadba2438b11ccbea163fcf14 100644
--- a/content/browser/devtools/devtools_agent_host_impl.cc
+++ b/content/browser/devtools/devtools_agent_host_impl.cc
@@ -44,12 +44,6 @@ char DevToolsAgentHost::kTypeBrowser[] = "browser";
char DevToolsAgentHost::kTypeOther[] = "other";
// static
-DevToolsManagerDelegate* DevToolsAgentHost::GetDevToolsManagerDelegate() {
- DevToolsManager* manager = DevToolsManager::GetInstance();
- return manager->delegate();
-}
-
-// static
std::string DevToolsAgentHost::GetProtocolVersion() {
return std::string(devtools::kProtocolVersion);
}
@@ -114,9 +108,9 @@ scoped_refptr<DevToolsAgentHost> DevToolsAgentHost::GetForWorker(
DevToolsAgentHostImpl::DevToolsAgentHostImpl(const std::string& id)
: id_(id),
session_id_(0),
- description_(""),
client_(NULL) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
+ DCHECK(g_instances.Get().find(id_) == g_instances.Get().end());
g_instances.Get()[id_] = this;
}
@@ -137,9 +131,13 @@ scoped_refptr<DevToolsAgentHost> DevToolsAgentHost::GetForId(
}
// static
-scoped_refptr<DevToolsAgentHost> DevToolsAgentHost::Create(
- DevToolsExternalAgentProxyDelegate* delegate) {
- return new ForwardingAgentHost(delegate);
+scoped_refptr<DevToolsAgentHost> DevToolsAgentHost::Forward(
+ const std::string& id,
+ std::unique_ptr<DevToolsExternalAgentProxyDelegate> delegate) {
+ scoped_refptr<DevToolsAgentHost> result = DevToolsAgentHost::GetForId(id);
+ if (result)
+ return result;
+ return new ForwardingAgentHost(id, std::move(delegate));
}
bool DevToolsAgentHostImpl::InnerAttach(DevToolsAgentHostClient* client,
@@ -211,12 +209,7 @@ std::string DevToolsAgentHostImpl::GetParentId() {
}
std::string DevToolsAgentHostImpl::GetDescription() {
- return description_;
-}
-
-void DevToolsAgentHostImpl::SetDescriptionOverride(
- const std::string& description) {
- description_ = description;
+ return "";
}
GURL DevToolsAgentHostImpl::GetFaviconURL() {
« no previous file with comments | « content/browser/devtools/devtools_agent_host_impl.h ('k') | content/browser/devtools/devtools_http_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698