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

Unified Diff: chrome/browser/android/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: Review comments addressed. 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
Index: chrome/browser/android/dev_tools_server.cc
diff --git a/chrome/browser/android/dev_tools_server.cc b/chrome/browser/android/dev_tools_server.cc
index acdb6b589d5bd7225c51eeb82d05122367aeb6f8..9ae409da3b9d1f7e741a6bc8338c4b93526a575e 100644
--- a/chrome/browser/android/dev_tools_server.cc
+++ b/chrome/browser/android/dev_tools_server.cc
@@ -346,16 +346,14 @@ class DevToolsServerDelegate : public content::DevToolsHttpHandlerDelegate {
}
// Add targets for WebContents not associated with any tabs.
- 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)
- continue;
- if (tab_web_contents.find(web_contents) != tab_web_contents.end())
+ std::vector<WebContents*> wc_list =
+ DevToolsAgentHost::GetInspectableWebContents();
+ for (std::vector<WebContents*>::iterator it = wc_list.begin();
+ it != wc_list.end();
+ ++it) {
+ if (tab_web_contents.find(*it) != tab_web_contents.end())
continue;
- targets.push_back(new NonTabTarget(web_contents));
+ targets.push_back(new NonTabTarget(*it));
}
callback.Run(targets);

Powered by Google App Engine
This is Rietveld 408576698