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

Unified Diff: content/browser/browser_main_loop.cc

Issue 15418002: Record Chrome trace events in tcmalloc heap profiles (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase, cleanup Created 7 years, 6 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
Index: content/browser/browser_main_loop.cc
diff --git a/content/browser/browser_main_loop.cc b/content/browser/browser_main_loop.cc
index 742d675d03cdf399dce5234679845faf2a7a1243..fbed41a005d7f16b6cdb16bf9665f8ffe04d3305 100644
--- a/content/browser/browser_main_loop.cc
+++ b/content/browser/browser_main_loop.cc
@@ -481,6 +481,12 @@ void BrowserMainLoop::MainMessageLoopStart() {
memory_observer_.reset(new MemoryObserver());
base::MessageLoop::current()->AddTaskObserver(memory_observer_.get());
}
+
+ // TODO(jamescook): Support all tcmalloc platforms, including Windows.
nduca 2013/06/20 20:09:29 How about always creating it, but have the observe
James Cook 2013/06/29 00:02:42 Done. Also consolidated all the macro craziness in
+#if defined(USE_TCMALLOC) && (defined(OS_LINUX) || defined(OS_ANDROID))
+ trace_memory_observer_.reset(new base::debug::TraceMemoryTraceLogObserver(
+ base::MessageLoop::current()->message_loop_proxy()));
+#endif
dsinclair 2013/06/18 15:30:15 Does this also need to be done in places like the
James Cook 2013/06/29 00:02:42 Probably. I think I can shim this in around GpuMai
}
void BrowserMainLoop::CreateThreads() {
@@ -637,6 +643,11 @@ void BrowserMainLoop::ShutdownThreadsAndCleanUp() {
if (parts_)
parts_->PostMainMessageLoopRun();
+ // TODO(jamescook): Support all tcmalloc platforms, including Windows.
+#if defined(USE_TCMALLOC) && (defined(OS_LINUX) || defined(OS_ANDROID))
+ trace_memory_observer_.reset();
+#endif
+
#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

Powered by Google App Engine
This is Rietveld 408576698