Index: components/devtools_http_handler/devtools_http_handler.cc |
diff --git a/components/devtools_http_handler/devtools_http_handler.cc b/components/devtools_http_handler/devtools_http_handler.cc |
index 824ab467161e07e0c66f476d5381a299e00a2699..17b9e990bedf1a3d649ba376d2d8e512149a4933 100644 |
--- a/components/devtools_http_handler/devtools_http_handler.cc |
+++ b/components/devtools_http_handler/devtools_http_handler.cc |
@@ -324,8 +324,7 @@ |
static bool TimeComparator(const DevToolsTargetDescriptor* desc1, |
const DevToolsTargetDescriptor* desc2) { |
- return desc1->GetAgentHost()->GetLastActivityTime() > |
- desc2->GetAgentHost()->GetLastActivityTime(); |
+ return desc1->GetLastActivityTime() > desc2->GetLastActivityTime(); |
} |
// DevToolsHttpHandler::ServerSocketFactory ---------------------------------- |
@@ -586,7 +585,7 @@ |
base::STLDeleteValues(&descriptor_map_); |
base::ListValue list_value; |
for (DevToolsTargetDescriptor* descriptor : descriptors) { |
- descriptor_map_[descriptor->GetAgentHost()->GetId()] = descriptor; |
+ descriptor_map_[descriptor->GetId()] = descriptor; |
list_value.Append(SerializeDescriptor(*descriptor, host)); |
} |
SendJson(connection_id, net::HTTP_OK, &list_value, std::string()); |
@@ -613,7 +612,7 @@ |
std::unique_ptr<base::DictionaryValue> dictionary( |
SerializeDescriptor(*descriptor.get(), host)); |
SendJson(connection_id, net::HTTP_OK, dictionary.get(), std::string()); |
- const std::string target_id = descriptor->GetAgentHost()->GetId(); |
+ const std::string target_id = descriptor->GetId(); |
descriptor_map_[target_id] = descriptor.release(); |
return; |
} |
@@ -629,7 +628,7 @@ |
} |
if (command == "activate") { |
- if (descriptor->GetAgentHost()->Activate()) { |
+ if (descriptor->Activate()) { |
SendJson(connection_id, net::HTTP_OK, NULL, "Target activated"); |
} else { |
SendJson(connection_id, |
@@ -641,7 +640,7 @@ |
} |
if (command == "close") { |
- if (descriptor->GetAgentHost()->Close()) { |
+ if (descriptor->Close()) { |
SendJson(connection_id, net::HTTP_OK, NULL, "Target is closing"); |
} else { |
SendJson(connection_id, |
@@ -672,7 +671,7 @@ |
DevToolsTargetDescriptor* descriptor = GetDescriptor(target_id); |
GURL page_url; |
if (descriptor) |
- page_url = descriptor->GetAgentHost()->GetURL(); |
+ page_url = descriptor->GetURL(); |
std::string data = delegate_->GetPageThumbnailData(page_url); |
if (!data.empty()) |
Send200(connection_id, data, "image/png"); |
@@ -900,22 +899,21 @@ |
const DevToolsTargetDescriptor& descriptor, |
const std::string& host) { |
base::DictionaryValue* dictionary = new base::DictionaryValue; |
- scoped_refptr<content::DevToolsAgentHost> agent_host = |
- descriptor.GetAgentHost(); |
- std::string id = agent_host->GetId(); |
+ |
+ std::string id = descriptor.GetId(); |
dictionary->SetString(kTargetIdField, id); |
- std::string parent_id = agent_host->GetParentId(); |
+ std::string parent_id = descriptor.GetParentId(); |
if (!parent_id.empty()) |
dictionary->SetString(kTargetParentIdField, parent_id); |
- dictionary->SetString(kTargetTypeField, agent_host->GetType()); |
+ dictionary->SetString(kTargetTypeField, descriptor.GetType()); |
dictionary->SetString(kTargetTitleField, |
- net::EscapeForHTML(agent_host->GetTitle())); |
- dictionary->SetString(kTargetDescriptionField, agent_host->GetDescription()); |
- |
- GURL url = agent_host->GetURL(); |
+ net::EscapeForHTML(descriptor.GetTitle())); |
+ dictionary->SetString(kTargetDescriptionField, descriptor.GetDescription()); |
+ |
+ GURL url = descriptor.GetURL(); |
dictionary->SetString(kTargetUrlField, url.spec()); |
- GURL favicon_url = agent_host->GetFaviconURL(); |
+ GURL favicon_url = descriptor.GetFaviconURL(); |
if (favicon_url.is_valid()) |
dictionary->SetString(kTargetFaviconUrlField, favicon_url.spec()); |
@@ -924,7 +922,7 @@ |
std::string(kThumbUrlPrefix) + id); |
} |
- if (!agent_host->IsAttached()) { |
+ if (!descriptor.IsAttached()) { |
dictionary->SetString(kTargetWebSocketDebuggerUrlField, |
base::StringPrintf("ws://%s%s%s", |
host.c_str(), |