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

Unified Diff: chrome/renderer/chrome_render_process_observer.cc

Issue 7607009: Revert 96054 - Enable tcmalloc profiling and heap dump. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 4 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 | « chrome/renderer/chrome_render_process_observer.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/chrome_render_process_observer.cc
===================================================================
--- chrome/renderer/chrome_render_process_observer.cc (revision 96064)
+++ chrome/renderer/chrome_render_process_observer.cc (working copy)
@@ -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 @@
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::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(
« no previous file with comments | « chrome/renderer/chrome_render_process_observer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698