summaryrefslogtreecommitdiffstats
path: root/chrome/renderer
diff options
context:
space:
mode:
authorfischman@chromium.org <fischman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-09 20:51:34 +0000
committerfischman@chromium.org <fischman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-09 20:51:34 +0000
commitf2c2b3c339a86727ee40549fa3c36b91ce9a3e0a (patch)
treec3f4202327f35f8ecc496340d900bee61aaadf10 /chrome/renderer
parent1b121768708093cf6f50919e8a6a045b83e62d43 (diff)
downloadchromium_src-f2c2b3c339a86727ee40549fa3c36b91ce9a3e0a.zip
chromium_src-f2c2b3c339a86727ee40549fa3c36b91ce9a3e0a.tar.gz
chromium_src-f2c2b3c339a86727ee40549fa3c36b91ce9a3e0a.tar.bz2
Revert 96054 - Enable tcmalloc profiling and heap dump.
BUG=chromium-os:18876 TEST=See issue. Review URL: http://codereview.chromium.org/7528016 TBR=stevenjb@google.com Review URL: http://codereview.chromium.org/7607009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@96065 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer')
-rw-r--r--chrome/renderer/chrome_render_process_observer.cc33
-rw-r--r--chrome/renderer/chrome_render_process_observer.h3
2 files changed, 2 insertions, 34 deletions
diff --git a/chrome/renderer/chrome_render_process_observer.cc b/chrome/renderer/chrome_render_process_observer.cc
index 9f9a6a7..7805e7b 100644
--- a/chrome/renderer/chrome_render_process_observer.cc
+++ b/chrome/renderer/chrome_render_process_observer.cc
@@ -33,7 +33,6 @@
#include "net/base/net_module.h"
#include "third_party/sqlite/sqlite3.h"
#include "third_party/tcmalloc/chromium/src/google/malloc_extension.h"
-#include "third_party/tcmalloc/chromium/src/google/heap-profiler.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebCache.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebCrossOriginPreflightResultCache.h"
@@ -408,10 +407,6 @@ bool ChromeRenderProcessObserver::OnControlMessageReceived(
IPC_MESSAGE_HANDLER(ViewMsg_SetFieldTrialGroup, OnSetFieldTrialGroup)
#if defined(USE_TCMALLOC)
IPC_MESSAGE_HANDLER(ViewMsg_GetRendererTcmalloc, OnGetRendererTcmalloc)
- IPC_MESSAGE_HANDLER(ViewMsg_SetTcmallocHeapProfiling,
- OnSetTcmallocHeapProfiling)
- IPC_MESSAGE_HANDLER(ViewMsg_WriteTcmallocHeapProfile,
- OnWriteTcmallocHeapProfile)
#endif
IPC_MESSAGE_HANDLER(ViewMsg_GetV8HeapStats, OnGetV8HeapStats)
IPC_MESSAGE_HANDLER(ViewMsg_GetCacheResourceStats, OnGetCacheResourceStats)
@@ -463,35 +458,11 @@ void ChromeRenderProcessObserver::OnGetCacheResourceStats() {
void ChromeRenderProcessObserver::OnGetRendererTcmalloc() {
std::string result;
char buffer[1024 * 32];
+ base::ProcessId pid = base::GetCurrentProcId();
MallocExtension::instance()->GetStats(buffer, sizeof(buffer));
result.append(buffer);
- Send(new ViewHostMsg_RendererTcmalloc(result));
+ Send(new ViewHostMsg_RendererTcmalloc(pid, result));
}
-
-void ChromeRenderProcessObserver::OnSetTcmallocHeapProfiling(
- bool profiling, const std::string& filename_prefix) {
- if (profiling)
- HeapProfilerStart(filename_prefix.c_str());
- else
- HeapProfilerStop();
-}
-
-void ChromeRenderProcessObserver::OnWriteTcmallocHeapProfile(
- const FilePath::StringType& filename) {
- if (!IsHeapProfilerRunning())
- return;
- char* profile = GetHeapProfile();
- if (!profile) {
- LOG(WARNING) << "Unable to get heap profile.";
- return;
- }
- // The render process can not write to a file, so copy the result into
- // a string and pass it to the handler (which runs on the browser host).
- std::string result(profile);
- delete profile;
- Send(new ViewHostMsg_WriteTcmallocHeapProfile_ACK(filename, result));
-}
-
#endif
void ChromeRenderProcessObserver::OnSetFieldTrialGroup(
diff --git a/chrome/renderer/chrome_render_process_observer.h b/chrome/renderer/chrome_render_process_observer.h
index 80bf18ef..9361290 100644
--- a/chrome/renderer/chrome_render_process_observer.h
+++ b/chrome/renderer/chrome_render_process_observer.h
@@ -9,7 +9,6 @@
#include <string>
#include "base/compiler_specific.h"
-#include "base/file_path.h"
#include "base/memory/scoped_ptr.h"
#include "content/renderer/render_process_observer.h"
@@ -50,8 +49,6 @@ class ChromeRenderProcessObserver : public RenderProcessObserver {
void OnSetFieldTrialGroup(const std::string& fiel_trial_name,
const std::string& group_name);
void OnGetRendererTcmalloc();
- void OnSetTcmallocHeapProfiling(bool profiling, const std::string& prefix);
- void OnWriteTcmallocHeapProfile(const FilePath::StringType& filename);
void OnGetV8HeapStats();
void OnPurgeMemory();