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

Unified Diff: chrome/browser/extensions/api/processes/processes_api.cc

Issue 16431010: Refactor RenderProcessHost to use IPC::Listener instead of RenderWidgetHost (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase on top of hash_pair move. Created 7 years, 6 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 | « chrome/browser/chromeos/system/timezone_settings.cc ('k') | chrome/browser/memory_details.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/processes/processes_api.cc
diff --git a/chrome/browser/extensions/api/processes/processes_api.cc b/chrome/browser/extensions/api/processes/processes_api.cc
index adcd39d35906070441286cecf4ca5d82dfd705dc..2aa22041a1052fa2621fbcca75c38a48fd4139a1 100644
--- a/chrome/browser/extensions/api/processes/processes_api.cc
+++ b/chrome/browser/extensions/api/processes/processes_api.cc
@@ -112,16 +112,15 @@ ListValue* GetTabsForProcess(int process_id) {
int tab_id = -1;
// We need to loop through all the RVHs to ensure we collect the set of all
// tabs using this renderer process.
- content::RenderProcessHost::RenderWidgetHostsIterator iter(
- rph->GetRenderWidgetHostsIterator());
- for (; !iter.IsAtEnd(); iter.Advance()) {
- const content::RenderWidgetHost* widget = iter.GetCurrentValue();
- DCHECK(widget);
- if (!widget || !widget->IsRenderView())
+ content::RenderWidgetHost::List widgets =
+ content::RenderWidgetHost::GetRenderWidgetHosts();
+ for (size_t i = 0; i < widgets.size(); ++i) {
+ if (widgets[i]->GetProcess()->GetID() != process_id)
+ continue;
+ if (!widgets[i]->IsRenderView())
continue;
- content::RenderViewHost* host = content::RenderViewHost::From(
- const_cast<content::RenderWidgetHost*>(widget));
+ content::RenderViewHost* host = content::RenderViewHost::From(widgets[i]);
content::WebContents* contents =
content::WebContents::FromRenderViewHost(host);
if (contents) {
« no previous file with comments | « chrome/browser/chromeos/system/timezone_settings.cc ('k') | chrome/browser/memory_details.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698