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

Unified Diff: content/common/child_thread.cc

Issue 10041017: Show gpu process stats in about:tcmalloc (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address nits, call OnStatsForChildProcess directly from IO thread instead of posting to UI Created 8 years, 8 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/common/child_thread.h ('k') | content/content_browser.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/child_thread.cc
diff --git a/content/common/child_thread.cc b/content/common/child_thread.cc
index 92773642517aa1782c7db0237f09ce4ffef257f5..b701ba2663bcab81335b7f033cadf2064fc6ed23 100644
--- a/content/common/child_thread.cc
+++ b/content/common/child_thread.cc
@@ -27,6 +27,10 @@
#include "content/common/handle_enumerator_win.h"
#endif
+#if defined(USE_TCMALLOC)
+#include "third_party/tcmalloc/chromium/src/gperftools/malloc_extension.h"
+#endif
+
using tracked_objects::ThreadData;
ChildThread::ChildThread() {
@@ -191,6 +195,9 @@ bool ChildThread::OnMessageReceived(const IPC::Message& msg) {
IPC_MESSAGE_HANDLER(ChildProcessMsg_GetChildProfilerData,
OnGetChildProfilerData)
IPC_MESSAGE_HANDLER(ChildProcessMsg_DumpHandles, OnDumpHandles)
+#if defined(USE_TCMALLOC)
+ IPC_MESSAGE_HANDLER(ChildProcessMsg_GetTcmallocStats, OnGetTcmallocStats)
+#endif
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
@@ -246,6 +253,16 @@ void ChildThread::OnDumpHandles() {
NOTIMPLEMENTED();
}
+#if defined(USE_TCMALLOC)
+void ChildThread::OnGetTcmallocStats() {
+ std::string result;
+ char buffer[1024 * 32];
+ MallocExtension::instance()->GetStats(buffer, sizeof(buffer));
+ result.append(buffer);
+ Send(new ChildProcessHostMsg_TcmallocStats(result));
+}
+#endif
+
ChildThread* ChildThread::current() {
return ChildProcess::current()->main_thread();
}
« no previous file with comments | « content/common/child_thread.h ('k') | content/content_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698