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

Side by Side Diff: chrome/browser/stack_sampling_configuration.h

Issue 2375563002: Stack sampling profiler: move configuration to chrome/common (Closed)
Patch Set: remove closure Created 4 years, 2 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 unified diff | Download patch
OLDNEW
(Empty)
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.
4
5 #ifndef CHROME_BROWSER_STACK_SAMPLING_CONFIGURATION_H_
6 #define CHROME_BROWSER_STACK_SAMPLING_CONFIGURATION_H_
7
8 #include "base/macros.h"
9 #include "base/profiler/stack_sampling_profiler.h"
10
11 // Chooses a configuration for the stack sampling profiler for browser process
12 // startup. This must live outside of ChromeBrowserMainParts so it can be
13 // friended by ChromeMetricsServiceAccessor.
14 class StackSamplingConfiguration {
15 public:
16 StackSamplingConfiguration();
17
18 // Get the stack sampling params to use for this session.
19 base::StackSamplingProfiler::SamplingParams GetSamplingParams() const;
20
21 // Returns true if the profiler should be started at all.
22 bool IsProfilerEnabled() const;
23
24 // Register the chosen configuration as a synthetic field trial.
25 void RegisterSyntheticFieldTrial() const;
26
27 private:
28 enum ProfileConfiguration {
29 PROFILE_DISABLED,
30 PROFILE_CONTROL,
31 PROFILE_NO_SAMPLES, // Run the profiler thread, but don't collect profiles.
32 PROFILE_5HZ,
33 PROFILE_10HZ,
34 PROFILE_100HZ
35 };
36
37 static ProfileConfiguration GenerateConfiguration();
38
39 const ProfileConfiguration configuration_;
40
41 DISALLOW_COPY_AND_ASSIGN(StackSamplingConfiguration);
42 };
43
44 #endif // CHROME_BROWSER_STACK_SAMPLING_CONFIGURATION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698