diff options
author | cdn@chromium.org <cdn@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-20 20:28:17 +0000 |
---|---|---|
committer | cdn@chromium.org <cdn@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-20 20:28:17 +0000 |
commit | 177623b42c69743828b8bd0a40c0f07b072ba86d (patch) | |
tree | a3db515744f38bdf3489d0f4c8229b3c33fc2a97 /content/browser/renderer_host/render_process_host.cc | |
parent | 98a9273d8b0c3f873ca66331c9d9a81ab9c9f9e9 (diff) | |
download | chromium_src-177623b42c69743828b8bd0a40c0f07b072ba86d.zip chromium_src-177623b42c69743828b8bd0a40c0f07b072ba86d.tar.gz chromium_src-177623b42c69743828b8bd0a40c0f07b072ba86d.tar.bz2 |
Move handle dumpage to the renderer process (so that it works correctly) and move handle enumerator into common.
BUG=96488
TEST=N/A
Review URL: http://codereview.chromium.org/7888024
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@102004 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/renderer_host/render_process_host.cc')
-rw-r--r-- | content/browser/renderer_host/render_process_host.cc | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/content/browser/renderer_host/render_process_host.cc b/content/browser/renderer_host/render_process_host.cc index 44e52231..958a30d 100644 --- a/content/browser/renderer_host/render_process_host.cc +++ b/content/browser/renderer_host/render_process_host.cc @@ -4,12 +4,14 @@ #include "content/browser/renderer_host/render_process_host.h" +#include "base/command_line.h" #include "base/rand_util.h" #include "base/sys_info.h" #include "content/browser/browser_thread.h" #include "content/browser/child_process_security_policy.h" #include "content/common/child_process_info.h" #include "content/common/content_constants.h" +#include "content/common/content_switches.h" #include "content/common/notification_service.h" namespace { @@ -128,6 +130,23 @@ void RenderProcessHost::Release(int listener_id) { // Make sure that all associated resource requests are stopped. CancelResourceRequests(listener_id); +#if defined(OS_WIN) + // Dump the handle table if handle auditing is enabled. + const CommandLine& browser_command_line = + *CommandLine::ForCurrentProcess(); + if (browser_command_line.HasSwitch(switches::kAuditHandles) || + browser_command_line.HasSwitch(switches::kAuditAllHandles)) { + DumpHandles(); + + // We wait to close the channels until the child process has finished + // dumping handles and sends us ChildProcessHostMsg_DumpHandlesDone. + return; + } +#endif + Cleanup(); +} + +void RenderProcessHost::Cleanup() { // When no other owners of this object, we can delete ourselves if (listeners_.IsEmpty()) { NotificationService::current()->Notify( |