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

Unified Diff: android_webview/browser/aw_dev_tools_discovery_provider.cc

Issue 2277473007: Revert of DevTools: merge devtools target with devtools host, part 1 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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
« no previous file with comments | « no previous file | chrome/browser/android/dev_tools_discovery_provider_android.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: android_webview/browser/aw_dev_tools_discovery_provider.cc
diff --git a/android_webview/browser/aw_dev_tools_discovery_provider.cc b/android_webview/browser/aw_dev_tools_discovery_provider.cc
index 82b746c7633bfb3c3f117891feb5c89d9de766a3..96cab3f708f4ec4ff91f9fbbbaaa709768264032 100644
--- a/android_webview/browser/aw_dev_tools_discovery_provider.cc
+++ b/android_webview/browser/aw_dev_tools_discovery_provider.cc
@@ -40,6 +40,25 @@
return json;
}
+class TargetDescriptor : public devtools_discovery::BasicTargetDescriptor {
+ public:
+ explicit TargetDescriptor(scoped_refptr<DevToolsAgentHost> agent_host);
+
+ // devtools_discovery::BasicTargetDescriptor overrides.
+ std::string GetDescription() const override { return description_; }
+
+ private:
+ std::string description_;
+
+ DISALLOW_COPY_AND_ASSIGN(TargetDescriptor);
+};
+
+TargetDescriptor::TargetDescriptor(scoped_refptr<DevToolsAgentHost> agent_host)
+ : BasicTargetDescriptor(agent_host) {
+ if (WebContents* web_contents = agent_host->GetWebContents())
+ description_ = GetViewDescription(web_contents);
+}
+
} // namespace
namespace android_webview {
@@ -63,11 +82,8 @@
DevToolsAgentHost::List agent_hosts = DevToolsAgentHost::GetOrCreateAll();
devtools_discovery::DevToolsTargetDescriptor::List result;
result.reserve(agent_hosts.size());
- for (auto& agent_host : agent_hosts) {
- agent_host->SetDescriptionOverride(
- GetViewDescription(agent_host->GetWebContents()));
- result.push_back(new devtools_discovery::BasicTargetDescriptor(agent_host));
- }
+ for (const auto& agent_host : agent_hosts)
+ result.push_back(new TargetDescriptor(agent_host));
return result;
}
« no previous file with comments | « no previous file | chrome/browser/android/dev_tools_discovery_provider_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698