Index: chrome/browser/profiles/profile_destroyer.cc |
diff --git a/chrome/browser/profiles/profile_destroyer.cc b/chrome/browser/profiles/profile_destroyer.cc |
index 59f7dd5ad7c954d9ded6f902305e5c1e4afac458..8c98be2d0669b0884a0712511309e7981390d126 100644 |
--- a/chrome/browser/profiles/profile_destroyer.cc |
+++ b/chrome/browser/profiles/profile_destroyer.cc |
@@ -35,9 +35,15 @@ void ProfileDestroyer::DestroyProfileWhenAppropriate(Profile* const profile) { |
if (!profile->IsOffTheRecord() && profile->HasOffTheRecordProfile()) |
GetHostsForProfile(profile->GetOffTheRecordProfile(), &hosts); |
} |
- // This should never happen for non Off the record profile, this means that |
- // there is a leak in a render process host that MUST BE FIXED!!! |
- DCHECK(hosts.empty() || profile->IsOffTheRecord()); |
+ // Generally, !hosts.empty() means that there is a leak in a render process |
+ // host that MUST BE FIXED!!! |
+ // |
+ // However, off-the-record profiles are destroyed before their |
+ // RenderProcessHosts in order to erase private data quickly, and |
+ // RenderProcessHostImpl::Release() avoids destroying RenderProcessHosts in |
+ // --single-process mode to avoid race conditions. |
+ DCHECK(hosts.empty() || profile->IsOffTheRecord() || |
+ content::RenderProcessHost::run_renderer_in_process()); |
// Note that we still test for !profile->IsOffTheRecord here even though we |
// DCHECK'd above because we want to protect Release builds against this even |
// we need to identify if there are leaks when we run Debug builds. |