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

Unified Diff: chrome/browser/chrome_browser_main.cc

Issue 2386123003: Add heap allocator usage to task profiler. (Closed)
Patch Set: Figure out where the @#$%! corruption is coming from. Move heap tracking to TaskStopwatch." Created 4 years, 2 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: chrome/browser/chrome_browser_main.cc
diff --git a/chrome/browser/chrome_browser_main.cc b/chrome/browser/chrome_browser_main.cc
index 2fbad19680d929775e8c2076506e6afa5e606ba1..cd88e3bea5ec9024c44b6f55ac531c35b86c334e 100644
--- a/chrome/browser/chrome_browser_main.cc
+++ b/chrome/browser/chrome_browser_main.cc
@@ -14,6 +14,7 @@
#include <utility>
#include <vector>
+#include "base/allocator/features.h"
#include "base/at_exit.h"
#include "base/base_switches.h"
#include "base/bind.h"
@@ -1138,6 +1139,14 @@ int ChromeBrowserMainParts::PreCreateThreadsImpl() {
tracked_objects::ThreadData::PROFILING_ACTIVE;
if (flag.compare("0") != 0)
status = tracked_objects::ThreadData::DEACTIVATED;
+
+#if BUILDFLAG(USE_EXPERIMENTAL_ALLOCATOR_SHIM)
+ // If profiling is enabled and the heap shim is available, turn on heap
+ // tracking as well.
+ if (status != tracked_objects::ThreadData::DEACTIVATED)
+ base::debug::HeapUsageTracker::EnableHeapTracking();
+#endif
+
tracked_objects::ThreadData::InitializeAndSetTrackingStatus(status);
}

Powered by Google App Engine
This is Rietveld 408576698