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

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

Issue 7888024: Move handle dumpage to the renderer process (so that it works correctly) and factor out redundant... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 3 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 | « content/browser/renderer_host/render_process_host.h ('k') | content/common/child_process_messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/render_process_host.cc
===================================================================
--- content/browser/renderer_host/render_process_host.cc (revision 101774)
+++ content/browser/renderer_host/render_process_host.cc (working copy)
@@ -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 @@
// 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(
« no previous file with comments | « content/browser/renderer_host/render_process_host.h ('k') | content/common/child_process_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698