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

Unified Diff: chrome/browser/profiles/profile_destroyer.cc

Issue 11567053: Fix test-running in --single-process mode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Improve comment Created 8 years 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 | chrome/test/base/in_process_browser_test.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
« no previous file with comments | « no previous file | chrome/test/base/in_process_browser_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698