| Index: chrome/browser/chrome_browser_main.cc
|
| diff --git a/chrome/browser/chrome_browser_main.cc b/chrome/browser/chrome_browser_main.cc
|
| index 0c7098c582528da5ee10c1685c92db4fc61ba0c3..9632734e6df826f2377f2c564335e4778c84df2e 100644
|
| --- a/chrome/browser/chrome_browser_main.cc
|
| +++ b/chrome/browser/chrome_browser_main.cc
|
| @@ -540,6 +540,16 @@ void LaunchDevToolsHandlerIfNeeded(const base::CommandLine& command_line) {
|
| }
|
| }
|
|
|
| +base::StackSamplingProfiler::SamplingParams GetStartupSamplingParams() {
|
| + // Sample at 10Hz for 30 seconds.
|
| + base::StackSamplingProfiler::SamplingParams params;
|
| + params.initial_delay = base::TimeDelta::FromMilliseconds(0);
|
| + params.bursts = 1;
|
| + params.samples_per_burst = 300;
|
| + params.sampling_interval = base::TimeDelta::FromMilliseconds(100);
|
| + return params;
|
| +}
|
| +
|
| } // namespace
|
|
|
| namespace chrome_browser {
|
| @@ -568,11 +578,26 @@ ChromeBrowserMainParts::ChromeBrowserMainParts(
|
| startup_watcher_(new StartupTimeBomb()),
|
| shutdown_watcher_(new ShutdownWatcherHelper()),
|
| browser_field_trials_(parameters.command_line),
|
| + sampling_profiler_(
|
| + base::PlatformThread::CurrentId(),
|
| + GetStartupSamplingParams(),
|
| + metrics::CallStackProfileMetricsProvider::GetProfilerCallback(
|
| + metrics::CallStackProfileMetricsProvider::Params(
|
| + metrics::CallStackProfileMetricsProvider::PROCESS_STARTUP,
|
| + false))),
|
| profile_(NULL),
|
| run_message_loop_(true),
|
| notify_result_(ProcessSingleton::PROCESS_NONE),
|
| local_state_(NULL),
|
| restart_last_session_(false) {
|
| + const version_info::Channel channel =
|
| + chrome::VersionInfo::GetChannel();
|
| + if (channel == version_info::Channel::UNKNOWN ||
|
| + channel == version_info::Channel::CANARY ||
|
| + channel == version_info::Channel::DEV) {
|
| + sampling_profiler_.Start();
|
| + }
|
| +
|
| // If we're running tests (ui_task is non-null).
|
| if (parameters.ui_task)
|
| browser_defaults::enable_help_app = false;
|
|
|