Popular sites on the NTP: re-download popular suggestions once per Chrome run
[chromium-blink-merge.git] / chrome / browser / stack_sampling_configuration.h
blobe8c32fcfaf0bfbe3b1d9516339004b3c73fc18e9
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_STACK_SAMPLING_CONFIGURATION_H_
6 #define CHROME_BROWSER_STACK_SAMPLING_CONFIGURATION_H_
8 #include "base/profiler/stack_sampling_profiler.h"
10 // Chooses a configuration for the stack sampling profiler for browser process
11 // startup. This must live outside of ChromeBrowserMainParts so it can be
12 // friended by ChromeMetricsServiceAccessor.
13 class StackSamplingConfiguration {
14 public:
15 StackSamplingConfiguration();
17 // Get the stack sampling params to use for this session.
18 base::StackSamplingProfiler::SamplingParams GetSamplingParams() const;
20 // Returns true if the profiler should be started at all.
21 bool IsProfilerEnabled() const;
23 // Register the chosen configuration as a synthetic field trial.
24 void RegisterSyntheticFieldTrial() const;
26 private:
27 enum ProfileConfiguration {
28 PROFILE_DISABLED,
29 PROFILE_NO_SAMPLES, // Run the profiler thread, but don't collect profiles.
30 PROFILE_5HZ,
31 PROFILE_10HZ,
32 PROFILE_100HZ,
33 PROFILE_COUNT = PROFILE_100HZ
36 const ProfileConfiguration configuration_;
38 DISALLOW_COPY_AND_ASSIGN(StackSamplingConfiguration);
41 #endif // CHROME_BROWSER_STACK_SAMPLING_CONFIGURATION_H_