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

Unified Diff: chrome/app/chrome_main_delegate.cc

Issue 999883002: Profiler-instrumentation of the startup time. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 5 years, 9 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/app/chrome_main_delegate.cc
diff --git a/chrome/app/chrome_main_delegate.cc b/chrome/app/chrome_main_delegate.cc
index e17bf8128a60481133fadce18f5e95458de29590..1bf782f15ad7a3d829c3e8fa779a6095bc228797 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,16 @@ ChromeMainDelegate::CreateContentUtilityClient() {
return g_chrome_content_utility_client.Pointer();
#endif
}
+
+void ChromeMainDelegate::EnableProfilerRecording() {
vadimt 2015/03/12 17:54:56 Rename to MaybeEnableProfilerRecording. Or, make
yao 2015/03/12 18:16:16 How about still enable it inside the function, but
+ switch (chrome::VersionInfo::GetChannel()) {
+ case chrome::VersionInfo::CHANNEL_UNKNOWN:
vadimt 2015/03/12 17:54:56 Shift right. (Are you using gil cl format, BTW?)
yao 2015/03/12 18:16:16 Done.
+ case chrome::VersionInfo::CHANNEL_CANARY:
+ tracked_objects::ScopedTracker::Enable();
vadimt 2015/03/12 17:54:56 break after this line.
yao 2015/03/12 18:16:16 Done.
+ case chrome::VersionInfo::CHANNEL_DEV:
+ case chrome::VersionInfo::CHANNEL_BETA:
+ case chrome::VersionInfo::CHANNEL_STABLE:
+ // Don't enable instrumentation.
+ break;
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698