Index: chrome/app/chrome_main.cc |
diff --git a/chrome/app/chrome_main.cc b/chrome/app/chrome_main.cc |
index 360b7e5def0c4a6700bf22110fe0ef2a7d5f356f..b80d1dfcb623f1dd8c9f7aeeedbd88ae4b25fcba 100644 |
--- a/chrome/app/chrome_main.cc |
+++ b/chrome/app/chrome_main.cc |
@@ -4,6 +4,8 @@ |
#include "chrome/app/chrome_main_delegate.h" |
+#include "base/profiler/scoped_tracker.h" |
+#include "chrome/common/chrome_version_info.h" |
#include "content/public/app/content_main.h" |
#if defined(OS_WIN) |
@@ -63,6 +65,22 @@ int ChromeMain(int argc, const char** argv) { |
params.argv = argv; |
#endif |
+ // TODO(vadimt): Remove the switch statement below once crbug.com/453640 is |
+ // fixed. |
+ // Enable profiler instrumentation depending on the channel. |
+ switch (chrome::VersionInfo::GetChannel()) { |
+ case chrome::VersionInfo::CHANNEL_UNKNOWN: |
+ case chrome::VersionInfo::CHANNEL_CANARY: |
+ tracked_objects::ScopedTracker::Enable(); |
+ break; |
+ |
+ case chrome::VersionInfo::CHANNEL_DEV: |
+ case chrome::VersionInfo::CHANNEL_BETA: |
+ case chrome::VersionInfo::CHANNEL_STABLE: |
+ // Don't enable instrumentation. |
+ break; |
+ } |
+ |
int rv = content::ContentMain(params); |
#if defined(OS_WIN) |