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

Unified Diff: android_webview/native/aw_dev_tools_server.cc

Issue 442303002: DevTools: migrate DevTools APIs to use WebContents instead of RenderViewHost. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: for landing Created 6 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 | apps/app_window_registry.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: android_webview/native/aw_dev_tools_server.cc
diff --git a/android_webview/native/aw_dev_tools_server.cc b/android_webview/native/aw_dev_tools_server.cc
index 1aef54117aa4200458dd389dcd2e9daebbc70640..90b72d18a441113b584515e13742b6c541463475 100644
--- a/android_webview/native/aw_dev_tools_server.cc
+++ b/android_webview/native/aw_dev_tools_server.cc
@@ -69,7 +69,7 @@ class Target : public content::DevToolsTarget {
Target::Target(WebContents* web_contents) {
agent_host_ =
- DevToolsAgentHost::GetOrCreateFor(web_contents->GetRenderViewHost());
+ DevToolsAgentHost::GetOrCreateFor(web_contents);
id_ = agent_host_->GetId();
description_ = GetViewDescription(web_contents);
title_ = base::UTF16ToUTF8(web_contents->GetTitle());
@@ -106,13 +106,11 @@ class AwDevToolsServerDelegate : public content::DevToolsHttpHandlerDelegate {
virtual void EnumerateTargets(TargetCallback callback) OVERRIDE {
TargetList targets;
- std::vector<RenderViewHost*> rvh_list =
- DevToolsAgentHost::GetValidRenderViewHosts();
- for (std::vector<RenderViewHost*>::iterator it = rvh_list.begin();
- it != rvh_list.end(); ++it) {
- WebContents* web_contents = WebContents::FromRenderViewHost(*it);
- if (web_contents)
- targets.push_back(new Target(web_contents));
+ std::vector<WebContents*> wc_list =
+ DevToolsAgentHost::GetInspectableWebContents();
+ for (std::vector<WebContents*>::iterator it = wc_list.begin();
+ it != wc_list.end(); ++it) {
+ targets.push_back(new Target(*it));
}
callback.Run(targets);
}
« no previous file with comments | « no previous file | apps/app_window_registry.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698