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

Unified Diff: content/app/content_main_runner.cc

Issue 999883002: Profiler-instrumentation of the startup time. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments. 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: content/app/content_main_runner.cc
diff --git a/content/app/content_main_runner.cc b/content/app/content_main_runner.cc
index 863f02be27411b4490f047a8b4d8d944d6216518..43c0d006ccadb7f294366c41e4489e00ba5db2f7 100644
--- a/content/app/content_main_runner.cc
+++ b/content/app/content_main_runner.cc
@@ -21,6 +21,7 @@
#include "base/process/memory.h"
#include "base/process/process_handle.h"
#include "base/profiler/alternate_timer.h"
+#include "base/profiler/scoped_tracker.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
@@ -568,6 +569,12 @@ class ContentMainRunnerImpl : public ContentMainRunner {
base::EnableTerminationOnHeapCorruption();
+ // TODO(yiyaoliu, vadimt): Remove this once crbug.com/453640 is fixed.
+ // Enable profiler recording right after command line is initialized so that
+ // browser startup can be instrumented.
+ if (delegate_ && delegate_->ShouldEnableProfilerRecording())
+ tracked_objects::ScopedTracker::Enable();
+
#if !defined(OS_IOS)
SetProcessTitleFromCommandLine(argv);
#endif

Powered by Google App Engine
This is Rietveld 408576698