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

Unified Diff: content/browser/renderer_host/render_process_host_impl.cc

Issue 2944603002: Fix nullptr dereference of a RenderProcessHost (Closed)
Patch Set: Created 3 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/render_process_host_impl.cc
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc
index bbb68141231bdfc533f34aade0d62a12225298de..42bf8fc7a6bff09390ae79c2965e494e3d627fee 100644
--- a/content/browser/renderer_host/render_process_host_impl.cc
+++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -695,7 +695,14 @@ class SiteProcessCountTracker : public base::SupportsUserData::Data,
std::map<ProcessID, Count>& counts_per_process = result->second;
for (auto iter : counts_per_process) {
RenderProcessHost* host = RenderProcessHost::FromID(iter.first);
- DCHECK(host);
+ if (!host) {
+ // TODO(clamy): This shouldn't happen but we are getting reports from
+ // the field that this is happening. We need to figure out why some
+ // RenderProcessHosts are not taken out of the map when they're
+ // destroyed.
+ NOTREACHED();
+ continue;
+ }
if (host->VisibleWidgetCount())
foreground_processes->insert(host);
else
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698