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

Unified Diff: chrome/app/chrome_main.cc

Issue 866403008: Profiler-instrumentation of the startup time (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Using correct method to initialize thread data Created 5 years, 11 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
« no previous file with comments | « no previous file | content/browser/browser_main_runner.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)
« no previous file with comments | « no previous file | content/browser/browser_main_runner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698