Chromium Code Reviews| Index: chrome/app/chrome_main_delegate.cc |
| diff --git a/chrome/app/chrome_main_delegate.cc b/chrome/app/chrome_main_delegate.cc |
| index e17bf8128a60481133fadce18f5e95458de29590..986185374a10f6941e21b562cfccf29dcc34b96b 100644 |
| --- a/chrome/app/chrome_main_delegate.cc |
| +++ b/chrome/app/chrome_main_delegate.cc |
| @@ -15,6 +15,7 @@ |
| #include "base/path_service.h" |
| #include "base/process/memory.h" |
| #include "base/process/process_handle.h" |
| +#include "base/profiler/scoped_tracker.h" |
| #include "base/strings/string_util.h" |
| #include "build/build_config.h" |
| #include "chrome/browser/chrome_content_browser_client.h" |
| @@ -971,3 +972,18 @@ ChromeMainDelegate::CreateContentUtilityClient() { |
| return g_chrome_content_utility_client.Pointer(); |
| #endif |
| } |
| + |
| +bool ChromeMainDelegate::EnableProfilerRecording() { |
| + switch (chrome::VersionInfo::GetChannel()) { |
| + case chrome::VersionInfo::CHANNEL_UNKNOWN: |
| + case chrome::VersionInfo::CHANNEL_CANARY: |
| + tracked_objects::ScopedTracker::Enable(); |
|
vadimt
2015/03/12 18:23:03
We don't need BOTH returning bool and enabling.
yao
2015/03/12 18:32:19
I don't really have a strong opinion, but what's t
vadimt
2015/03/12 18:37:26
Hypothetically, another implementation may overrid
yao
2015/03/13 15:24:49
Changed as you suggested.
|
| + return true; |
| + case chrome::VersionInfo::CHANNEL_DEV: |
| + case chrome::VersionInfo::CHANNEL_BETA: |
| + case chrome::VersionInfo::CHANNEL_STABLE: |
| + default: |
| + // Don't enable instrumentation. |
| + return false; |
| + } |
| +} |