Chromium Code Reviews| Index: chrome/browser/chrome_browser_main.cc |
| diff --git a/chrome/browser/chrome_browser_main.cc b/chrome/browser/chrome_browser_main.cc |
| index fb5034032e2085bdb551bd929c5420f4eb78b692..45d43ff09686daf433a9d3816d9c99bff7eb10ed 100644 |
| --- a/chrome/browser/chrome_browser_main.cc |
| +++ b/chrome/browser/chrome_browser_main.cc |
| @@ -577,11 +577,14 @@ ChromeBrowserMainParts::ChromeBrowserMainParts( |
| startup_watcher_(new StartupTimeBomb()), |
| shutdown_watcher_(new ShutdownWatcherHelper()), |
| browser_field_trials_(parameters.command_line), |
| + sampling_profiler_(base::PlatformThread::CurrentId(), |
| + GetStartupSamplingParams()), |
| profile_(NULL), |
| run_message_loop_(true), |
| notify_result_(ProcessSingleton::PROCESS_NONE), |
| local_state_(NULL), |
| restart_last_session_(false) { |
| + sampling_profiler_.Start(); |
| // If we're running tests (ui_task is non-null). |
| if (parameters.ui_task) |
| browser_defaults::enable_help_app = false; |
| @@ -724,6 +727,19 @@ void ChromeBrowserMainParts::RecordBrowserStartupTime() { |
| new LoadCompleteListener(); |
| } |
| +// static |
| +base::StackSamplingProfiler::SamplingParams |
|
cpu_(ooo_6.6-7.5)
2015/04/07 00:36:52
this function does not need to be exposed to the i
|
| +ChromeBrowserMainParts::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); |
| + params.preserve_sample_ordering = false; |
| + return params; |
| +} |
| + |
| // ----------------------------------------------------------------------------- |
| // TODO(viettrungluu): move more/rest of BrowserMain() into BrowserMainParts. |