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

Unified Diff: chrome/browser/performance_monitor/performance_monitor.cc

Issue 16431010: Refactor RenderProcessHost to use IPC::Listener instead of RenderWidgetHost (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix cleanup crashes. 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
Index: chrome/browser/performance_monitor/performance_monitor.cc
diff --git a/chrome/browser/performance_monitor/performance_monitor.cc b/chrome/browser/performance_monitor/performance_monitor.cc
index 5f805653d5e5520cb90cc5922890388deb5b20f1..22bd595c13c34aa7fb5eda35b052a59f746463f7 100644
--- a/chrome/browser/performance_monitor/performance_monitor.cc
+++ b/chrome/browser/performance_monitor/performance_monitor.cc
@@ -620,17 +620,21 @@ void PerformanceMonitor::AddRendererClosedEvent(
details.status == base::TERMINATION_STATUS_PROCESS_WAS_KILLED ?
EVENT_RENDERER_KILLED : EVENT_RENDERER_CRASH;
- content::RenderProcessHost::RenderWidgetHostsIterator iter =
- host->GetRenderWidgetHostsIterator();
-
// A RenderProcessHost may contain multiple render views - for each valid
// render view, extract the url, and append it to the string, comma-separating
// the entries.
std::string url_list;
- for (; !iter.IsAtEnd(); iter.Advance()) {
- const content::RenderWidgetHost* widget = iter.GetCurrentValue();
- DCHECK(widget);
- if (!widget || !widget->IsRenderView())
+
+ scoped_ptr<content::RenderWidgetHost::List> hosts =
+ content::RenderWidgetHost::GetRenderWidgetHosts();
+ for (content::RenderWidgetHost::List::const_iterator it = hosts->begin();
+ it != hosts->end();
+ ++it) {
+ const content::RenderWidgetHost* widget = *it;
+ if (widget->GetProcess()->GetID() != host->GetID())
+ continue;
+
+ if (!widget->IsRenderView())
continue;
content::RenderViewHost* view =

Powered by Google App Engine
This is Rietveld 408576698