summaryrefslogtreecommitdiffstats
path: root/chrome/browser/renderer_host
diff options
context:
space:
mode:
authorsgk@chromium.org <sgk@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-08 06:56:57 +0000
committersgk@chromium.org <sgk@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-08 06:56:57 +0000
commitd4104109bee8967a047254ec82afa6ee1f70ba86 (patch)
tree853ff2e3e931c3c3d239268b5f640bd0f9150625 /chrome/browser/renderer_host
parent9b2a18d8d24244eb1834ce54ac1e82a6dbfc13bc (diff)
downloadchromium_src-d4104109bee8967a047254ec82afa6ee1f70ba86.zip
chromium_src-d4104109bee8967a047254ec82afa6ee1f70ba86.tar.gz
chromium_src-d4104109bee8967a047254ec82afa6ee1f70ba86.tar.bz2
Display tcmalloc debug output from renderer processes in about:tcmalloc.
BUG=none TEST=none Review URL: http://codereview.chromium.org/255080 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28384 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/renderer_host')
-rw-r--r--chrome/browser/renderer_host/resource_message_filter.cc12
-rw-r--r--chrome/browser/renderer_host/resource_message_filter.h4
2 files changed, 16 insertions, 0 deletions
diff --git a/chrome/browser/renderer_host/resource_message_filter.cc b/chrome/browser/renderer_host/resource_message_filter.cc
index 622f8e5e..c133d68 100644
--- a/chrome/browser/renderer_host/resource_message_filter.cc
+++ b/chrome/browser/renderer_host/resource_message_filter.cc
@@ -10,6 +10,7 @@
#include "base/histogram.h"
#include "base/process_util.h"
#include "base/thread.h"
+#include "chrome/browser/browser_about_handler.h"
#include "chrome/browser/child_process_security_policy.h"
#include "chrome/browser/chrome_plugin_browsing_context.h"
#include "chrome/browser/chrome_thread.h"
@@ -372,6 +373,9 @@ bool ResourceMessageFilter::OnMessageReceived(const IPC::Message& msg) {
OnCloseIdleConnections)
IPC_MESSAGE_HANDLER(ViewHostMsg_SetCacheMode, OnSetCacheMode)
IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_GetFileSize, OnGetFileSize)
+#if defined(USE_TCMALLOC)
+ IPC_MESSAGE_HANDLER(ViewHostMsg_RendererTcmalloc, OnRendererTcmalloc)
+#endif
IPC_MESSAGE_UNHANDLED(
handled = false)
@@ -1047,3 +1051,11 @@ void ResourceMessageFilter::ReplyGetFileSize(int64 result, void* param) {
// Getting file size callback done, decrease the ref count.
Release();
}
+
+#if defined(USE_TCMALLOC)
+void ResourceMessageFilter::OnRendererTcmalloc(base::ProcessId pid,
+ const std::string& output) {
+ ui_loop()->PostTask(FROM_HERE,
+ NewRunnableFunction(AboutTcmallocRendererCallback, pid, output));
+}
+#endif
diff --git a/chrome/browser/renderer_host/resource_message_filter.h b/chrome/browser/renderer_host/resource_message_filter.h
index 82bbcdc..a8a37af 100644
--- a/chrome/browser/renderer_host/resource_message_filter.h
+++ b/chrome/browser/renderer_host/resource_message_filter.h
@@ -16,6 +16,7 @@
#include "base/file_path.h"
#include "base/gfx/rect.h"
#include "base/gfx/native_widget_types.h"
+#include "base/process.h"
#include "base/ref_counted.h"
#include "base/shared_memory.h"
#include "base/string16.h"
@@ -173,6 +174,9 @@ class ResourceMessageFilter : public IPC::ChannelProxy::MessageFilter,
void OnDnsPrefetch(const std::vector<std::string>& hostnames);
void OnRendererHistograms(int sequence_number,
const std::vector<std::string>& histogram_info);
+#if defined(USE_TCMALLOC)
+ void OnRendererTcmalloc(base::ProcessId pid, const std::string& output);
+#endif
void OnReceiveContextMenuMsg(const IPC::Message& msg);
// Clipboard messages
void OnClipboardWriteObjects(const Clipboard::ObjectMap& objects);