summaryrefslogtreecommitdiff
path: root/content/browser/browser_main_loop.cc
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2013-07-25 10:06:34 +0100
committerBen Murdoch <benm@google.com>2013-07-25 10:06:34 +0100
commitbbcdd45c55eb7c4641ab97aef9889b0fc828e7d3 (patch)
tree51387d1614b16fcf107004649d44707d271da339 /content/browser/browser_main_loop.cc
parent8a142c18176c4e279012cb218f060cfc3df087c5 (diff)
downloadchromium_org-bbcdd45c55eb7c4641ab97aef9889b0fc828e7d3.tar.gz
Merge from Chromium at DEPS revision r213605
This commit was generated by merge_to_master.py. Change-Id: I5ef9e03bf077dac295a7904f06b3cb6dec9fe213
Diffstat (limited to 'content/browser/browser_main_loop.cc')
-rw-r--r--content/browser/browser_main_loop.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/content/browser/browser_main_loop.cc b/content/browser/browser_main_loop.cc
index 241b7e502f..d95dbb5941 100644
--- a/content/browser/browser_main_loop.cc
+++ b/content/browser/browser_main_loop.cc
@@ -96,6 +96,10 @@
#include "content/browser/zygote_host/zygote_host_impl_linux.h"
#endif
+#if defined(TCMALLOC_TRACE_MEMORY_SUPPORTED)
+#include "third_party/tcmalloc/chromium/src/gperftools/heap-profiler.h"
+#endif
+
#if defined(USE_X11)
#include <X11/Xlib.h>
#endif
@@ -469,6 +473,14 @@ void BrowserMainLoop::MainMessageLoopStart() {
memory_observer_.reset(new MemoryObserver());
base::MessageLoop::current()->AddTaskObserver(memory_observer_.get());
}
+
+#if defined(TCMALLOC_TRACE_MEMORY_SUPPORTED)
+ trace_memory_controller_.reset(new base::debug::TraceMemoryController(
+ base::MessageLoop::current()->message_loop_proxy(),
+ ::HeapProfilerWithPseudoStackStart,
+ ::HeapProfilerStop,
+ ::GetHeapProfile));
+#endif
}
void BrowserMainLoop::CreateThreads() {
@@ -629,6 +641,8 @@ void BrowserMainLoop::ShutdownThreadsAndCleanUp() {
if (parts_)
parts_->PostMainMessageLoopRun();
+ trace_memory_controller_.reset();
+
#if !defined(OS_IOS)
// Destroying the GpuProcessHostUIShims on the UI thread posts a task to
// delete related objects on the GPU thread. This must be done before