From ea314c3d9b9b75aadde18f3d5e09c2675c73f92f Mon Sep 17 00:00:00 2001 From: "pfeldman@chromium.org" Date: Fri, 8 Aug 2014 10:09:02 +0000 Subject: DevTools: migrate DevTools APIs to use WebContents instead of RenderViewHost. R=dgozman@chromium.org, jam@chromium.org TBR=extensions) for simple RVH -> WebContents migration call sites., kalman (apps, mnaganov (android_webview) NOTRY=true Review URL: https://codereview.chromium.org/442303002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@288297 0039d316-1c4b-4281-b951-d872f2087c98 --- android_webview/native/aw_dev_tools_server.cc | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'android_webview') diff --git a/android_webview/native/aw_dev_tools_server.cc b/android_webview/native/aw_dev_tools_server.cc index 1aef541..90b72d1 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 rvh_list = - DevToolsAgentHost::GetValidRenderViewHosts(); - for (std::vector::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 wc_list = + DevToolsAgentHost::GetInspectableWebContents(); + for (std::vector::iterator it = wc_list.begin(); + it != wc_list.end(); ++it) { + targets.push_back(new Target(*it)); } callback.Run(targets); } -- cgit v1.1